Toolchain cleanup: Remove unused flags (stage0-2) (#5463)

This commit is contained in:
SY Wang 2026-06-26 18:17:11 +08:00 committed by GitHub
parent 9abfe98c3b
commit b76ce4ef50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 22 additions and 201 deletions

View file

@ -1330,46 +1330,10 @@ if [ "${ENABLE_CRAY}" = "__TRUE__" ]; then
export MPIFC="${FC}"
export MPIFORT="${MPIFC}"
export MPIF77="${MPIFC}"
case $MPI_MODE in
mpich)
if [ -n "$MPICH_DIR" ]; then
cray_mpich_include_path="$MPICH_DIR/include"
cray_mpich_lib_path="$MPICH_DIR/lib"
export INCLUDE_PATHS="$INCLUDE_PATHS $cray_mpich_include_path"
export LIB_PATHS="$LIB_PATHS $cray_mpich_lib_path"
fi
if [ "$with_mpich" = "__DONTUSE__" ]; then
add_include_from_paths MPI_CFLAGS "mpi.h" "$INCLUDE_PATHS"
add_include_from_paths MPI_LDFLAGS "libmpi.*" "$LIB_PATHS"
export MPI_CFLAGS
export MPI_LDFLAGS
export MPI_LIBS=" "
export CP_DFLAGS="${CP_DFLAGS} IF_MPI(-D__parallel|)"
fi
;;
openmpi)
if [ "$with_openmpi" = "__DONTUSE__" ]; then
add_include_from_paths MPI_CFLAGS "mpi.h" "$INCLUDE_PATHS"
add_include_from_paths MPI_LDFLAGS "libmpi.*" "$LIB_PATHS"
export MPI_CFLAGS
export MPI_LDFLAGS
export MPI_LIBS="-lmpi -lmpi_cxx"
export CP_DFLAGS="${CP_DFLAGS} IF_MPI(-D__parallel|)"
fi
;;
intelmpi)
if [ "$with_intelmpi" = "__DONTUSE__" ]; then
with_gcc="__DONTUSE__"
with_intel="__SYSTEM__"
add_include_from_paths MPI_CFLAGS "mpi.h" "$INCLUDE_PATHS"
add_include_from_paths MPI_LDFLAGS "libmpi.*" "$LIB_PATHS"
export MPI_CFLAGS
export MPI_LDFLAGS
export MPI_LIBS="-lmpi -lmpi_cxx"
export CP_DFLAGS="${CP_DFLAGS} IF_MPI(-D__parallel|)"
fi
;;
esac
if [ "$with_intelmpi" = "__DONTUSE__" ]; then
with_gcc="__DONTUSE__"
with_intel="__SYSTEM__"
fi
check_lib -lz
check_lib -ldl
export CRAY_EXTRA_LIBS="-lz -ldl"

View file

@ -45,8 +45,6 @@ case "${with_amd}" in
check_command ${pkg_install_dir}/bin/flang "amd" && FC="${pkg_install_dir}/bin/flang" || exit 1
F90="${FC}"
F77="${FC}"
AMD_CFLAGS="-I'${pkg_install_dir}/include'"
AMD_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
;;
esac
if [ "${with_amd}" != "__DONTUSE__" ]; then
@ -69,14 +67,8 @@ prepend_path PATH "${pkg_install_dir}/bin"
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 CPATH "${pkg_install_dir}/include"
EOF
fi
cat << EOF >> "${BUILDDIR}/setup_amd"
export AMD_CFLAGS="${AMD_CFLAGS}"
export AMD_LDFLAGS="${AMD_LDFLAGS}"
export AMD_LIBS="${AMD_LIBS}"
EOF
filter_setup "${BUILDDIR}/setup_amd" "${SETUPFILE}"
fi

View file

@ -108,8 +108,6 @@ case "${with_gcc}" in
check_install ${pkg_install_dir}/bin/gfortran "gcc" && FC="${pkg_install_dir}/bin/gfortran" || exit 1
F90="${FC}"
F77="${FC}"
GCC_CFLAGS="-I'${pkg_install_dir}/include'"
GCC_LDFLAGS="-L'${pkg_install_dir}/lib64' -L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib64' -Wl,-rpath,'${pkg_install_dir}/lib64'"
;;
__SYSTEM__)
echo "==================== Finding GCC from system paths ===================="
@ -119,8 +117,6 @@ case "${with_gcc}" in
echo "GCC compiler version $(gcc -dumpfullversion) found"
F90="${FC}"
F77="${FC}"
add_include_from_paths -p GCC_CFLAGS "c++" ${INCLUDE_PATHS}
add_lib_from_paths GCC_LDFLAGS "libgfortran.*" ${LIB_PATHS}
;;
__DONTUSE__)
# Nothing to do
@ -137,8 +133,6 @@ case "${with_gcc}" in
check_command ${pkg_install_dir}/bin/gfortran "gcc" && FC="${pkg_install_dir}/bin/gfortran" || exit 1
F90="${FC}"
F77="${FC}"
GCC_CFLAGS="-I'${pkg_install_dir}/include'"
GCC_LDFLAGS="-L'${pkg_install_dir}/lib64' -L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib64' -Wl,-rpath,'${pkg_install_dir}/lib64'"
;;
esac
if [ "${ENABLE_TSAN}" = "__TRUE__" ]; then
@ -153,6 +147,7 @@ export CXX="${CXX}"
export FC="${FC}"
export F90="${F90}"
export F77="${F77}"
export TSANFLAGS="${TSANFLAGS}"
EOF
if [ "${with_gcc}" != "__SYSTEM__" ]; then
cat << EOF >> "${BUILDDIR}/setup_gcc"
@ -164,14 +159,8 @@ prepend_path LD_RUN_PATH "${pkg_install_dir}/lib"
prepend_path LD_RUN_PATH "${pkg_install_dir}/lib64"
prepend_path LIBRARY_PATH "${pkg_install_dir}/lib"
prepend_path LIBRARY_PATH "${pkg_install_dir}/lib64"
prepend_path CPATH "${pkg_install_dir}/include"
EOF
fi
cat << EOF >> "${BUILDDIR}/setup_gcc"
export GCC_CFLAGS="${GCC_CFLAGS}"
export GCC_LDFLAGS="${GCC_LDFLAGS}"
export TSANFLAGS="${TSANFLAGS}"
EOF
filter_setup "${BUILDDIR}/setup_gcc" "${SETUPFILE}"
fi

View file

@ -53,8 +53,6 @@ case "${with_intel}" in
fi
F90="${FC}"
F77="${FC}"
INTEL_CFLAGS="-I'${pkg_install_dir}/include'"
INTEL_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
;;
esac
if [ "${with_intel}" != "__DONTUSE__" ]; then
@ -74,14 +72,8 @@ prepend_path PATH "${pkg_install_dir}/bin"
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 CPATH "${pkg_install_dir}/include"
EOF
fi
cat << EOF >> "${BUILDDIR}/setup_intel"
export INTEL_CFLAGS="${INTEL_CFLAGS}"
export INTEL_LDFLAGS="${INTEL_LDFLAGS}"
export INTEL_LIBS="${INTEL_LIBS}"
EOF
filter_setup "${BUILDDIR}/setup_intel" "${SETUPFILE}"
fi

View file

