@@ -115,10 +115,6 @@ case "$with_elpa" in
115115 [ " $TARGET " = " nvidia" ] && [ " $gpu_enabled " != " __TRUE__" ] && continue
116116 # disable cpu if cuda is enabled, only install one
117117 [ " $TARGET " != " nvidia" ] && [ " $gpu_enabled " = " __TRUE__" ] && continue
118- # extend the pkg_install_dir by TARGET
119- # this linking method is totally different from cp2k toolchain
120- # for cp2k, ref https://github.com/cp2k/cp2k/commit/6fe2fc105b8cded84256248f68c74139dd8fc2e9
121- pkg_install_dir=" ${pkg_install_dir} /${TARGET} "
122118
123119 echo " Installing from scratch into ${pkg_install_dir} "
124120 mkdir -p " build_${TARGET} "
@@ -246,17 +242,28 @@ prepend_path CPATH "$elpa_include"
246242EOF
247243 if [ " $with_elpa " != " __SYSTEM__" ]; then
248244 cat << EOF >> "${BUILDDIR} /setup_elpa"
249- prepend_path PATH "${pkg_install_dir} /bin"
250- prepend_path LD_LIBRARY_PATH "${pkg_install_dir} /lib"
251- prepend_path CPATH "${pkg_install_dir} /include"
252- prepend_path LD_RUN_PATH "${pkg_install_dir} /lib"
253- prepend_path LIBRARY_PATH "${pkg_install_dir} /lib"
254- prepend_path PKG_CONFIG_PATH "${pkg_install_dir} /lib/pkgconfig"
255- prepend_path CMAKE_PREFIX_PATH "${pkg_install_dir} "
245+ prepend_path PATH "${pkg_install_dir} /cpu/bin"
246+ prepend_path LD_LIBRARY_PATH "${pkg_install_dir} /cpu/lib"
247+ prepend_path LD_RUN_PATH "${pkg_install_dir} /cpu/lib"
248+ prepend_path LIBRARY_PATH "${pkg_install_dir} /cpu/lib"
249+ prepend_path PKG_CONFIG_PATH "${pkg_install_dir} /cpu/lib/pkgconfig"
250+ prepend_path CMAKE_PREFIX_PATH "${pkg_install_dir} /cpu"
251+ prepend_path CPATH "${elpa_include} "
252+ export ELPA_ROOT="${pkg_install_dir} /cpu"
256253EOF
254+ if [ -d ${pkg_install_dir} /nvidia ]; then
255+ cat << EOF >> "${BUILDDIR} /setup_elpa"
256+ prepend_path PATH "${pkg_install_dir} /nvidia/bin"
257+ prepend_path LD_LIBRARY_PATH "${pkg_install_dir} /nvidia/lib"
258+ prepend_path LD_RUN_PATH "${pkg_install_dir} /nvidia/lib"
259+ prepend_path LIBRARY_PATH "${pkg_install_dir} /nvidia/lib"
260+ prepend_path PKG_CONFIG_PATH "${pkg_install_dir} /nvidia/lib/pkgconfig"
261+ prepend_path CMAKE_PREFIX_PATH "${pkg_install_dir} /nvidia"
262+ export ELPA_NVIDIA_ROOT="${pkg_install_dir} /nvidia"
263+ EOF
264+ fi
257265 fi
258266 cat << EOF >> "${BUILDDIR} /setup_elpa"
259- export ELPA_ROOT="${pkg_install_dir} "
260267export ELPA_CFLAGS="${ELPA_CFLAGS} "
261268export ELPA_LDFLAGS="${ELPA_LDFLAGS} "
262269export ELPA_LIBS="${ELPA_LIBS} "
0 commit comments