Skip to content

Commit c8c0a10

Browse files
Toochain update: new download url and MPICH/OpenMPI version (#5088)
* Add url download function * add -O option for wget * using url downloader in stage4 * update mpich version * Update README.md * disable rapidjson by default related to #5069 * add information for abacus_env.sh * modify info of abacus_env.sh * add information for gcc toolchain * update OpenMPI version to 5.0.5 * Update README.md * change the download url for openmpi * Update README.md * fix link of openmpi * fix openmpi url * Update install_libtorch.sh * update date of update --------- Co-authored-by: kirk0830 <[email protected]>
1 parent 03c2582 commit c8c0a10

14 files changed

+174
-89
lines changed

toolchain/README.md

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# The ABACUS Toolchain
2+
23
Version 2024.2
34

45
## Author
6+
57
[QuantumMisaka](https://github.com/QuantumMisaka)
68
(Zhaoqing Liu) @PKU @AISI
79

@@ -25,7 +27,7 @@ and give setup files that you can use to compile ABACUS.
2527
- [x] Support for [LibRI](https://github.com/abacusmodeling/LibRI) by submodule or automatic installation from github.com (but installed LibRI via `wget` seems to have some problem, please be cautious)
2628
- [x] A mirror station by Bohrium database, which can download CEREAL, LibNPY, LibRI and LibComm by `wget` in China Internet.
2729
- [x] Support for GPU compilation, users can add `-DUSE_CUDA=1` in builder scripts.
28-
- [ ] A better mirror station for all packages.
30+
- [ ] Change the downloading url from cp2k mirror to other mirror or directly downloading from official website. (doing)
2931
- [ ] A better README and Detail markdown file.
3032
- [ ] Automatic installation of [DEEPMD](https://github.com/deepmodeling/deepmd-kit).
3133
- [ ] Better compliation method for ABACUS-DEEPMD and ABACUS-DEEPKS.
@@ -35,11 +37,11 @@ and give setup files that you can use to compile ABACUS.
3537

3638

3739
## Usage Online & Offline
40+
3841
Main script is *install_abacus_toolchain.sh*,
3942
which will use scripts in *scripts* directory
4043
to compile install dependencies of ABACUS.
41-
42-
You can just `./install_abacus_toolchain.sh -h` to get more help message.
44+
It can be directly used, but not recommended.
4345

4446
There are also well-modified script to run *install_abacus_toolchain.sh* for `gnu-openblas` and `intel-mkl` toolchains dependencies.
4547

@@ -51,6 +53,7 @@ There are also well-modified script to run *install_abacus_toolchain.sh* for `gn
5153
# for intel-mkl-mpich
5254
> ./toolchain_intel-mpich.sh
5355
```
56+
5457
It is recommended to run them first to get a fast installation of ABACUS under certain environments.
5558

5659
If you have a fresh environments and you have `sudo` permission, you can use *install_requirements.sh* to install system libraries and dependencies needed by toolchain.
@@ -66,6 +69,7 @@ If you have a fresh environments and you have `sudo` permission, you can use *in
6669
```
6770

6871
All packages will be downloaded from [cp2k-static/download](https://www.cp2k.org/static/downloads). by `wget` , and will be detailedly compiled and installed in `install` directory by toolchain scripts, despite of:
72+
6973
- `CEREAL` which will be downloaded from [CEREAL](https://github.com/USCiLab/cereal)
7074
- `Libnpy` which will be downloaded from [LIBNPY](https://github.com/llohse/libnpy)
7175
- `LibRI` which will be downloaded from [LibRI](https://github.com/abacusmodeling/LibRI)
@@ -77,12 +81,17 @@ Instead of github.com, we offer other package station, you can use it by:
7781
```shell
7882
wget https://bohrium-api.dp.tech/ds-dl/abacus-deps-93wi-v3 -O abacus-deps-v3.zip
7983
```
80-
`unzip` it ,and you can do offline installation of these packages above after rename. The above station will be updated handly but one should notice that the version will always lower than github repo.
84+
`unzip` it ,and you can do offline installation of these packages above after rename.
85+
```shell
86+
# packages downloaded from github.com
87+
mv v1.3.2.tar.gz build/cereal-1.3.2.tar.gz
88+
```
89+
The above station will be updated handly but one should notice that the version will always lower than github repo.
8190

8291
If one want to install ABACUS by toolchain OFFLINE,
8392
one can manually download all the packages from [cp2k-static/download](https://www.cp2k.org/static/downloads) or official website
8493
and put them in *build* directory by formatted name
85-
like *fftw-3.3.10.tar.gz*, or *openmpi-5.0.3.tar.gz*,
94+
like *fftw-3.3.10.tar.gz*, or *openmpi-5.0.5.tar.bz2*,
8695
then run this toolchain.
8796
All package will be detected and installed automatically.
8897
Also, one can install parts of packages OFFLINE and parts of packages ONLINE
@@ -96,10 +105,11 @@ just by using this toolchain
96105
```
97106

98107
The needed dependencies version default:
108+
99109
- `cmake` 3.30.0
100110
- `gcc` 13.2.0 (which will always NOT be installed, But use system)
101-
- `OpenMPI` 5.0.3
102-
- `MPICH` 4.1.2
111+
- `OpenMPI` 5.0.5
112+
- `MPICH` 4.2.2
103113
- `OpenBLAS` 0.3.27 (Intel toolchain need `get_vars.sh` tool from it)
104114
- `ScaLAPACK` 2.2.1
105115
- `FFTW` 3.3.10
@@ -111,28 +121,21 @@ And Intel-oneAPI need user or server manager to manually install from Intel.
111121
[Intel-oneAPI](https://www.intel.cn/content/www/cn/zh/developer/tools/oneapi/toolkits.html)
112122

113123
Dependencies below are optional, which is NOT installed by default:
124+
114125
- `LibTorch` 2.1.2
115126
- `Libnpy` 1.0.1
116127
- `LibRI` 0.2.0
117128
- `LibComm` 0.1.1
118-
Users can install them by using `--with-*=install` in toolchain*.sh, which is `no` in default.
119-
> Notice: LibRI, LibComm and Libnpy is on actively development, you should check-out the package version when using this toolchain. Also, LibRI and LibComm can be installed by github submodule, which is also work for libnpy, which is more recommended.
120129

121-
Notice: for `CEREAL`,`RapidJSON`, `Libnpy`, `LibRI` and `LibComm`,
122-
you need to download them from github.com,
123-
rename it as formatted, and put them in `build` directory at the same time
124-
e.g.:
125-
```shell
126-
# packages downloaded from github.com
127-
mv v1.3.2.tar.gz build/cereal-1.3.2.tar.gz
128-
```
130+
Users can install them by using `--with-*=install` in toolchain*.sh, which is `no` in default.
131+
> Notice: LibRI, LibComm and Libnpy is on actively development, you should check-out the package version when using this toolchain. Also, LibRI and LibComm can be installed by github submodule, that is also work for libnpy, which is more recommended.
129132
130133
Users can easily compile and install dependencies of ABACUS
131134
by running these scripts after loading `gcc` or `intel-mkl-mpi`
132135
environment.
133136

134137
The toolchain installation process can be interrupted at anytime.
135-
just re-run *install_abacus_toolchain.sh*, toolchain itself may fix it
138+
just re-run *toolchain_\*.sh*, toolchain itself may fix it
136139

137140
If compliation is successful, a message will be shown like this:
138141

@@ -147,6 +150,7 @@ If compliation is successful, a message will be shown like this:
147150
> ./build_abacus_intel.sh
148151
> or you can modify the builder scripts to suit your needs.
149152
```
153+
150154
You can run *build_abacus_gnu.sh* or *build_abacus_intel.sh* to build ABACUS
151155
by gnu-toolchain or intel-toolchain respectively, the builder scripts will
152156
automatically locate the environment and compile ABACUS.
@@ -160,17 +164,28 @@ If users want to use toolchain but lack of some system library
160164
dependencies, *install_requirements.sh* scripts will help.
161165

162166
If users want to re-install all the package, just do:
167+
163168
```shell
164169
> rm -rf install
165170
```
171+
166172
or you can also do it in a more completely way:
173+
167174
```shell
168175
> rm -rf install build/*/* build/OpenBLAS*/ build/setup_*
169176
```
170177

171-
## Common Problem and Solution
178+
## Common Problems and Solutions
179+
180+
### LibRI and LibComm for EXX
181+
182+
- GCC toolchain with OpenMPI cannot compile LibComm v0.1.1 due to the different MPI variable type from MPICH and IntelMPI, see discussion here [#5033](https://github.com/deepmodeling/abacus-develop/issues/5033), you can switch to GCC-MPICH or Intel toolchain
183+
- It is recommended to use Intel toolchain if one wants to include EXX feature in ABACUS, which can have much better performance and can use more than 16 threads in OpenMP parallelization to accelerate the EXX process.
184+
172185
### GPU version of ABACUS
173-
add following options in build*.sh:
186+
187+
For GPU version of ABACUS (do not GPU version installer of ELPA, which is still doing work), add following options in build*.sh:
188+
174189
```shell
175190
cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
176191
-DCMAKE_CXX_COMPILER=icpx \
@@ -180,46 +195,59 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
180195
-DCMAKE_CUDA_COMPILER=${path to cuda toolkit}/bin/nvcc \
181196
......
182197
```
183-
Notice: You CANNOT use `icpx` compiler for GPU version of ABACUS for now
184198

185-
### shell problem
199+
Notice: You CANNOT use `icpx` compiler for GPU version of ABACUS for now, see discussion here [#2906](https://github.com/deepmodeling/abacus-develop/issues/2906) and [#4976](https://github.com/deepmodeling/abacus-develop/issues/4976)
200+
201+
202+
### Shell problem
203+
186204
If you encounter problem like:
205+
187206
```shell
188207
/bin/bash^M: bad interpreter: No such file or directory
189208
```
209+
190210
or `permission denied` problem, you can simply run:
211+
191212
```shell
192213
./pre_set.sh
193214
```
215+
194216
And also, you can fix `permission denied` problem via `chmod +x`
195217
if *pre_set.sh* have no execution permission;
196218
if the *pre_set.sh* also have `/bin/bash^M` problem, you can run:
197-
```
219+
220+
```shell
198221
> dos2unix pre_set.sh
199222
```
223+
200224
to fix it
201225

202-
### libtorch and deepks problem
226+
### Libtorch and DeePKS problem
227+
203228
If deepks feature have problem, you can manually change libtorch version
204-
from 2.0.1 to 1.12.0 in `toolchain/scripts/stage4/install_libtorch.sh`.
229+
from 2.1.2 to 2.0.1 or 1.12.0 in `toolchain/scripts/stage4/install_libtorch.sh`.
230+
205231
Also, you can install ABACUS without deepks by removing all the deepks and related options.
206232

207233
NOTICE: if you want deepks feature, your intel-mkl environment should be accessible in building process. you can check it in `build_abacus_gnu.sh`
208234

209-
### deepmd feature problem
235+
### DeePMD feature problem
236+
210237
When you encounter problem like `GLIBCXX_3.4.29 not found`, it is sure that your `gcc` version is lower than the requirement of `libdeepmd`.
211238

212239
After my test, you need `gcc`>11.3.1 to enable deepmd feature in ABACUS.
213240

214241
### ELPA problem via Intel-oneAPI toolchain in AMD server
242+
215243
The default compiler for Intel-oneAPI is `icpx` and `icx`, which will cause problem when compling ELPA in AMD server. (Which is a problem and needed to have more check-out)
216244

217245
The best way is to change `icpx` to `icpc`, `icx` to `icc`. user can manually change it in toolchain*.sh via `--with-intel-classic=yes`
218246

219-
Notice: `icc` and `icpc` from Intel Classic Compiler of Intel-oneAPI is not supported for 2024.0 and newer version.
220-
247+
Notice: `icc` and `icpc` from Intel Classic Compiler of Intel-oneAPI is not supported for 2024.0 and newer version. And Intel-OneAPI 2023.2.0 can be found in website. See discussion here [#4976](https://github.com/deepmodeling/abacus-develop/issues/4976)
221248

222249
### Intel-oneAPI problem
250+
223251
Sometimes Intel-oneAPI have problem to link `mpirun`,
224252
which will always show in 2023.2.0 version of MPI in Intel-oneAPI.
225253
Try `source /path/to/setvars.sh` or install another version of IntelMPI may help.
@@ -229,7 +257,6 @@ And will not occur in Intel-MPI before 2021.10.0 (Intel-oneAPI before 2023.2.0)
229257

230258
More problem and possible solution can be accessed via [#2928](https://github.com/deepmodeling/abacus-develop/issues/2928)
231259

232-
233260
## Advanced Installation Usage
234261

235262
1. Users can move toolchain directory to anywhere you like,
@@ -243,4 +270,5 @@ of each packages, which may let the installation more fiexible.
243270

244271

245272
## More
273+
246274
More infomation can be read from `Details.md`.

toolchain/build_abacus_gnu.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
4747
-DENABLE_LIBXC=ON \
4848
-DUSE_OPENMP=ON \
4949
-DUSE_ELPA=ON \
50-
-DENABLE_RAPIDJSON=ON \
50+
-DENABLE_RAPIDJSON=OFF \
5151
# -DENABLE_DEEPKS=1 \
5252
# -DTorch_DIR=$LIBTORCH \
5353
# -Dlibnpy_INCLUDE_DIR=$LIBNPY \
@@ -74,3 +74,12 @@ cat << EOF > "${TOOL}/abacus_env.sh"
7474
source $INSTALL_DIR/setup
7575
export PATH="${PREFIX}/bin":\${PATH}
7676
EOF
77+
78+
# generate information
79+
cat << EOF
80+
========================== usage =========================
81+
Done!
82+
To use the installed ABACUS version
83+
You need to source $(pwd)/abacus_env.sh first !
84+
"""
85+
EOF

toolchain/build_abacus_intel-mpich.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
4343
-DENABLE_LIBXC=ON \
4444
-DUSE_OPENMP=ON \
4545
-DUSE_ELPA=ON \
46-
-DENABLE_RAPIDJSON=ON \
46+
-DENABLE_RAPIDJSON=OFF \
4747
# -DENABLE_DEEPKS=1 \
4848
# -DTorch_DIR=$LIBTORCH \
4949
# -Dlibnpy_INCLUDE_DIR=$LIBNPY \
@@ -64,4 +64,13 @@ cat << EOF > "${TOOL}/abacus_env.sh"
6464
#!/bin/bash
6565
source $INSTALL_DIR/setup
6666
export PATH="${PREFIX}/bin":\${PATH}
67+
EOF
68+
69+
# generate information
70+
cat << EOF
71+
========================== usage =========================
72+
Done!
73+
To use the installed ABACUS version
74+
You need to source $(pwd)/abacus_env.sh first !
75+
"""
6776
EOF

toolchain/build_abacus_intel.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
4444
-DENABLE_LIBXC=ON \
4545
-DUSE_OPENMP=ON \
4646
-DUSE_ELPA=ON \
47-
-DENABLE_RAPIDJSON=ON \
47+
-DENABLE_RAPIDJSON=OFF \
4848
# -DENABLE_DEEPKS=1 \
4949
# -DTorch_DIR=$LIBTORCH \
5050
# -Dlibnpy_INCLUDE_DIR=$LIBNPY \
@@ -66,3 +66,12 @@ cat << EOF > "${TOOL}/abacus_env.sh"
6666
source $INSTALL_DIR/setup
6767
export PATH="${PREFIX}/bin":\${PATH}
6868
EOF
69+
70+
# generate information
71+
cat << EOF
72+
========================== usage =========================
73+
Done!
74+
To use the installed ABACUS version
75+
You need to source $(pwd)/abacus_env.sh first !
76+
"""
77+
EOF

toolchain/scripts/stage1/install_mpich.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
# TODO: Review and if possible fix shellcheck errors.
44
# shellcheck disable=all
55

6-
# Last Update in 2023-0918
6+
# Last Update in 2024-0912
77

88
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
99
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
1010

1111
# mpich_ver="4.0.3"
1212
# mpich_sha256="17406ea90a6ed4ecd5be39c9ddcbfac9343e6ab4f77ac4e8c5ebe4a3e3b6c501"
13-
mpich_ver="4.1.2"
14-
mpich_sha256="3492e98adab62b597ef0d292fb2459b6123bc80070a8aa0a30be6962075a12f0"
13+
# mpich_ver="4.1.2"
14+
# mpich_sha256="3492e98adab62b597ef0d292fb2459b6123bc80070a8aa0a30be6962075a12f0"
15+
mpich_ver="4.2.2"
16+
mpich_sha256="883f5bb3aeabf627cb8492ca02a03b191d09836bbe0f599d8508351179781d41"
1517
mpich_pkg="mpich-${mpich_ver}.tar.gz"
1618

1719
source "${SCRIPT_DIR}"/common_vars.sh
@@ -35,13 +37,15 @@ case "${with_mpich}" in
3537
pkg_install_dir="${INSTALLDIR}/mpich-${mpich_ver}"
3638
#pkg_install_dir="${HOME}/apps/mpich/${mpich_ver}-intel"
3739
install_lock_file="$pkg_install_dir/install_successful"
40+
url="https://www.mpich.org/static/downloads/${mpich_ver}/${mpich_pkg}"
3841
if verify_checksums "${install_lock_file}"; then
3942
echo "mpich-${mpich_ver} is already installed, skipping it."
4043
else
4144
if [ -f ${mpich_pkg} ]; then
4245
echo "${mpich_pkg} is found"
4346
else
44-
download_pkg_from_ABACUS_org "${mpich_sha256}" "${mpich_pkg}"
47+
#download_pkg_from_ABACUS_org "${mpich_sha256}" "${mpich_pkg}"
48+
download_pkg_from_url "${mpich_sha256}" "${mpich_pkg}" "${url}"
4549
fi
4650
echo "Installing from scratch into ${pkg_install_dir} for MPICH device ${MPICH_DEVICE}"
4751
[ -d mpich-${mpich_ver} ] && rm -rf mpich-${mpich_ver}

toolchain/scripts/stage1/install_openmpi.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
# TODO: Review and if possible fix shellcheck errors.
44
# shellcheck disable=all
55

6-
# Last Update in 2024-0811
6+
# Last Update in 2024-0912
77

88
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
99
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
1010

11-
openmpi_ver="5.0.3"
12-
openmpi_sha256="990582f206b3ab32e938aa31bbf07c639368e4405dca196fabe7f0f76eeda90b"
11+
openmpi_ver="5.0.5"
12+
openmpi_sha256="6588d57c0a4bd299a24103f4e196051b29e8b55fbda49e11d5b3d32030a32776"
13+
# openmpi_ver="4.1.6"
14+
# openmpi_sha256="f740994485516deb63b5311af122c265179f5328a0d857a567b85db00b11e415"
1315
openmpi_pkg="openmpi-${openmpi_ver}.tar.bz2"
1416

1517
source "${SCRIPT_DIR}"/common_vars.sh
@@ -33,13 +35,14 @@ case "${with_openmpi}" in
3335
pkg_install_dir="${INSTALLDIR}/openmpi-${openmpi_ver}"
3436
#pkg_install_dir="${HOME}/apps/openmpi/${openmpi_ver}-gcc8"
3537
install_lock_file="$pkg_install_dir/install_successful"
38+
url="https://download.open-mpi.org/release/open-mpi/v${openmpi_ver:0:3}/${openmpi_pkg}"
3639
if verify_checksums "${install_lock_file}"; then
3740
echo "openmpi-${openmpi_ver} is already installed, skipping it."
3841
else
3942
if [ -f ${openmpi_pkg} ]; then
4043
echo "${openmpi_pkg} is found"
4144
else
42-
download_pkg_from_ABACUS_org "${openmpi_sha256}" "${openmpi_pkg}"
45+
download_pkg_from_url "${openmpi_sha256}" "${openmpi_pkg}" "${url}"
4346
fi
4447
echo "Installing from scratch into ${pkg_install_dir}"
4548
[ -d openmpi-${openmpi_ver} ] && rm -rf openmpi-${openmpi_ver}
@@ -59,6 +62,8 @@ case "${with_openmpi}" in
5962
fi
6063
fi
6164
# OpenMPI 5.0 only supports PMIx
65+
# PMI support is required for Slurm, but not for other schedulers
66+
# default not use
6267
# if [ $(command -v srun) ]; then
6368
# echo "Slurm installation found. OpenMPI will be configured with --with-pmi."
6469
# EXTRA_CONFIGURE_FLAGS="--with-pmi"

0 commit comments

Comments
 (0)