@ -43,9 +43,6 @@ case "${with_intelmpi}" in
fi
MPIFORT="${MPIFC}"
MPIF77="${MPIFC}"
# include path is already handled by compiler wrapper scripts (can cause wrong mpi.mod with GNU Fortran)
# add_include_from_paths INTELMPI_CFLAGS "mpi.h" $INCLUDE_PATHS
add_lib_from_paths INTELMPI_LDFLAGS "libmpi.*" $LIB_PATHS
check_lib -lmpi "intelmpi"
check_lib -lmpicxx "intelmpi"
;;
@ -69,9 +66,6 @@ case "${with_intelmpi}" in
fi
MPIFORT="${MPIFC}"
MPIF77="${MPIFC}"
# include path is already handled by compiler wrapper scripts (can cause wrong mpi.mod with GNU Fortran)
#INTELMPI_CFLAGS="-I'${pkg_install_dir}/include'"
INTELMPI_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
;;
esac
if [ "${with_intelmpi}" != "__DONTUSE__" ]; then
@ -82,7 +76,6 @@ if [ "${with_intelmpi}" != "__DONTUSE__" ]; then
else
I_MPI_FC="ifort"
fi
INTELMPI_LIBS="-lmpi -lmpicxx"
echo "I_MPI_CXX is ${I_MPI_CXX}"
echo "I_MPI_CC is ${I_MPI_CC}"
echo "I_MPI_FC is ${I_MPI_FC}"
@ -100,16 +93,6 @@ export MPICXX="${MPICXX}"
export MPIFC="${MPIFC}"
export MPIFORT="${MPIFORT}"
export MPIF77="${MPIF77}"
export INTELMPI_CFLAGS="${INTELMPI_CFLAGS}"
export INTELMPI_LDFLAGS="${INTELMPI_LDFLAGS}"
export INTELMPI_LIBS="${INTELMPI_LIBS}"
export MPI_CFLAGS="${INTELMPI_CFLAGS}"
export MPI_LDFLAGS="${INTELMPI_LDFLAGS}"
export MPI_LIBS="${INTELMPI_LIBS}"
export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__parallel -D__MPI_F08|)"
export CP_CFLAGS="\${CP_CFLAGS} IF_MPI(${INTELMPI_CFLAGS}|)"
export CP_LDFLAGS="\${CP_LDFLAGS} IF_MPI(${INTELMPI_LDFLAGS}|)"
export CP_LIBS="\${CP_LIBS} IF_MPI(${INTELMPI_LIBS}|)"
EOF
if [ "${with_intelmpi}" != "__SYSTEM__" ]; then
cat << EOF >> "${BUILDDIR}/setup_intelmpi"
@ -117,7 +100,6 @@ prepend_path PATH "${pkg_install_dir}/bin"
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 CPATH "${pkg_install_dir}/include"
EOF
fi
filter_setup "${BUILDDIR}/setup_intelmpi" "${SETUPFILE}"

View file

@ -69,8 +69,6 @@ case "${with_mpich}" in
check_install ${pkg_install_dir}/bin/mpifort "mpich" && MPIFC="${pkg_install_dir}/bin/mpifort" || exit 1
MPIFORT="${MPIFC}"
MPIF77="${MPIFC}"
MPICH_CFLAGS="-I'${pkg_install_dir}/include'"
MPICH_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
;;
__SYSTEM__)
echo "==================== Finding MPICH from system paths ===================="
@ -87,8 +85,6 @@ case "${with_mpich}" in
check_lib -lmpifort "mpich"
check_lib -lmpicxx "mpich"
check_lib -lmpi "mpich"
add_include_from_paths MPICH_CFLAGS "mpi.h" ${INCLUDE_PATHS}
add_lib_from_paths MPICH_LDFLAGS "libmpi.*" ${LIB_PATHS}
;;
__DONTUSE__)
# Nothing to do
@ -105,8 +101,6 @@ case "${with_mpich}" in
check_command ${pkg_install_dir}/bin/mpifort "mpich" && MPIFC="${pkg_install_dir}/bin/mpifort" || exit 1
MPIFORT="${MPIFC}"
MPIF77="${MPIFC}"
MPICH_CFLAGS="-I'${pkg_install_dir}/include'"
MPICH_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
;;
esac
if [ "${with_mpich}" != "__DONTUSE__" ]; then
@ -115,7 +109,6 @@ if [ "${with_mpich}" != "__DONTUSE__" ]; then
else
mpi_bin="mpiexec"
fi
MPICH_LIBS="-lmpifort -lmpicxx -lmpi"
cat << EOF > "${BUILDDIR}/setup_mpich"
export MPI_MODE="${MPI_MODE}"
export MPIEXEC="${MPIEXEC}"
@ -124,21 +117,6 @@ export MPICXX="${MPICXX}"
export MPIFC="${MPIFC}"
export MPIFORT="${MPIFORT}"
export MPIF77="${MPIF77}"
export MPICH_CFLAGS="${MPICH_CFLAGS}"
export MPICH_LDFLAGS="${MPICH_LDFLAGS}"
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|)"
# 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}|)"
EOF
if [ "${with_mpich}" != "__SYSTEM__" ]; then
# Using append_path instead of prepend_path for compatibility with Shifter.
@ -148,7 +126,6 @@ append_path PATH "${pkg_install_dir}/bin"
append_path LD_LIBRARY_PATH "${pkg_install_dir}/lib"
append_path LD_RUN_PATH "${pkg_install_dir}/lib"
append_path LIBRARY_PATH "${pkg_install_dir}/lib"
append_path CPATH "${pkg_install_dir}/include"
prepend_path PKG_CONFIG_PATH "${pkg_install_dir}/lib/pkgconfig"
EOF
fi

View file

