Skip to content

Conversation

QuantumMisaka
Copy link
Collaborator

Toolchain scripts for quickly and properly compile and install dependencies of ABACUS including:

  • gnu-toolchain
    • gcc (always in system)
    • openblas
    • openmpi or mpich
    • scalapack, fftw, elpa , libxc
    • cereal, libnpy, libtorch
  • intel-toolchain (likely)

Version 2023.1 inspired by cp2k-toolchain.
Still need more test and improvement, but can have good usage.

The toolchain directory is designed to be in the path of ABACUS itself.

Toolchain scripts for quickly and properly compile and install dependencies of ABACUS including:

- gnu-toolchain
- - `gcc` (always in system)
- - `openblas`
- - `openmpi` or `mpich`
- - `scalapack`, `fftw`, `elpa` , `libxc`
- - `cereal`, `libnpy`, `libtorch`
- intel-toolchain (likely)

Version 2023.1 inspired by cp2k-toolchain.
Still need more test and improvement, but can have good usage.

The toolchain directory is designed to be in the path of ABACUS itself.
@dyzheng
Copy link
Collaborator

dyzheng commented Aug 22, 2023

There are too much new files in this PR. Please check your changes.

too much file mainly in libs/cereal and libs/libnpy, make them easier so less is more
@QuantumMisaka
Copy link
Collaborator Author

@dyzheng Got it, much new file mainly in libs/cereal and libs/libnpy, now fix it.

Copy link
Member

@caic99 caic99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QuantumMisaka
Thanks for your contribution! I believe these script will help users a lot.

However, please remove the release packages under libs. Doing so is an action of redistribution and integration of those software packages. This is strongly not recommended because it might introduce incompatibility on licenses. (And you did not include the license files of those packages.)

It is OK to download them in your script. If you think integrating them in ABACUS repo is necessary, please use git submodule.
Thanks!

@caic99
Copy link
Member

caic99 commented Aug 23, 2023

@QuantumMisaka And, if you wish, you can add docs or links to the toolchain under corresponding parts of abacus-develop/docs in online docs to promote it.

@QuantumMisaka
Copy link
Collaborator Author

@caic99 I also want to remove the libraries in libs and use toolchain to install it, I'm trying to do this but It's hard to choose the way to introduce the installation (by git clone or wget from the release, and neither way can bypass github.com, which will bring the HTTP problem). So I highly want to solve this with your help.

Also, the docs file is in plan. I'm wandering if the README file can be directly copy to docs directory,

Thanks !

@caic99
Copy link
Member

caic99 commented Aug 23, 2023

@caic99 I also want to remove the libraries in libs and use toolchain to install it, I'm trying to do this but It's hard to choose the way to introduce the installation (by git clone or wget from the release, and neither way can bypass github.com, which will bring the HTTP problem). So I highly want to solve this with your help.

In principle it is the user's responsibiliy guaranteeing the internet connection. However, considering the actual situations, maybe you can provide some mirror sites of GitHub (e.g. fastgit) in place of the fixed base domain of github.com . Using gitee mirroring service is a more secure way.

Also, the docs file is in plan. I'm wandering if the README file can be directly copy to docs directory

Please choose a good place for it to maintain the structure. Maybe under quick_start folder, and add an introduction for it at easy_install.md? What do you think?

QuantumMisaka and others added 4 commits August 23, 2023 22:14
- use toolchain scripts to install `cereal` and `libnpy` by `wget` from github.com, remove `libs` directory at the same time
- fix some bug in intel-toolchain
- update README
- update executable permission
update readme
QuantumMisaka and others added 15 commits August 24, 2023 08:48
Co-authored-by: Chun Cai <amoycaic@gmail.com>
- update README
- update easy_install.md
add target for acml toolchain
update a quick way to use intel-mpich toolchain installation
which has the best speed in test on intel-8358 HPC server
default gnu toolchain change to openmpi ,which is more efficient in most of the test
- update env setting after installation in `setup`
- update build method of intel-toolchain and intel-mpich toolchain
- minor bug fixed
@QuantumMisaka
Copy link
Collaborator Author

@caic99 A problem in my try for introducing LibRI in dep to toolchain installation by using intel-icc-toolchain

In file included from /lustre/home/2201110432/apps/abacus/icc-mkl/deps/LibRI/include/RI/global/Tensor.h(8),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_matrix.h(13),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_io/restart.h(6),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_hamilt_pw/hamilt_pwdft/global.h(8),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_cell/klist.cpp(1):
/lustre/home/2201110432/apps/abacus/icc-mkl/deps/LibRI/include/RI/global/Shared_Vector.h(8): catastrophic error: cannot open source file "cereal/cereal.hpp"
  #include <cereal/cereal.hpp>

compilation aborted for /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_cell/klist.cpp (code 4)
gmake[2]: *** [source/module_cell/CMakeFiles/cell.dir/build.make:244: source/module_cell/CMakeFiles/cell.dir/klist.cpp.o] Error 4

What's the best way for LibRI to find CEREAL ?

@caic99
Copy link
Member

caic99 commented Sep 1, 2023

@caic99 A problem in my try for introducing LibRI in dep to toolchain installation by using intel-icc-toolchain

In file included from /lustre/home/2201110432/apps/abacus/icc-mkl/deps/LibRI/include/RI/global/Tensor.h(8),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_hamilt_lcao/hamilt_lcaodft/LCAO_matrix.h(13),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_io/restart.h(6),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_hamilt_pw/hamilt_pwdft/global.h(8),
                 from /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_cell/klist.cpp(1):
/lustre/home/2201110432/apps/abacus/icc-mkl/deps/LibRI/include/RI/global/Shared_Vector.h(8): catastrophic error: cannot open source file "cereal/cereal.hpp"
  #include <cereal/cereal.hpp>

compilation aborted for /lustre/home/2201110432/apps/abacus/icc-mkl/source/module_cell/klist.cpp (code 4)
gmake[2]: *** [source/module_cell/CMakeFiles/cell.dir/build.make:244: source/module_cell/CMakeFiles/cell.dir/klist.cpp.o] Error 4

What's the best way for LibRI to find CEREAL ?

Hi @QuantumMisaka ,
Please check if LibRI has CEREAL for its git submodule. If not so, you can add CEREAL as an submodule in your toolchain.

@caic99
Copy link
Member

caic99 commented Sep 1, 2023

Hi @QuantumMisaka , Please check if LibRI has CEREAL for its git submodule. If not so, you can add CEREAL as an submodule in your toolchain.

@QuantumMisaka Update: Please check in your terminal if cereal/cereal.hpp can be opened in editor like vim. If the file is not present, the warning message would be fatal error: xxx.h: No such file or directory, but not catastrophic error: cannot open source file. The latter means the file presents, but the compiler can not open it. Please check file access permission.

@QuantumMisaka
Copy link
Collaborator Author

@QuantumMisaka Update: Please check in your terminal if cereal/cereal.hpp can be opened in editor like vim. If the file is not present, the warning message would be fatal error: xxx.h: No such file or directory, but not catastrophic error: cannot open source file. The latter means the file presents, but the compiler can not open it. Please check file access permission.

  • The permission of cereal.hpp is 644, which can be open by vim,
  • The problem still exists after change permission of cereal.hpp to 777
  • The problem will be fixed if `export CPATH="cereal/include":$CPATH

Libtorch 2.0.1 will lead to lots of warning in abacus build process
@caic99 caic99 changed the title Toolkits: abacus toolchain Feature: add abacus toolchain Sep 1, 2023
@caic99 caic99 merged commit c5ec30e into deepmodeling:develop Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants