Fix elpa pkg-config file when CUDA is used

This commit is contained in:
Matthias Krack 2026-02-15 07:31:18 +01:00
parent 9ea93394cc
commit 8000e662f5

View file

@ -789,6 +789,14 @@ if [[ ! -d "${SPACK_BUILD_PATH}" ]]; then
${EXIT_CMD} 1
fi
# Fix Libs list in elpa pkg-config file when CUDA is used
if ((CUDA_ARCH > 0)); then
ELPA_PKG_CONFIG_FILE="$(find -L "${SPACK_ROOT}/opt/spack/view" -name "elpa*.pc")"
if [[ -f "${ELPA_PKG_CONFIG_FILE}" ]]; then
sed -E -e 's|Libs: |Libs: -L/usr/local/cuda/lib64 |' -i "${ELPA_PKG_CONFIG_FILE}"
fi
fi
# Return from spack folder after all installations are done
cd "${CP2K_ROOT}" || ${EXIT_CMD} 1