mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-21 14:35:15 -04:00
Toolchain SIRIUS (#5098)
This commit is contained in:
parent
f577188f47
commit
3a22a26910
18 changed files with 163 additions and 180 deletions
|
|
@ -174,19 +174,16 @@ cmake_dependent_option(CP2K_USE_LIBVDWXC "Enable libvdwxc support with SIRIUS"
|
|||
${CP2K_USE_EVERYTHING} "CP2K_USE_SIRIUS" OFF)
|
||||
|
||||
# do not turn it on if sirius is built with the toolchain
|
||||
cmake_dependent_option(
|
||||
CP2K_USE_SIRIUS_DFTD4 "Enable dftd3 and dftd4 sirius support" OFF
|
||||
"CP2K_USE_SIRIUS" OFF)
|
||||
cmake_dependent_option(CP2K_USE_SIRIUS_DFTD3 "Enable dftd3 sirius support" OFF
|
||||
"CP2K_USE_SIRIUS" OFF)
|
||||
cmake_dependent_option(CP2K_USE_SIRIUS_DFTD4 "Enable dftd4 sirius support" OFF
|
||||
"CP2K_USE_SIRIUS" OFF)
|
||||
cmake_dependent_option(
|
||||
CP2K_USE_SIRIUS_VCSQNM "Enable variable cell shape relaxation in SIRIUS" OFF
|
||||
"CP2K_USE_SIRIUS" OFF)
|
||||
|
||||
cmake_dependent_option(CP2K_USE_SIRIUS_NLCG "Enable nlcg method in SIRIUS" OFF
|
||||
"CP2K_USE_SIRIUS" OFF)
|
||||
|
||||
cmake_dependent_option(CP2K_USE_SpFFT "Enable spare FFT in SIRIUS" OFF
|
||||
"CP2K_USE_SIRIUS" OFF)
|
||||
|
||||
cmake_dependent_option(
|
||||
CP2K_DBCSR_USE_CPU_ONLY "Disable the DBCSR accelerated backend" OFF
|
||||
"NOT CP2K_USE_ACCEL MATCHES \"OPENCL|HIP|CUDA\"" OFF)
|
||||
|
|
|
|||
|
|
@ -90,15 +90,12 @@ elif [[ "${PROFILE}" == "toolchain" ]] && [[ "${VERSION}" == "sdbg" ]]; then
|
|||
CMAKE_EXIT_CODE=$?
|
||||
|
||||
elif [[ "${PROFILE}" == "toolchain" ]] && [[ "${VERSION}" == "psmp" ]]; then
|
||||
# TODO Re-enable SIRIUS once performance regression of COSMA is fixed:
|
||||
# https://github.com/cp2k/cp2k/issues/4663
|
||||
cmake \
|
||||
-GNinja \
|
||||
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \
|
||||
-DCP2K_USE_EVERYTHING=ON \
|
||||
-DCP2K_USE_DLAF=OFF \
|
||||
-DCP2K_USE_PEXSI=OFF \
|
||||
-DCP2K_USE_SIRIUS=OFF \
|
||||
-Werror=dev \
|
||||
.. |& tee ./cmake.log
|
||||
CMAKE_EXIT_CODE=$?
|
||||
|
|
|
|||
|
|
@ -128,12 +128,13 @@ A library for finding and handling crystal symmetries
|
|||
|
||||
## SIRIUS (plane wave calculations)
|
||||
|
||||
SIRIUS is a domain specific library for electronic structure calculations.
|
||||
SIRIUS is a domain specific library for electronic structure calculations with plane wave method.
|
||||
|
||||
- The code is available at <https://github.com/electronic-structure/SIRIUS>
|
||||
- For building CP2K with SIRIUS pass `-DCP2K_USE_SIRIUS=ON` to CMake.
|
||||
- Pass `-DCP2K_USE_LIBVDWXC=ON` if support is activated in SIRIUS.
|
||||
- Pass `-DCP2K_USE_SIRIUS_DFTD4=ON` when sirius is compiled with dftd3 and dftd4 support.
|
||||
- Pass `-DCP2K_USE_SIRIUS_DFTD3=ON` when sirius is compiled with dftd3 support.
|
||||
- Pass `-DCP2K_USE_SIRIUS_DFTD4=ON` when sirius is compiled with dftd4 support.
|
||||
- Pass `-DCP2K_USE_SIRIUS_NLCG=ON` when sirius is compiled with nlcg support.
|
||||
- Pass `-DCP2K_USE_SIRIUS_VCSQNM=ON` when sirius is compiled with variable cell relaxation support.
|
||||
- See <https://electronic-structure.github.io/SIRIUS-doc/> for more information.
|
||||
|
|
@ -156,13 +157,6 @@ SIRIUS is a domain specific library for electronic structure calculations.
|
|||
<https://brehm-research.de/bqb> for more information as well as the `bqbtool` to inspect BQB
|
||||
files.
|
||||
|
||||
## SpFFT (Sparse 3D FFT)
|
||||
|
||||
- SpFFT is a 3D FFT library for sparse frequency domain data written in C++ with support for MPI,
|
||||
OpenMP, CUDA and ROCm.
|
||||
- Pass `-DCP2K_USE_SpFFT=ON` to CMake to enable support for SpFFT.
|
||||
- See <https://github.com/eth-cscs/SpFFT> for more information.
|
||||
|
||||
## Torch (Machine Learning Framework needed for NequIP)
|
||||
|
||||
- The C++ API of PyTorch can be downloaded from https://pytorch.org/get-started/locally/.
|
||||
|
|
|
|||
|
|
@ -1797,7 +1797,6 @@ target_compile_definitions(
|
|||
$<$<BOOL:${CP2K_USE_SIRIUS}>:__SIRIUS>
|
||||
$<$<BOOL:${CP2K_USE_LIBVDWXC}>:__LIBVDWXC>
|
||||
$<$<BOOL:${CP2K_USE_SPLA}>:__SPLA>
|
||||
$<$<BOOL:${CP2K_USE_SpFFT}>:__SPFFT>
|
||||
$<$<BOOL:${CP2K_USE_SPLA_GEMM_OFFLOADING}>:__OFFLOAD_GEMM>
|
||||
$<$<BOOL:${CP2K_USE_ELPA}>:__ELPA>
|
||||
$<$<BOOL:${CP2K_USE_DLAF}>:__DLAF>
|
||||
|
|
@ -1811,8 +1810,9 @@ target_compile_definitions(
|
|||
$<$<BOOL:${CP2K_USE_LIBTORCH}>:__LIBTORCH>
|
||||
$<$<BOOL:${CP2K_USE_COSMA}>:__COSMA>
|
||||
$<$<BOOL:${CP2K_USE_LIBXSMM}>:__LIBXSMM>
|
||||
$<$<BOOL:${CCP2K_USE_SIRIUS_DFTD4}>:__SIRIUS_DFTD4>
|
||||
$<$<BOOL:${CCP2K_USE_SIRIUS_NLCG}>:__SIRIUS_NLCG>
|
||||
$<$<BOOL:${CP2K_USE_SIRIUS_DFTD3}>:__SIRIUS_DFTD3>
|
||||
$<$<BOOL:${CP2K_USE_SIRIUS_DFTD4}>:__SIRIUS_DFTD4>
|
||||
$<$<BOOL:${CP2K_USE_SIRIUS_NLCG}>:__SIRIUS_NLCG>
|
||||
$<$<BOOL:${CP2K_USE_SIRIUS_VCSQNM}>:__SIRIUS_VCSQNM>
|
||||
$<$<BOOL:${CP2K_USE_MIMIC}>:__MIMIC>
|
||||
$<$<STREQUAL:"${CP2K_BLAS_VENDOR}","MKL">:__MKL>
|
||||
|
|
|
|||
|
|
@ -206,6 +206,9 @@ CONTAINS
|
|||
#if defined(__SIRIUS_NLCG)
|
||||
flags = TRIM(flags)//" sirius_nlcg"
|
||||
#endif
|
||||
#if defined(__SIRIUS_DFTD3)
|
||||
flags = TRIM(flags)//" sirius_dftd3"
|
||||
#endif
|
||||
#if defined(__SIRIUS_DFTD4)
|
||||
flags = TRIM(flags)//" sirius_dftd4"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -135,12 +135,14 @@ CONTAINS
|
|||
CALL section_release(subsection)
|
||||
#endif
|
||||
|
||||
#if defined(__SIRIUS_DFTD4)
|
||||
CALL create_sirius_section(subsection, "dftd4")
|
||||
#if defined(__SIRIUS_DFTD3)
|
||||
CALL create_sirius_section(subsection, "dftd3")
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
#endif
|
||||
|
||||
CALL create_sirius_section(subsection, "dftd3")
|
||||
#if defined(__SIRIUS_DFTD4)
|
||||
CALL create_sirius_section(subsection, "dftd4")
|
||||
CALL section_add_subsection(section, subsection)
|
||||
CALL section_release(subsection)
|
||||
#endif
|
||||
|
|
@ -244,9 +246,14 @@ CONTAINS
|
|||
! it is a minor inconvenience from the api.
|
||||
name = TRIM(ADJUSTL(name))
|
||||
|
||||
#if defined(__SIRIUS_DFTD3)
|
||||
IF ((section_name == 'dftd3') .AND. (name == 'parameters')) THEN
|
||||
CYCLE
|
||||
END IF
|
||||
#endif
|
||||
#if defined(__SIRIUS_DFTD4)
|
||||
! need to implement the object case within a section
|
||||
IF (((section_name == 'dftd3') .OR. (section_name == 'dftd4')) .AND. (name == 'parameters')) THEN
|
||||
IF ((section_name == 'dftd4') .AND. (name == 'parameters')) THEN
|
||||
CYCLE
|
||||
END IF
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -264,22 +264,21 @@ CONTAINS
|
|||
CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "iterative_solver")
|
||||
END IF
|
||||
|
||||
#if defined(__SIRIUS_DFTD4)
|
||||
! import dftd3 and dftd4 section
|
||||
pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "dftd4")
|
||||
IF (ASSOCIATED(pwdft_sub_section)) THEN
|
||||
CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "dftd4")
|
||||
END IF
|
||||
|
||||
#if defined(__SIRIUS_DFTD3)
|
||||
! import dftd3 section
|
||||
pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "dftd3")
|
||||
IF (ASSOCIATED(pwdft_sub_section)) THEN
|
||||
CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "dftd3")
|
||||
END IF
|
||||
#endif
|
||||
#if defined(__SIRIUS_DFTD4)
|
||||
! import dftd4 section
|
||||
pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "dftd4")
|
||||
IF (ASSOCIATED(pwdft_sub_section)) THEN
|
||||
CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "dftd4")
|
||||
END IF
|
||||
#endif
|
||||
|
||||
!
|
||||
! uncomment these lines when nlcg is officially supported
|
||||
!
|
||||
#if defined(__SIRIUS_NLCG)
|
||||
! import nlcg section
|
||||
pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "nlcg")
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@
|
|||
# testing global tree creation using single exact potential, the deterministic random number generator
|
||||
# with the standard move types, check i
|
||||
# fully test non colinear magnetism with spin orbit coupling
|
||||
"Au.inp" = [{matcher="M085", tol=1.0E-5, ref=-147.225566702788200}]
|
||||
"Fe.inp" = [{matcher="M085", tol=1.0E-5, ref=-253.637351928254105}]
|
||||
"Fe_dos.inp" = [{matcher="M085", tol=1.0E-5, ref=-253.637351928254105}]
|
||||
"He-full-potential.inp" = [{matcher="M085", tol=2.0E-5, ref=-2.835107805775919}]
|
||||
"SrVO.inp" = [{matcher="M085", tol=1.0E-5, ref=-156.376729575050433}]
|
||||
"LiF.inp" = [{matcher="M085", tol=1.0E-5, ref=-36.658529490345153}]
|
||||
"N2.inp" = [{matcher="M085", tol=1.0E-9, ref=-16.572137677057988}]
|
||||
"Fe-upf.inp" = [{matcher="M085", tol=1.0E-5, ref=-322.37407840130044}]
|
||||
"Au_GTH.inp" = [{matcher="M085", tol=1.0E-5, ref=-33.157343398225969}]
|
||||
"Au_GTH_SOC.inp" = [{matcher="M085", tol=1.0E-5, ref=-135.58863815223782}]
|
||||
"Au.inp" = [{matcher="M085", tol=5.0E-8, ref=-147.225566702788200}]
|
||||
"Fe.inp" = [{matcher="M085", tol=5.0E-8, ref=-253.637351928254105}]
|
||||
"Fe_dos.inp" = [{matcher="M085", tol=5.0E-8, ref=-253.637351928254105}]
|
||||
"He-full-potential.inp" = [{matcher="M085", tol=5.0E-8, ref=-2.835107805775919}]
|
||||
"SrVO.inp" = [{matcher="M085", tol=5.0E-8, ref=-156.376729575050433}]
|
||||
"LiF.inp" = [{matcher="M085", tol=5.0E-8, ref=-36.658529490345153}]
|
||||
"N2.inp" = [{matcher="M085", tol=5.0E-8, ref=-16.572137677057988}]
|
||||
"Fe-upf.inp" = [{matcher="M085", tol=5.0E-8, ref=-322.37407840130044}]
|
||||
"Au_GTH.inp" = [{matcher="M085", tol=5.0E-8, ref=-33.157343398225969}]
|
||||
"Au_GTH_SOC.inp" = [{matcher="M085", tol=5.0E-8, ref=-135.58863815223782}]
|
||||
#EOF
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
# Usage: podman build --shm-size=1g -f ./Dockerfile.test_fedora-psmp ../../
|
||||
#
|
||||
|
||||
FROM fedora:41
|
||||
FROM fedora:44
|
||||
|
||||
# Install requirements for the toolchain.
|
||||
WORKDIR /opt/cp2k-toolchain
|
||||
COPY ./tools/toolchain/install_requirements*.sh ./
|
||||
RUN ./install_requirements.sh fedora:41
|
||||
RUN ./install_requirements.sh fedora:44
|
||||
|
||||
# Install the toolchain.
|
||||
RUN mkdir scripts
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ def main() -> None:
|
|||
f.write(regtest("toolchain", "psmp"))
|
||||
|
||||
with OutputFile(f"Dockerfile.test_fedora-psmp", args.check) as f:
|
||||
f.write(install_deps_toolchain(base_image="fedora:41"))
|
||||
f.write(install_deps_toolchain(base_image="fedora:44"))
|
||||
f.write(regtest("toolchain", "psmp"))
|
||||
|
||||
for version in "ssmp", "psmp":
|
||||
|
|
|
|||
|
|
@ -287,6 +287,8 @@ Specific options of --with-PKG:
|
|||
--with-gsl Enable the GNU scientific library (GSL).
|
||||
This package is required for PLUMED and SIRIUS.
|
||||
Default = install
|
||||
--with-fmt Enable the formatting C/C++ library.
|
||||
This package is required for SIRIUS.
|
||||
--with-libtorch Enable libtorch as a machine learning framework.
|
||||
This package is required for NequIP and Allegro, and
|
||||
also for installing DeePMD-kit.
|
||||
|
|
@ -464,7 +466,7 @@ math_list="mkl acml openblas"
|
|||
lib_list="fftw libint libxc libxsmm cosma scalapack elpa dbcsr
|
||||
cusolvermp plumed spfft spla gsl spglib hdf5 libvdwxc sirius
|
||||
libvori libtorch deepmd ace dftd4 tblite pugixml libsmeagol
|
||||
trexio greenx gmp mcl"
|
||||
fmt trexio greenx gmp mcl"
|
||||
package_list="${tool_list} ${mpi_list} ${math_list} ${lib_list}"
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -489,6 +491,7 @@ with_libxc="__INSTALL__"
|
|||
with_scalapack="__INSTALL__"
|
||||
with_sirius="__INSTALL__"
|
||||
with_gsl="__DONTUSE__"
|
||||
with_fmt="__DONTUSE__"
|
||||
with_spglib="__INSTALL__"
|
||||
with_hdf5="__DONTUSE__"
|
||||
with_trexio="__DONTUSE__"
|
||||
|
|
@ -866,6 +869,9 @@ Otherwise use option no."
|
|||
--with-gsl*)
|
||||
with_gsl=$(read_with "${1}")
|
||||
;;
|
||||
--with-fmt*)
|
||||
with_fmt=$(read_with "${1}")
|
||||
;;
|
||||
--with-spglib*)
|
||||
with_spglib=$(read_with "${1}")
|
||||
;;
|
||||
|
|
@ -1103,6 +1109,7 @@ if [ "${with_sirius}" = "__INSTALL__" ]; then
|
|||
[ "${with_spfft}" = "__DONTUSE__" ] && with_spfft="__INSTALL__"
|
||||
[ "${with_spla}" = "__DONTUSE__" ] && with_spla="__INSTALL__"
|
||||
[ "${with_gsl}" = "__DONTUSE__" ] && with_gsl="__INSTALL__"
|
||||
[ "${with_fmt}" = "__DONTUSE__" ] && with_fmt="__INSTALL__"
|
||||
[ "${with_libxc}" = "__DONTUSE__" ] && with_libxc="__INSTALL__"
|
||||
[ "${with_fftw}" = "__DONTUSE__" ] && with_fftw="__INSTALL__"
|
||||
[ "${with_spglib}" = "__DONTUSE__" ] && with_spglib="__INSTALL__"
|
||||
|
|
|
|||
83
tools/toolchain/scripts/stage7/install_fmt.sh
Executable file
83
tools/toolchain/scripts/stage7/install_fmt.sh
Executable file
|
|
@ -0,0 +1,83 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# TODO: Review and if possible fix shellcheck errors.
|
||||
# shellcheck disable=all
|
||||
|
||||
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
|
||||
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
|
||||
|
||||
fmt_ver="12.1.0"
|
||||
fmt_sha256="695fd197fa5aff8fc67b5f2bbc110490a875cdf7a41686ac8512fb480fa8ada7"
|
||||
|
||||
source "${SCRIPT_DIR}"/common_vars.sh
|
||||
source "${SCRIPT_DIR}"/tool_kit.sh
|
||||
source "${SCRIPT_DIR}"/signal_trap.sh
|
||||
source "${INSTALLDIR}"/toolchain.conf
|
||||
source "${INSTALLDIR}"/toolchain.env
|
||||
|
||||
[ -f "${BUILDDIR}/setup_fmt" ] && rm "${BUILDDIR}/setup_fmt"
|
||||
|
||||
! [ -d "${BUILDDIR}" ] && mkdir -p "${BUILDDIR}"
|
||||
cd "${BUILDDIR}"
|
||||
|
||||
case "$with_fmt" in
|
||||
__INSTALL__)
|
||||
echo "==================== Installing fmt ===================="
|
||||
pkg_install_dir="${INSTALLDIR}/fmt-${fmt_ver}"
|
||||
install_lock_file="$pkg_install_dir/install_successful"
|
||||
if verify_checksums "${install_lock_file}"; then
|
||||
echo "fmt-${fmt_ver} is already installed, skipping it."
|
||||
else
|
||||
retrieve_package "${fmt_sha256}" "fmt-${fmt_ver}.zip"
|
||||
echo "Installing from scratch into ${pkg_install_dir}"
|
||||
[ -d fmt-${fmt_ver} ] && rm -rf fmt-${fmt_ver}
|
||||
unzip -q fmt-${fmt_ver}.zip
|
||||
cd fmt-${fmt_ver}
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX="${pkg_install_dir}" \
|
||||
-DCMAKE_INSTALL_LIBDIR="lib" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
> configure.log 2>&1 || tail_excerpt configure.log
|
||||
make install -j $(get_nprocs) > make.log 2>&1 || tail_excerpt make.log
|
||||
cd ..
|
||||
write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage7/$(basename ${SCRIPT_NAME})"
|
||||
fi
|
||||
;;
|
||||
__SYSTEM__)
|
||||
echo "==================== Finding fmt from system paths ===================="
|
||||
check_lib -lfmt "fmt"
|
||||
;;
|
||||
__DONTUSE__)
|
||||
# Nothing to do
|
||||
;;
|
||||
*)
|
||||
echo "==================== Linking fmt to user paths ===================="
|
||||
pkg_install_dir="${with_fmt}"
|
||||
check_dir "${pkg_install_dir}/lib"
|
||||
check_dir "${pkg_install_dir}/include"
|
||||
;;
|
||||
esac
|
||||
if [ "${with_fmt}" != "__DONTUSE__" ]; then
|
||||
if [ "${with_fmt}" != "__SYSTEM__" ]; then
|
||||
cat << EOF > "${BUILDDIR}/setup_fmt"
|
||||
prepend_path LD_LIBRARY_PATH "${pkg_install_dir}/lib"
|
||||
prepend_path LD_RUN_PATH "${pkg_install_dir}/lib"
|
||||
prepend_path LIBRARY_PATH "${pkg_install_dir}/lib"
|
||||
prepend_path PKG_CONFIG_PATH "${pkg_install_dir}/lib/pkgconfig"
|
||||
prepend_path CMAKE_PREFIX_PATH "${pkg_install_dir}"
|
||||
EOF
|
||||
fi
|
||||
cat << EOF >> "${BUILDDIR}/setup_fmt"
|
||||
export fmt_VER="${fmt_ver}"
|
||||
export fmt_ROOT="${pkg_install_dir}"
|
||||
EOF
|
||||
filter_setup "${BUILDDIR}/setup_fmt" "${SETUPFILE}"
|
||||
fi
|
||||
|
||||
load "${BUILDDIR}/setup_fmt"
|
||||
write_toolchain_env "${INSTALLDIR}"
|
||||
|
||||
cd "${ROOTDIR}"
|
||||
report_timing "fmt"
|
||||
|
|
@ -5,8 +5,9 @@
|
|||
|
||||
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
|
||||
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
|
||||
libvdwxc_ver="0.4.0"
|
||||
libvdwxc_sha256="3524feb5bb2be86b4688f71653502146b181e66f3f75b8bdaf23dd1ae4a56b33"
|
||||
|
||||
libvdwxc_ver="0.5.0"
|
||||
libvdwxc_sha256="29fb70efd58aff51524d2172a87e8f88e760b696b0ddb9aa5878432bdffa3c2f"
|
||||
|
||||
source "${SCRIPT_DIR}"/common_vars.sh
|
||||
source "${SCRIPT_DIR}"/tool_kit.sh
|
||||
|
|
|
|||
|
|
@ -8,5 +8,6 @@
|
|||
./scripts/stage7/install_spglib.sh
|
||||
./scripts/stage7/install_libvori.sh
|
||||
./scripts/stage7/install_libsmeagol.sh
|
||||
./scripts/stage7/install_fmt.sh
|
||||
|
||||
#EOF
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
|
||||
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
|
||||
|
||||
sirius_ver="7.7.1"
|
||||
sirius_sha256="6039c84197d9e719e826f98b840cff19bc513887b443f97c0099d3c8b908efed"
|
||||
sirius_ver="7.11.1"
|
||||
sirius_sha256="ce77dd168b2c3ef4a89cc2d6b163cb00b3d8b9d4b0652bc9de187dc7e0e74d77"
|
||||
|
||||
source "${SCRIPT_DIR}"/common_vars.sh
|
||||
source "${SCRIPT_DIR}"/tool_kit.sh
|
||||
|
|
@ -31,48 +31,6 @@ case "$with_sirius" in
|
|||
|
||||
__INSTALL__)
|
||||
echo "==================== Installing SIRIUS ===================="
|
||||
require_env FFTW_LDFLAGS
|
||||
require_env FFTW_LIBS
|
||||
require_env FFTW_CFLAGS
|
||||
require_env ELPA_ROOT
|
||||
require_env ELPA_LDFLAGS
|
||||
require_env ELPA_LIBS
|
||||
require_env ELPA_CFLAGS
|
||||
require_env GSL_ROOT
|
||||
require_env GSL_LDFLAGS
|
||||
require_env GSL_CFLAGS
|
||||
require_env GSL_LIBS
|
||||
require_env GSL_INCLUDE_DIR
|
||||
require_env GSL_LIBRARY
|
||||
require_env MATH_LIBS
|
||||
require_env MPI_LDFLAGS
|
||||
require_env MPI_LIBS
|
||||
require_env SCALAPACK_ROOT
|
||||
require_env SCALAPACK_LDFLAGS
|
||||
require_env SCALAPACK_CFLAGS
|
||||
require_env SCALAPACK_LIBS
|
||||
require_env LIBXC_LIBS
|
||||
require_env LIBXC_CFLAGS
|
||||
require_env LIBXC_LDFLAGS
|
||||
require_env SPGLIB_LIBS
|
||||
require_env SPGLIB_CFLAGS
|
||||
require_env SPGLIB_LDFLAGS
|
||||
require_env HDF5_LIBS
|
||||
require_env HDF5_CFLAGS
|
||||
require_env HDF5_LDFLAGS
|
||||
require_env LIBVDWXC_CFLAGS
|
||||
require_env LIBVDWXC_LIBS
|
||||
require_env LIBVDWXC_LDFLAGS
|
||||
require_env SPFFT_ROOT
|
||||
require_env SPFFT_CFLAGS
|
||||
require_env SPFFT_LDFLAGS
|
||||
require_env SPFFT_LIBS
|
||||
require_env SPLA_ROOT
|
||||
require_env PUGIXML_ROOT
|
||||
require_env SPLA_CFLAGS
|
||||
require_env SPLA_LDFLAGS
|
||||
require_env SPLA_LIBS
|
||||
require_env COSMA_ROOT
|
||||
ARCH=$(uname -m)
|
||||
SIRIUS_OPT="-O3 -DNDEBUG -mtune=native -ftree-loop-vectorize ${MATH_CFLAGS}"
|
||||
if [ "$ARCH" = "ppc64le" ]; then
|
||||
|
|
@ -99,7 +57,7 @@ case "$with_sirius" in
|
|||
pkg_install_dir="${INSTALLDIR}/sirius-${sirius_ver}"
|
||||
install_lock_file="${pkg_install_dir}/install_successful"
|
||||
if verify_checksums "${install_lock_file}"; then
|
||||
echo "sirius_dist-${sirius_ver} is already installed, skipping it."
|
||||
echo "sirius-${sirius_ver} is already installed, skipping it."
|
||||
else
|
||||
retrieve_package "${sirius_sha256}" "SIRIUS-${sirius_ver}.tar.gz"
|
||||
echo "Installing from scratch into ${pkg_install_dir}"
|
||||
|
|
@ -110,32 +68,19 @@ case "$with_sirius" in
|
|||
rm -Rf build
|
||||
mkdir build
|
||||
cd build
|
||||
# if [ -n "$ELPA_LIBS" ] ; then
|
||||
# if [ -s "$ELPA_ROOT" ] ; then
|
||||
# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ELPA_ROOT/lib/pkgconfig:$ELPA_ROOT/lib64/pkgconfig
|
||||
# fi
|
||||
# EXTRA_CMAKE_FLAGS="-DUSE_ELPA=ON -DELPA_INCLUDE_DIR=${ELPA_ROOT}/include/elpa-${ELPA_VER} ${EXTRA_CMAKE_FLAGS}"
|
||||
# fi
|
||||
|
||||
if [ -n "${SCALAPACK_LIBS}" ]; then
|
||||
export SCALAPACK_LIB="${SCALAPACK_LIBS}"
|
||||
if [ "${with_elpa}" != "__DONTUSE__" ]; then
|
||||
EXTRA_CMAKE_FLAGS="-DSIRIUS_USE_ELPA=ON ${EXTRA_CMAKE_FLAGS}"
|
||||
fi
|
||||
if [ -n "${HDF5_LIBS}" ]; then
|
||||
CMAKE_PREFIX_PATH="${HDF5_ROOT} ${CMAKE_PREFIX_PATH}"
|
||||
if [ "${MATH_MODE}" == "mkl" ]; then
|
||||
EXTRA_CMAKE_FLAGS="-DSIRIUS_USE_MKL=ON -DSIRIUS_USE_SCALAPACK=ON ${EXTRA_CMAKE_FLAGS}"
|
||||
fi
|
||||
if [ -n "${LIBVDWXC_LIBS}" ]; then
|
||||
CMAKE_PREFIX_PATH="${LIBVDWXC_ROOT} ${CMAKE_PREFIX_PATH}"
|
||||
EXTRA_CMAKE_FLAGS="-DSIRIUS_USE_VDWXC=ON ${EXTRA_CMAKE_FLAGS}"
|
||||
else
|
||||
EXTRA_CMAKE_FLAGS="-DSIRIUS_USE_VDWXC=OFF ${EXTRA_CMAKE_FLAGS}"
|
||||
if [ "${with_tblite}" != "__DONTUSE__" ]; then
|
||||
# tblite includes s-dftd3
|
||||
EXTRA_CMAKE_FLAGS="-DSIRIUS_USE_DFTD3=ON -DSIRIUS_USE_DFTD4=ON ${EXTRA_CMAKE_FLAGS}"
|
||||
elif [ "${with_dftd4}" != "__DONTUSE__" ]; then
|
||||
EXTRA_CMAKE_FLAGS="-DSIRIUS_USE_DFTD4=ON ${EXTRA_CMAKE_FLAGS}"
|
||||
fi
|
||||
if [ -n "${MKL_LIBS}" ]; then
|
||||
EXTRA_CMAKE_FLAGS="-DSIRIUS_USE_MKL=ON ${EXTRA_CMAKE_FLAGS}"
|
||||
fi
|
||||
SpFFT_DIR="${SpFFT_ROOT}/lib/cmake/SpFFT"
|
||||
SpLA_DIR="${SpLA_ROOT}/lib/cmake/SPLA"
|
||||
COSTA_DIR="${COSMA_ROOT}/lib/cmake/costa"
|
||||
CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${GSL_ROOT}:${SPGLIB_ROOT}:${LIBXC_ROOT}:${SpFFT_DIR}:${SpLA_DIR}:${COSTA_DIR}:${PUGIXML_ROOT}" cmake \
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX="${pkg_install_dir}" \
|
||||
-DCMAKE_INSTALL_LIBDIR="lib" \
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="${SIRIUS_OPT}" \
|
||||
|
|
@ -146,14 +91,13 @@ case "$with_sirius" in
|
|||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DSIRIUS_USE_VDWXC=ON \
|
||||
-DSIRIUS_USE_PUGIXML=ON \
|
||||
-DSIRIUS_USE_MEMORY_POOL=OFF \
|
||||
-DSIRIUS_USE_ELPA=OFF \
|
||||
${EXTRA_CMAKE_FLAGS} .. \
|
||||
> cmake.log 2>&1 || tail_excerpt cmake.log
|
||||
|
||||
make -j $(get_nprocs) -C src >> make.log 2>&1 || tail_excerpt make.log
|
||||
make install >> make.log 2>&1 || tail_excerpt make.log
|
||||
make -j $(get_nprocs) install > make.log 2>&1 || tail_excerpt make.log
|
||||
cd ..
|
||||
|
||||
# now do we have cuda as well
|
||||
|
|
@ -162,26 +106,25 @@ case "$with_sirius" in
|
|||
[ -d build-cuda ] && rm -rf "build-cuda"
|
||||
mkdir build-cuda
|
||||
cd build-cuda
|
||||
CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${GSL_ROOT}:${SPGLIB_ROOT}:${LIBXC_ROOT}:${SpFFT_DIR}:${SpLA_DIR}:${COSTA_DIR}" cmake \
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=${pkg_install_dir}/cuda \
|
||||
-DCMAKE_INSTALL_LIBDIR="lib" \
|
||||
-DCMAKE_CXX_FLAGS_RELEASE="${SIRIUS_OPT}" \
|
||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${SIRIUS_DBG}" \
|
||||
-DCMAKE_CUDA_FLAGS="-std=c++14 -allow-unsupported-compiler" \
|
||||
-DSIRIUS_USE_CUDA=ON \
|
||||
-DSIRIUS_USE_ELPA=OFF \
|
||||
-DGPU_MODEL=P100 \
|
||||
-DSIRIUS_USE_MEMORY_POOL=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DSIRIUS_USE_PUGIXML=ON \
|
||||
-DSIRIUS_USE_VDWXC=ON \
|
||||
-DCMAKE_CXX_COMPILER="${MPICXX}" \
|
||||
-DCMAKE_C_COMPILER="${MPICC}" \
|
||||
-DCMAKE_Fortran_COMPILER="${MPIFC}" \
|
||||
${EXTRA_CMAKE_FLAGS} .. \
|
||||
>> cmake.log 2>&1 || tail_excerpt cmake.log
|
||||
make -j $(get_nprocs) -C src >> make.log 2>&1 || tail_excerpt make.log
|
||||
make install >> make.log 2>&1 || tail_excerpt make.log
|
||||
make -j $(get_nprocs) install >> make.log 2>&1 || tail_excerpt make.log
|
||||
SIRIUS_CUDA_LDFLAGS="-L'${pkg_install_dir}/cuda/lib' -Wl,-rpath,'${pkg_install_dir}/cuda/lib'"
|
||||
cd ..
|
||||
fi
|
||||
|
|
@ -191,44 +134,6 @@ case "$with_sirius" in
|
|||
fi
|
||||
;;
|
||||
__SYSTEM__)
|
||||
require_env FFTW_LDFLAGS
|
||||
require_env FFTW_LIBS
|
||||
require_env FFTW_CFLAGS
|
||||
require_env ELPA_ROOT
|
||||
require_env ELPA_LDFLAGS
|
||||
require_env ELPA_LIBS
|
||||
require_env ELPA_CFLAGS
|
||||
require_env GSL_LDFLAGS
|
||||
require_env GSL_CFLAGS
|
||||
require_env GSL_LIBS
|
||||
require_env MATH_LIBS
|
||||
require_env MPI_LDFLAGS
|
||||
require_env MPI_LIBS
|
||||
require_env SCALAPACK_ROOT
|
||||
require_env SCALAPACK_LDFLAGS
|
||||
require_env SCALAPACK_CFLAGS
|
||||
require_env SCALAPACK_LIBS
|
||||
require_env LIBXC_LIBS
|
||||
require_env LIBXC_CFLAGS
|
||||
require_env LIBXC_LDFLAGS
|
||||
require_env SPGLIB_LIBS
|
||||
require_env SPGLIB_CFLAGS
|
||||
require_env SPGLIB_LDFLAGS
|
||||
require_env HDF5_LIBS
|
||||
require_env HDF5_CFLAGS
|
||||
require_env HDF5_LDFLAGS
|
||||
require_env LIBVDWXC_CFLAGS
|
||||
require_env LIBVDWXC_LDFLAGS
|
||||
require_env LIBVDWXC_LIBS
|
||||
require_env SPFFT_ROOT
|
||||
require_env SPFFT_CFLAGS
|
||||
require_env SPFFT_LDFLAGS
|
||||
require_env SPFFT_LIBS
|
||||
require_env SPLA_ROOT
|
||||
require_env PUGIXML_ROOT
|
||||
require_env SPLA_CFLAGS
|
||||
require_env SPLA_LDFLAGS
|
||||
require_env SPLA_LIBS
|
||||
check_lib -lsirius "sirius"
|
||||
check_lib -lsirius_cxx "sirius_cxx"
|
||||
add_include_from_paths SIRIUS_CFLAGS "sirius*" $INCLUDE_PATHS
|
||||
|
|
@ -236,7 +141,7 @@ case "$with_sirius" in
|
|||
add_lib_from_paths SIRIUS_LDFLAGS "libsirius_cxx.*" $LIB_PATHS
|
||||
;;
|
||||
*)
|
||||
echo "==================== Linking SIRIUS_Dist to user paths ===================="
|
||||
echo "==================== Linking SIRIUS to user paths ===================="
|
||||
pkg_install_dir="$with_sirius"
|
||||
check_dir "${pkg_install_dir}/lib"
|
||||
check_dir "${pkg_install_dir}/lib64"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ case "${with_spfft}" in
|
|||
if [ "${MATH_MODE}" = "mkl" ]; then
|
||||
EXTRA_CMAKE_FLAGS="-DSPFFT_MKL=ON -DSPFFT_FFTW_LIB=MKL"
|
||||
else
|
||||
EXTRA_CMAKE_FLAGS=""
|
||||
EXTRA_CMAKE_FLAGS="-DSPFFT_MKL=OFF -DSPFFT_FFTW_LIB=FFTW"
|
||||
fi
|
||||
|
||||
[ -d SpFFT-${spfft_ver} ] && rm -rf SpFFT-${spfft_ver}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
# TODO: Review and if possible fix shellcheck errors.
|
||||
# shellcheck disable=all
|
||||
|
||||
./scripts/stage8/install_dftd4.sh
|
||||
./scripts/stage8/install_tblite.sh
|
||||
./scripts/stage8/install_pugixml.sh
|
||||
./scripts/stage8/install_spfft.sh
|
||||
./scripts/stage8/install_spla.sh
|
||||
./scripts/stage8/install_sirius.sh
|
||||
./scripts/stage8/install_dftd4.sh
|
||||
./scripts/stage8/install_trexio.sh
|
||||
./scripts/stage8/install_tblite.sh
|
||||
./scripts/stage8/install_mcl.sh
|
||||
#EOF
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/src/core/memory.hpp
|
||||
+++ b/src/core/memory.hpp
|
||||
@@ -256,7 +256,7 @@
|
||||
|
||||
/// Allocate n elements and return a unique pointer.
|
||||
template <typename T>
|
||||
-static inline auto
|
||||
+inline auto
|
||||
get_unique_ptr(size_t n__, memory_t M__)
|
||||
{
|
||||
return std::unique_ptr<T, std::function<void(void*)>>(allocate<T>(n__, M__),
|
||||
Loading…
Add table
Add a link
Reference in a new issue