@ -69,8 +69,6 @@ case "${with_openmpi}" in
check_install ${pkg_install_dir}/bin/mpifort "openmpi" && MPIFC="${pkg_install_dir}/bin/mpifort" || exit 1
MPIFORT="${MPIFC}"
MPIF77="${MPIFC}"
OPENMPI_CFLAGS="-I'${pkg_install_dir}/include'"
OPENMPI_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
;;
__SYSTEM__)
echo "==================== Finding OpenMPI from system paths ===================="
@ -80,10 +78,6 @@ case "${with_openmpi}" in
check_command mpifort "openmpi" && MPIFC="$(command -v mpifort)" || exit 1
MPIFORT="${MPIFC}"
MPIF77="${MPIFC}"
# Fortran code in CP2K is built via the mpifort wrapper, but we may need additional
# libraries and linker flags for C/C++-based MPI codepaths, pull them in at this point.
OPENMPI_CFLAGS="$(mpicxx --showme:compile)"
OPENMPI_LDFLAGS="$(mpicxx --showme:link)"
;;
__DONTUSE__)
# Nothing to do
@ -100,30 +94,9 @@ case "${with_openmpi}" in
check_command ${pkg_install_dir}/bin/mpifort "openmpi" && MPIFC="${pkg_install_dir}/bin/mpifort" || exit 1
MPIFORT="${MPIFC}"
MPIF77="${MPIFC}"
OPENMPI_CFLAGS="-I'${pkg_install_dir}/include'"
OPENMPI_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
;;
esac
if [ "${with_openmpi}" != "__DONTUSE__" ]; then
if [ "${with_openmpi}" != "__SYSTEM__" ]; then
mpi_bin="${pkg_install_dir}/bin/mpiexec"
mpicxx_bin="${pkg_install_dir}/bin/mpicxx"
else
mpi_bin="mpiexec"
mpicxx_bin="mpicxx"
fi
# check openmpi version as reported by mpiexec
raw_version=$(${mpi_bin} --version 2>&1 |
grep "(Open MPI)" | awk '{print $4}')
major_version=$(echo ${raw_version} | cut -d '.' -f 1)
minor_version=$(echo ${raw_version} | cut -d '.' -f 2)
OPENMPI_LIBS=""
# grab additional runtime libs (for C/C++) from the mpicxx wrapper,
# and remove them from the LDFLAGS if present
for lib in $("${mpicxx_bin}" --showme:libs); do
OPENMPI_LIBS+=" -l${lib}"
OPENMPI_LDFLAGS="${OPENMPI_LDFLAGS//-l${lib}/}"
done
cat << EOF > "${BUILDDIR}/setup_openmpi"
export MPI_MODE="${MPI_MODE}"
export MPIEXEC="${MPIEXEC}"
@ -132,21 +105,6 @@ export MPICXX="${MPICXX}"
export MPIFC="${MPIFC}"
export MPIFORT="${MPIFORT}"
export MPIF77="${MPIF77}"
export OPENMPI_CFLAGS="${OPENMPI_CFLAGS}"
export OPENMPI_LDFLAGS="${OPENMPI_LDFLAGS}"
export OPENMPI_LIBS="${OPENMPI_LIBS}"
export MPI_CFLAGS="${OPENMPI_CFLAGS}"
export MPI_LDFLAGS="${OPENMPI_LDFLAGS}"
export MPI_LIBS="${OPENMPI_LIBS}"
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(${OPENMPI_CFLAGS}|)"
export CP_LDFLAGS="\${CP_LDFLAGS} IF_MPI(${OPENMPI_LDFLAGS}|)"
export CP_LIBS="\${CP_LIBS} IF_MPI(${OPENMPI_LIBS}|)"
EOF
if [ "${with_openmpi}" != "__SYSTEM__" ]; then
cat << EOF >> "${BUILDDIR}/setup_openmpi"
@ -154,7 +112,6 @@ prepend_path PATH "${pkg_install_dir}/bin"
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 CPATH "${pkg_install_dir}/include"
EOF
fi
filter_setup "${BUILDDIR}/setup_openmpi" "${SETUPFILE}"

View file

@ -46,7 +46,6 @@ if [ "$with_acml" != "__DONTUSE__" ]; then
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 CPATH "$pkg_install_dir/include"
EOF
filter_setup "${BUILDDIR}/setup_acml" "${SETUPFILE}"
fi

View file

