diff --git a/platforms/common/spack_utils.sh b/platforms/common/spack_utils.sh index 0c5e4eb98d352743207d747881db745d7da1c4e9..fd32c0db87cf33923f1ec3f7c209d5125f2e3367 100644 --- a/platforms/common/spack_utils.sh +++ b/platforms/common/spack_utils.sh @@ -1,5 +1,11 @@ function _install_spack() { if [ ! -e ${SPACK_ROOT} ]; then + if ! command -v git &> /dev/null + then + echo "git could not be found ... will try to load it form the module system ..." + module load git || echo "could not load git from module system" + fi + echo "Cloning to ${SPACK_ROOT}" git clone --depth 1 ${SPACK_URL} -b ${SPACK_BRANCH} ${SPACK_ROOT} fi diff --git a/templates/common/build_icon.sh b/templates/common/build_icon.sh index ce8c79927fdd37bbe191d05351a681df7c52d4f2..8a5f415616d7ce01ed6afc347bd216704f11aac4 100644 --- a/templates/common/build_icon.sh +++ b/templates/common/build_icon.sh @@ -4,6 +4,9 @@ WORKDIR=%HPCROOTDIR% ICON_VERSION=%ICON.VERSION% COMPILER=%SPACK.COMPILER% +MODULES="%MODULES%" +if [ ! -z "${MODULES}" ]; then module load ${MODULES}; fi + # If the workdir directory does not exist create it if [ ! -d ${WORKDIR} ]; then mkdir -p ${WORKDIR} diff --git a/templates/common/build_python_environment.sh b/templates/common/build_python_environment.sh index e671ea8b7442105ba20c4719acbdc6855d55ded7..d5450648baf2e78af0113bcf9d246b252b6cce59 100644 --- a/templates/common/build_python_environment.sh +++ b/templates/common/build_python_environment.sh @@ -7,6 +7,10 @@ SPACK_BRANCH=%SPACK.BRANCH% SPACK_COMPILER=%SPACK.COMPILER% PYTHON_VERSION=%PYTHON_ENVIRONMENT.PYTHON_VERSION% + +MODULES="%MODULES%" +if [ ! -z "${MODULES}" ]; then module load ${MODULES}; fi + # Go to the working directory cd ${WORKDIR}