Skip to content

Commit

Permalink
Toolchain 202402 (#4945)
Browse files Browse the repository at this point in the history
* basic toolchain update

- remove ACML support
- update dependence version
- try to update scalapack for gcc-14
- tag libri 0.2.0
- enable rapidjson in build scripts (but not as default)

* Update README.md

* Version 2024.2 tag

* Update install_elpa.sh

* enable rapidjson as default in toolchain usage

* fix #4601 for scalapack

* modify export

* reverse gcc default version to 13.2.0

* remove redundant option

* update libtorch version and downloading

* Update README.md

* formatting

* update database version

* update v3 database link
  • Loading branch information
QuantumMisaka authored Aug 12, 2024
1 parent e614606 commit eaf27f8
Show file tree
Hide file tree
Showing 25 changed files with 116 additions and 173 deletions.
18 changes: 9 additions & 9 deletions toolchain/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The ABACUS Toolchain
Version 2024.1
Version 2024.2

## Author
[QuantumMisaka](https://github.com/QuantumMisaka)
Expand All @@ -19,7 +19,7 @@ and give setup files that you can use to compile ABACUS.
## Todo

- [x] `gnu-openblas` toolchain support for `openmpi` and `mpich`.
- [x] `intel-mkl-mpi` toolchain support using `icc` or `icx`. (`icx` version of ABACUS have some problem now, please be cautious)
- [x] `intel-mkl-mpi` toolchain support using `icc`/`icpc`/`ifort` or `icx`/`icpx`/`ifort`. (`icx` as default, but will have problem for ELPA in AMD machine, one can specify `--with-intel-classic=yes` to use `icc`),
- [x] `intel-mkl-mpich` toolchain support.
- [x] Automatic installation of [CEREAL](https://github.com/USCiLab/cereal) and [LIBNPY](https://github.com/llohse/libnpy) (by github.com)
- [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)
Expand Down Expand Up @@ -75,14 +75,14 @@ Notice: These packages will be downloaded by `wget` from `github.com`, which is

Instead of github.com, we offer other package station, you can use it by:
```shell
wget https://bohrium-api.dp.tech/ds-dl/abacus-deps-93wi-v2 -O abacus-deps-v2.zip
wget https://bohrium-api.dp.tech/ds-dl/abacus-deps-93wi-v3 -O abacus-deps-v3.zip
```
`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.

If one want to install ABACUS by toolchain OFFLINE,
one can manually download all the packages from [cp2k-static/download](https://www.cp2k.org/static/downloads) or official website
and put them in *build* directory by formatted name
like *fftw-3.3.10.tar.gz*, or *openmpi-4.1.5.tar.gz*,
like *fftw-3.3.10.tar.gz*, or *openmpi-5.0.3.tar.gz*,
then run this toolchain.
All package will be detected and installed automatically.
Also, one can install parts of packages OFFLINE and parts of packages ONLINE
Expand All @@ -96,22 +96,22 @@ just by using this toolchain
```

The needed dependencies version default:
- `cmake` 3.28.1
- `cmake` 3.30.0
- `gcc` 13.2.0 (which will always NOT be installed, But use system)
- `OpenMPI` 5.0.0
- `OpenMPI` 5.0.3
- `MPICH` 4.1.2
- `OpenBLAS` 0.3.25 (Intel toolchain need `get_vars.sh` tool from it)
- `OpenBLAS` 0.3.27 (Intel toolchain need `get_vars.sh` tool from it)
- `ScaLAPACK` 2.2.1
- `FFTW` 3.3.10
- `LibXC` 6.2.2
- `ELPA` 2023.05.001
- `ELPA` 2024.03.001
- `CEREAL` 1.3.2
- `RapidJSON` 1.1.0
And Intel-oneAPI need user or server manager to manually install from Intel.
[Intel-oneAPI](https://www.intel.cn/content/www/cn/zh/developer/tools/oneapi/toolkits.html)

Dependencies below are optional, which is NOT installed by default:
- `LibTorch` 2.0.1
- `LibTorch` 2.1.2
- `Libnpy` 1.0.1
- `LibRI` 0.1.1
- `LibComm` 0.1.0
Expand Down
9 changes: 5 additions & 4 deletions toolchain/build_abacus_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ BUILD_DIR=build_abacus_gnu
rm -rf $BUILD_DIR

PREFIX=$ABACUS_DIR
LAPACK=$INSTALL_DIR/openblas-0.3.25/lib
LAPACK=$INSTALL_DIR/openblas-0.3.27/lib
SCALAPACK=$INSTALL_DIR/scalapack-2.2.1/lib
ELPA=$INSTALL_DIR/elpa-2023.05.001/cpu
ELPA=$INSTALL_DIR/elpa-2024.03.001/cpu
FFTW3=$INSTALL_DIR/fftw-3.3.10
CEREAL=$INSTALL_DIR/cereal-1.3.2/include/cereal
LIBXC=$INSTALL_DIR/libxc-6.2.2
# LIBRI=$INSTALL_DIR/LibRI-0.1.1
# LIBCOMM=$INSTALL_DIR/LibComm-0.1.0
# LIBTORCH=$INSTALL_DIR/libtorch-2.0.1/share/cmake/Torch
# LIBTORCH=$INSTALL_DIR/libtorch-2.1.2/share/cmake/Torch
# LIBNPY=$INSTALL_DIR/libnpy-1.0.1/include
# DEEPMD=$HOME/apps/anaconda3/envs/deepmd

Expand All @@ -47,6 +47,7 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DENABLE_LIBXC=ON \
-DUSE_OPENMP=ON \
-DUSE_ELPA=ON \
-DENABLE_RAPIDJSON=ON \
# -DENABLE_DEEPKS=1 \
# -DTorch_DIR=$LIBTORCH \
# -Dlibnpy_INCLUDE_DIR=$LIBNPY \
Expand All @@ -55,7 +56,7 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
# -DLIBCOMM_DIR=$LIBCOMM \
# -DDeePMD_DIR=$DEEPMD \
# -DTensorFlow_DIR=$DEEPMD \
# -DENABLE_RAPIDJSON=ON \


# # add mkl env for libtorch to link
# if one want to install libtorch, mkl should be load in build process
Expand Down
23 changes: 12 additions & 11 deletions toolchain/build_abacus_intel-mpich.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ BUILD_DIR=build_abacus_intel-mpich
rm -rf $BUILD_DIR

PREFIX=$ABACUS_DIR
ELPA=$INSTALL_DIR/elpa-2023.05.001/cpu
ELPA=$INSTALL_DIR/elpa-2024.03.001/cpu
CEREAL=$INSTALL_DIR/cereal-1.3.2/include/cereal
LIBXC=$INSTALL_DIR/libxc-6.2.2
# LIBTORCH=$INSTALL_DIR/libtorch-2.0.1/share/cmake/Torch
# LIBTORCH=$INSTALL_DIR/libtorch-2.1.2/share/cmake/Torch
# LIBNPY=$INSTALL_DIR/libnpy-1.0.1/include
# LIBRI=$INSTALL_DIR/LibRI-0.1.1
# LIBCOMM=$INSTALL_DIR/LibComm-0.1.0
Expand All @@ -43,15 +43,16 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DENABLE_LIBXC=ON \
-DUSE_OPENMP=ON \
-DUSE_ELPA=ON \
# -DENABLE_DEEPKS=1 \
# -DTorch_DIR=$LIBTORCH \
# -Dlibnpy_INCLUDE_DIR=$LIBNPY \
# -DENABLE_LIBRI=ON \
# -DLIBRI_DIR=$LIBRI \
# -DLIBCOMM_DIR=$LIBCOMM \
# -DDeePMD_DIR=$DEEPMD \
# -DTensorFlow_DIR=$DEEPMD \
# -DENABLE_RAPIDJSON=ON \
-DENABLE_RAPIDJSON=ON \
# -DENABLE_DEEPKS=1 \
# -DTorch_DIR=$LIBTORCH \
# -Dlibnpy_INCLUDE_DIR=$LIBNPY \
# -DENABLE_LIBRI=ON \
# -DLIBRI_DIR=$LIBRI \
# -DLIBCOMM_DIR=$LIBCOMM \
# -DDeePMD_DIR=$DEEPMD \
# -DTensorFlow_DIR=$DEEPMD \


# if one want's to include deepmd, your gcc version should be >= 11.3.0

Expand Down
7 changes: 4 additions & 3 deletions toolchain/build_abacus_intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ BUILD_DIR=build_abacus_intel
rm -rf $BUILD_DIR

PREFIX=$ABACUS_DIR
ELPA=$INSTALL_DIR/elpa-2023.05.001/cpu
ELPA=$INSTALL_DIR/elpa-2024.03.001/cpu
CEREAL=$INSTALL_DIR/cereal-1.3.2/include/cereal
LIBXC=$INSTALL_DIR/libxc-6.2.2
# LIBTORCH=$INSTALL_DIR/libtorch-2.0.1/share/cmake/Torch
# LIBTORCH=$INSTALL_DIR/libtorch-2.1.2/share/cmake/Torch
# LIBNPY=$INSTALL_DIR/libnpy-1.0.1/include
# LIBRI=$INSTALL_DIR/LibRI-0.1.1
# LIBCOMM=$INSTALL_DIR/LibComm-0.1.0
Expand All @@ -44,6 +44,7 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DENABLE_LIBXC=ON \
-DUSE_OPENMP=ON \
-DUSE_ELPA=ON \
-DENABLE_RAPIDJSON=ON \
# -DENABLE_DEEPKS=1 \
# -DTorch_DIR=$LIBTORCH \
# -Dlibnpy_INCLUDE_DIR=$LIBNPY \
Expand All @@ -52,7 +53,7 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
# -DLIBCOMM_DIR=$LIBCOMM \
# -DDeePMD_DIR=$DEEPMD \
# -DTensorFlow_DIR=$DEEPMD \
# -DENABLE_RAPIDJSON=ON \


cmake --build $BUILD_DIR -j `nproc`
cmake --install $BUILD_DIR 2>/dev/null
Expand Down
2 changes: 0 additions & 2 deletions toolchain/install_abacus_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ The --with-PKG options follow the rules:
Default = install
--with-fftw FFTW3, library for fast fourier transform
Default = install
--with-acml AMD core maths library, which provides LAPACK and BLAS
Default = system
--with-mkl Intel Math Kernel Library, which provides LAPACK, and BLAS.
If MKL's FFTW3 interface is suitable (no FFTW-MPI support),
it replaces the FFTW library. If the ScaLAPACK component is
Expand Down
2 changes: 1 addition & 1 deletion toolchain/scripts/VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# version file to force a rebuild of the entire toolchain
VERSION="2024.1"
VERSION="2024.2"
6 changes: 3 additions & 3 deletions toolchain/scripts/get_openblas_arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=all

# Last Update in 2024-0219
# Last Update in 2024-0811

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

openblas_ver="0.3.25" # Keep in sync with install_openblas.sh
openblas_sha256="4c25cb30c4bb23eddca05d7d0a85997b8db6144f5464ba7f8c09ce91e2f35543"
openblas_ver="0.3.27" # Keep in sync with install_openblas.sh
openblas_sha256="aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897"
openblas_pkg="OpenBLAS-${openblas_ver}.tar.gz"

source "${SCRIPT_DIR}"/common_vars.sh
Expand Down
10 changes: 5 additions & 5 deletions toolchain/scripts/stage0/install_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=all

# Last Update in 2024-0219
# Last Update in 2024-0811

[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
Expand All @@ -21,13 +21,13 @@ cd "${BUILDDIR}"
case "${with_cmake}" in
__INSTALL__)
echo "==================== Installing CMake ===================="
cmake_ver="3.28.1"
cmake_ver="3.30.0"
if [ "${OPENBLAS_ARCH}" = "arm64" ]; then
cmake_arch="linux-aarch64"
cmake_sha256="4ecba78ef9499a973d012a83feab5f888e86fc5388e9a768037ab4f7232cab16"
cmake_sha256="daa89552fd9102fb70399b31b5605c4f61125023bbbed947757a7b53ce36c4d0"
elif [ "${OPENBLAS_ARCH}" = "x86_64" ]; then
cmake_arch="linux-x86_64"
cmake_sha256="ada6a46be9da5f8cbeb00b9523ffe45ee6b36172eb81aaa5bdc6a2a8231b677c"
cmake_sha256="1a5969fe81fea6e5220d053d9d3e3754cbc85be07d2d428bebdcfe87137971a9"
else
report_error ${LINENO} \
"cmake installation for ARCH=${ARCH} is not supported. You can try to use the system installation using the flag --with-cmake=system instead."
Expand Down Expand Up @@ -67,7 +67,7 @@ if [ "${with_cmake}" != "__DONTUSE__" ]; then
if [ "${with_cmake}" != "__SYSTEM__" ]; then
cat << EOF > "${BUILDDIR}/setup_cmake"
prepend_path PATH "${pkg_install_dir}/bin"
export PATH="${pkg_install_dir}/bin:":\${PATH}
export PATH="${pkg_install_dir}/bin":\${PATH}
EOF
cat "${BUILDDIR}/setup_cmake" >> $SETUPFILE
fi
Expand Down
9 changes: 6 additions & 3 deletions toolchain/scripts/stage0/install_gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=all

# Last Update in 2023-1111
# Last Update in 2024-0811

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

# gcc 13 is good
gcc_ver="13.2.0"
gcc_sha256="8cb4be3796651976f94b9356fa08d833524f62420d6292c5033a9a26af315078"
# use gcc 14 with caution
#gcc_ver="14.1.0"
#gcc_sha256="a0be066c02775002a0fa65ad3c65fb56a8bfd923d072a26ed148c0439ecdb68f"

source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
Expand Down Expand Up @@ -61,7 +64,7 @@ case "${with_gcc}" in
# TODO: Unfortunately, we can not simply use --disable-shared, because
# it would break OpenBLAS build and probably others too.
COMMON_FLAGS="-O2 -fPIC -fno-omit-frame-pointer -fopenmp -g"
CFLAGS="${COMMON_FLAGS} -std=gnu99"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${CFLAGS}"
FCFLAGS="${COMMON_FLAGS} -fbacktrace"
${GCCROOT}/configure --prefix="${pkg_install_dir}" \
Expand Down
4 changes: 2 additions & 2 deletions toolchain/scripts/stage0/install_intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=all

# Last Update in 2023-0901
# Last Update in 2024-0811

[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=${0}
SCRIPT_DIR="$(cd "$(dirname "${SCRIPT_NAME}")/.." && pwd -P)"
Expand Down Expand Up @@ -56,10 +56,10 @@ case "${with_intel}" in
check_command ${pkg_install_dir}/bin/icpc "intel" && CXX="${pkg_install_dir}/bin/icpc" || exit 1
check_command ${pkg_install_dir}/bin/ifort "intel" && FC="${pkg_install_dir}/bin/ifort" || exit 1
else
# abacus do not need icx, the key is mkl
check_command ${pkg_install_dir}/bin/icx "intel" && CC="${pkg_install_dir}/bin/icx" || exit 1
check_command ${pkg_install_dir}/bin/icpx "intel" && CXX="${pkg_install_dir}/bin/icpx" || exit 1
check_command ${pkg_install_dir}/bin/ifort "intel" && FC="${pkg_install_dir}/bin/ifort" || exit 1
# is ifx needed ?
fi
F90="${FC}"
F77="${FC}"
Expand Down
6 changes: 3 additions & 3 deletions toolchain/scripts/stage1/install_openmpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=all

# Last Update in 2024-0219
# Last Update in 2024-0811

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

openmpi_ver="5.0.0"
openmpi_sha256="9d845ca94bc1aeb445f83d98d238cd08f6ec7ad0f73b0f79ec1668dbfdacd613"
openmpi_ver="5.0.3"
openmpi_sha256="990582f206b3ab32e938aa31bbf07c639368e4405dca196fabe7f0f76eeda90b"
openmpi_pkg="openmpi-${openmpi_ver}.tar.bz2"

source "${SCRIPT_DIR}"/common_vars.sh
Expand Down
76 changes: 0 additions & 76 deletions toolchain/scripts/stage2/install_acml.sh

This file was deleted.

6 changes: 1 addition & 5 deletions toolchain/scripts/stage2/install_mathlibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=all

# Last Update in 2023-0901
# Last Update in 2024-0810

[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
Expand All @@ -25,10 +25,6 @@ case "$MATH_MODE" in
"${SCRIPTDIR}"/stage2/install_mkl.sh "${with_mkl}"
load "${BUILDDIR}/setup_mkl"
;;
acml)
"${SCRIPTDIR}"/stage2/install_acml.sh "${with_acml}"
load "${BUILDDIR}/setup_acml"
;;
openblas)
"${SCRIPTDIR}"/stage2/install_openblas.sh "${with_openblas}"
load "${BUILDDIR}/setup_openblas"
Expand Down
Loading

0 comments on commit eaf27f8

Please sign in to comment.