From 9eebad7be3b3cbc1bd3b14a8614a13cc79c25f82 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Wed, 13 Nov 2024 22:55:27 +0100 Subject: [PATCH] source configure_easybuild and run in subshell --- load_eessi_extend_module.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/load_eessi_extend_module.sh b/load_eessi_extend_module.sh index 1ab50daba0..9d13f313f3 100755 --- a/load_eessi_extend_module.sh +++ b/load_eessi_extend_module.sh @@ -80,20 +80,20 @@ else ORIG_PATH=${PATH} ORIG_PYTHONPATH=${PYTHONPATH} - echo ">> Final installation in ${EASYBUILD_INSTALLPATH}..." - ls -lisa ${EASYBUILD_INSTALLPATH} - ls -lisaR ${EASYBUILD_INSTALLPATH}/software/EESSI-extend - whoami - - export PATH=${EB_TMPDIR}/bin:${PATH} - export PYTHONPATH=$(ls -d ${EB_TMPDIR}/lib/python*/site-packages):${PYTHONPATH} - eb_install_out=${TMPDIR}/eb_install.out - ok_msg="EESSI-extend/${EESSI_EXTEND_VERSION} installed, let's go!" - fail_msg="Installing EESSI-extend/${EESSI_EXTEND_VERSION} failed, that's not good... (output: ${eb_install_out})" - ${EB} "EESSI-extend-${EESSI_EXTEND_VERSION}.eb" 2>&1 | tee ${eb_install_out} - ec=$? - ls -lisaR ${EASYBUILD_INSTALLPATH}/software/EESSI-extend - check_exit_code $ec "${ok_msg}" "${fail_msg}" + # source configure_easybuild to use correct eb settings + ( + EESSI_MAIN_DIR=$(dirname $(readlink -f $BASH_SOURCE)) + source ${EESSI_MAIN_DIR}/configure_easybuild + + echo ">> Final installation in ${EASYBUILD_INSTALLPATH}..." + export PATH=${EB_TMPDIR}/bin:${PATH} + export PYTHONPATH=$(ls -d ${EB_TMPDIR}/lib/python*/site-packages):${PYTHONPATH} + eb_install_out=${TMPDIR}/eb_install.out + ok_msg="EESSI-extend/${EESSI_EXTEND_VERSION} installed, let's go!" + fail_msg="Installing EESSI-extend/${EESSI_EXTEND_VERSION} failed, that's not good... (output: ${eb_install_out})" + ${EB} "EESSI-extend-${EESSI_EXTEND_VERSION}.eb" 2>&1 | tee ${eb_install_out} + check_exit_code $? "${ok_msg}" "${fail_msg}" + ) # restore origin $PATH and $PYTHONPATH values, and clean up environment variables that are no longer needed export PATH=${ORIG_PATH}