@ -1,19 +1,18 @@
#!/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)"
gmp_ver="6.3.0"
gmp_sha256="e56fd59d76810932a0555aa15a14b61c16bed66110d3c75cc2ac49ddaa9ab24c"
# shellcheck disable=SC1091
source "${SCRIPT_DIR}"/common_vars.sh
# shellcheck disable=SC1091
source "${SCRIPT_DIR}"/tool_kit.sh
# shellcheck disable=SC1091
source "${SCRIPT_DIR}"/signal_trap.sh
# shellcheck disable=SC1091
source "${INSTALLDIR}"/toolchain.conf
# shellcheck disable=SC1091
source "${INSTALLDIR}"/toolchain.env
[ -f "${BUILDDIR}/setup_gmp" ] && rm "${BUILDDIR}/setup_gmp"
@ -48,52 +47,35 @@ case "$with_gmp" in
write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage2/$(basename "${SCRIPT_NAME}")"
cd ..
fi
GMP_CFLAGS="-I'${pkg_install_dir}/include'"
GMP_LDFLAGS="-L'${pkg_install_dir}/lib'"
;;
__SYSTEM__)
echo "==================== Finding GMP from system paths ===================="
check_lib -lgmp "gmp"
check_lib -lgmpxx "gmpxx"
add_include_from_paths GMP_CFLAGS "gmp.h" "$INCLUDE_PATHS"
add_lib_from_paths GSL_LDFLAGS "libgmp.*" "$LIB_PATHS"
add_lib_from_paths GSL_LDFLAGS "libgmpxx.*" "$LIB_PATHS"
pkg_install_dir="$(dirname $(dirname $(find_in_paths "libgmp.*" $LIB_PATHS)))"
;;
__DONTUSE__) ;;
*)
echo "==================== Linking GMP to user paths ===================="
pkg_install_dir="$with_gmp"
pkg_install_dir="${with_gmp}"
check_dir "${pkg_install_dir}/lib"
check_dir "${pkg_install_dir}/include"
GMP_CFLAGS="-I'${pkg_install_dir}/include'"
GMP_LDFLAGS="-L'${pkg_install_dir}/lib'"
;;
esac
if [ "$with_gmp" != "__DONTUSE__" ]; then
GMP_LIBS=" -lgmp -lgmpxx"
cat << EOF > "${BUILDDIR}/setup_gmp"
export GMP_VER="${gmp_ver}"
export GMP_ROOT="${pkg_install_dir}"
EOF
if [ "$with_gmp" != "__SYSTEM__" ]; then
cat << EOF >> "${BUILDDIR}/setup_gmp"
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 CPATH "$pkg_install_dir/include"
prepend_path CMAKE_PREFIX_PATH "$pkg_install_dir"
EOF
fi
# TODO : Is it necessary to have a separate feature for GMP, i.e -D__GMP during compilation?
cat << EOF >> "${BUILDDIR}/setup_gmp"
export GMP_CFLAGS="${GMP_CFLAGS}"
export GMP_LDFLAGS="${GMP_LDFLAGS}"
export GMP_LIBS="${GMP_LIBS}"
export CP_CFLAGS="\${CP_CFLAGS} ${GMP_CFLAGS}"
export CP_LDFLAGS="\${CP_LDFLAGS} ${GMP_LDFLAGS}"
export CP_LIBS="${GMP_LIBS} \${CP_LIBS}"
export GMP_ROOT="${pkg_install_dir}"
EOF
filter_setup "${BUILDDIR}/setup_gmp" "${SETUPFILE}"
fi

View file

@ -39,10 +39,6 @@ case "$MATH_MODE" in
;;
esac
export CP_CFLAGS="${CP_CFLAGS} ${MATH_CFLAGS}"
export CP_LDFLAGS="${CP_LDFLAGS} ${MATH_LDFLAGS}"
export CP_LIBS="${CP_LIBS} ${MATH_LIBS}"
write_toolchain_env "${INSTALLDIR}"
#EOF

View file

