diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index b365edd71b..50eacc52bf 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -248,6 +248,10 @@ fi temp_install_storage=${TMPDIR}/temp_install_storage mkdir -p ${temp_install_storage} if [ -z "${skip_cuda_install}" ] || [ ! "${skip_cuda_install}" ]; then + # need to ensure that some variables will be available to the script + # TMPDIR, EB, EESSI_VERSION, for EASYBUILD_INSTALLPATH (EESSI_PREFIX, + # EESSI_OS_TYPE, EESSI_SOFTWARE_SUBDIR_OVERRIDE) + export TMPDIR EB EESSI_VERSION EESSI_PREFIX EESSI_OS_TYPE EESSI_SOFTWARE_SUBDIR_OVERRIDE ${EESSI_PREFIX}/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh \ -t ${temp_install_storage} \ --accept-cuda-eula \ diff --git a/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh b/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh index e6343595ad..51d139bec5 100755 --- a/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh +++ b/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh @@ -112,7 +112,14 @@ for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do unset EESSI_USER_INSTALL export EESSI_SITE_INSTALL=1 module unload EESSI-extend - module load EESSI-extend/${EESSI_VERSION}-easybuild + + # The EESSI-extend module is being loaded (or installed if it doesn't exist yet). + # The script requires the EESSI_VERSION given as argument, a couple of + # environment variables set (TMPDIR, EB and EASYBUILD_INSTALLPATH) and the + # function check_exit_code defined. + # NOTE, the script exits if those variables/functions are undefined. + export EASYBUILD_INSTALLPATH=${EESSI_PREFIX}/software/${EESSI_OS_TYPE}/${EESSI_SOFTWARE_SUBDIR_OVERRIDE} + source load_eessi_extend_module.sh ${EESSI_VERSION} # Install modules in hidden .modules dir to keep track of what was installed before # (this action is temporary, and we do not call Lmod again within the current shell context, but in EasyBuild