Toolchain: Small fixes following up #4784 and #4787

This commit is contained in:
Growl 2026-02-07 12:11:03 +08:00 committed by Ole Schütt
parent 77f1922497
commit 7a8bbbd46a
5 changed files with 11 additions and 6 deletions

View file

@ -19,7 +19,7 @@ OPENBLAS_LIBCORE=${OPENBLAS_LIBCORE:-''}
# search paths
SYS_INCLUDE_PATH=${SYS_INCLUDE_PATH:-'/usr/local/include:/usr/include'}
SYS_LIB_PATH=${SYS_LIB_PATHS:-'/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/lib64:/lib'}
SYS_LIB_PATH=${SYS_LIB_PATHS:-'/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/aarch-linux-gnu:/lib64:/lib'}
INCLUDE_PATHS=${INCLUDE_PATHS:-"CPATH SYS_INCLUDE_PATH"}
LIB_PATHS=${LIB_PATHS:-'LD_LIBRARY_PATH LIBRARY_PATH LD_RUN_PATH SYS_LIB_PATH'}

View file

@ -135,7 +135,12 @@ export MPICH_LIBS="${MPICH_LIBS}"
export MPI_CFLAGS="${MPICH_CFLAGS}"
export MPI_LDFLAGS="${MPICH_LDFLAGS}"
export MPI_LIBS="${MPICH_LIBS}"
export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__parallel -D__MPI_F08|)"
export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__parallel|)"
# For proper mpi_f08 support, we need at least GCC version 9 (asynchronous keyword)
# Other compilers should work
if ! [ "\$(gfortran -dumpversion | cut -d. -f1)" -lt 9 ]; then
export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__MPI_F08|)"
fi
export CP_CFLAGS="\${CP_CFLAGS} IF_MPI(${MPICH_CFLAGS}|)"
export CP_LDFLAGS="\${CP_LDFLAGS} IF_MPI(${MPICH_LDFLAGS}|)"
export CP_LIBS="\${CP_LIBS} IF_MPI(${MPICH_LIBS}|)"

View file

@ -109,7 +109,7 @@ case "${with_openblas}" in
check_lib -lopenblas_openmp 2> /dev/null && OPENBLAS_LIBS="-lopenblas_openmp"
check_lib -lopenblas_omp 2> /dev/null && OPENBLAS_LIBS="-lopenblas_omp"
pkg_install_dir="$(dirname $(dirname $(find_in_paths "libopenblas.*" $LIB_PATHS)))"
# Deal with the condition that libfftw3 is installed in "/usr/lib/x86_64-linux-gnu"
# Deal with the condition that libopenblas is installed in "/usr/lib/x86_64-linux-gnu"
if [[ "${pkg_install_dir}" == "/usr/lib"* ]]; then
pkg_install_dir="/usr"
else

View file

@ -73,11 +73,11 @@ case "$with_scalapack" in
echo "==================== Finding ScaLAPACK from system paths ===================="
check_lib -lscalapack "ScaLAPACK"
pkg_install_dir="$(dirname $(dirname $(find_in_paths "libscalapack*" $LIB_PATHS)))"
# Deal with the condition that libfftw3 is installed in "/usr/lib/x86_64-linux-gnu"
# Deal with the condition that libscalapack is installed in "/usr/lib/x86_64-linux-gnu"
if [[ "${pkg_install_dir}" == "/usr/lib"* ]]; then
pkg_install_dir="/usr"
fi
add_lib_from_paths SCALAPACK_LDFLAGS "libscalapack.*" $LIB_PATHS
add_lib_from_paths SCALAPACK_LDFLAGS "libscalapack*" $LIB_PATHS
;;
__DONTUSE__) ;;

View file

@ -49,7 +49,7 @@ case "${with_dbcsr}" in
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DUSE_MPI=OFF"
else
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DUSE_MPI=ON"
if [ -n $(grep "MPI_F08" "${INSTALLDIR}"/toolchain.env) ]; then
if [ -n "$(grep "MPI_F08" "${INSTALLDIR}"/toolchain.env)" ]; then
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCP2K_USE_MPI_F08=ON"
fi
fi