@ -109,16 +109,12 @@ export MKL_CFLAGS="${MKL_CFLAGS}"
export MKL_LIBS="${MKL_LIBS}"
export MATH_CFLAGS="\${MATH_CFLAGS} ${MKL_CFLAGS}"
export MATH_LIBS="\${MATH_LIBS} ${MKL_LIBS}"
export CP_DFLAGS="\${CP_DFLAGS} -D__MKL"
EOF
if [ "${MKL_FFTW}" = "yes" ]; then
cat << EOF >> "${BUILDDIR}/setup_mkl"
export FFTW3_INCLUDES="${MKL_CFLAGS}"
export FFTW3_INCLUDES="-I${MKLROOT}/include/fftw"
export FFTW3_LIBS="${MKL_LIBS}"
export FFTW_CFLAGS="${MKL_CFLAGS}"
export FFTW_LDFLAGS="${MKL_LDFLAGS}"
export FFTW_LIBS="${MKL_LIBS}"
export CP_DFLAGS="\${CP_DFLAGS} -D__FFTW3 IF_COVERAGE(IF_MPI(|-U__FFTW3)|)"
EOF
fi
filter_setup "${BUILDDIR}/setup_mkl" "${SETUPFILE}"

View file

@ -25,7 +25,7 @@ case "${with_openblas}" in
__INSTALL__)
echo "==================== Installing OpenBLAS ===================="
pkg_install_dir="${INSTALLDIR}/openblas-${openblas_ver}"
install_lock_file="$pkg_install_dir/install_successful"
install_lock_file="${pkg_install_dir}/install_successful"
if verify_checksums "${install_lock_file}"; then
echo "openblas-${openblas_ver} is already installed, skipping it."
else
@ -110,7 +110,7 @@ case "${with_openblas}" in
if [[ "${pkg_install_dir}" == "/usr/lib"* ]]; then
pkg_install_dir="/usr"
else
INCLUDE_PATHS=${INCLUDE_PATHS}:"$pkg_install_dir/include"
INCLUDE_PATHS=${INCLUDE_PATHS}:"${pkg_install_dir}/include"
fi
add_include_from_paths OPENBLAS_CFLAGS "openblas_config.h" $INCLUDE_PATHS
add_lib_from_paths OPENBLAS_LDFLAGS "libopenblas.*" $LIB_PATHS
@ -123,8 +123,8 @@ case "${with_openblas}" in
pkg_install_dir="$with_openblas"
check_dir "${pkg_install_dir}/include"
check_dir "${pkg_install_dir}/lib"
OPENBLAS_CFLAGS="-I'${pkg_install_dir}/include'"
OPENBLAS_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'"
OPENBLAS_CFLAGS="-I${pkg_install_dir}/include"
OPENBLAS_LDFLAGS="-L${pkg_install_dir}/lib -Wl,-rpath,${pkg_install_dir}/lib"
OPENBLAS_LIBS="-lopenblas"
# detect separate omp builds
(__libdir="${pkg_install_dir}/lib" LIB_PATHS="__libdir" check_lib -lopenblas_openmp 2> /dev/null) &&
@ -136,10 +136,10 @@ esac
if [ "$with_openblas" != "__DONTUSE__" ]; then
if [ "$with_openblas" != "__SYSTEM__" ]; then
cat << EOF > "${BUILDDIR}/setup_openblas"
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 CPATH "$pkg_install_dir/include"
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 CPATH "${pkg_install_dir}/include"
EOF
fi
cat << EOF >> "${BUILDDIR}/setup_openblas"

View file

@ -23,7 +23,6 @@ cd "${BUILDDIR}"
case "$with_fftw" in
__INSTALL__)
require_env MPI_LIBS
echo "==================== Installing FFTW ===================="
pkg_install_dir="${INSTALLDIR}/fftw-${fftw_ver}"
install_lock_file="$pkg_install_dir/install_successful"

View file

@ -60,10 +60,6 @@ case "$with_ace" in
;;
__SYSTEM__)
echo "==================== Finding Ace from system paths ===================="
# check_lib -lace "ACE"
# add_lib_from_paths ACE_LDFLAGS "libpace*" $LIB_PATHS
# add_include_from_paths ACE_CFLAGS "ace" $INCLUDE_PATHS
# ACE_DFLAGS="-D__ACE"
report_error "The system detection of Ace is not supported; please use \"--with-ace=install\"."
;;
__DONTUSE__) ;;

View file

@ -742,5 +742,5 @@ filter_setup() {
local filename=$(basename "$source_file")
echo "# ==================== Setup for ${filename#*_} ==================== #" >> "$target_file"
sed '/if[[:space:]]/,/^[[:space:]]*fi$/d' "$source_file" | grep -v -E '# For|# Other|CPATH|FLAGS|CP_LIBS' >> "$target_file"
grep -v -E 'CPATH|FLAGS|_LIBS|_INCLUDES' "$source_file" >> "$target_file"
}