@@ -112,14 +112,19 @@ for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do
112112 unset EESSI_USER_INSTALL
113113 export EESSI_SITE_INSTALL=1
114114 module unload EESSI-extend
115-
116- # The EESSI-extend module is being loaded (or installed if it doesn't exist yet).
117- # The script requires the EESSI_VERSION given as argument, a couple of
118- # environment variables set (TMPDIR, EB and EASYBUILD_INSTALLPATH) and the
119- # function check_exit_code defined.
120- # NOTE, the script exits if those variables/functions are undefined.
121- export EASYBUILD_INSTALLPATH=${EESSI_PREFIX} /software/${EESSI_OS_TYPE} /${EESSI_SOFTWARE_SUBDIR_OVERRIDE}
122- source load_eessi_extend_module.sh ${EESSI_VERSION}
115+ ml_av_eessi_extend_out=${tmpdir} /ml_av_eessi_extend.out
116+ # need to use --ignore_cache to avoid the case that the module was removed (to be
117+ # rebuilt) but it is still in the cache and the rebuild failed
118+ EESSI_EXTEND_VERSION=${EESSI_VERSION} -easybuild
119+ module --ignore_cache avail 2>&1 | grep -i EESSI-extend/${EESSI_EXTEND_VERSION} & > ${ml_av_eessi_extend_out}
120+ if [[ $? -eq 0 ]]; then
121+ echo_green " >> Module for EESSI-extend/${EESSI_EXTEND_VERSION} found!"
122+ else
123+ error=" \nNo module for EESSI-extend/${EESSI_EXTEND_VERSION} found\nwhile EESSI has been initialised to use software under ${EESSI_SOFTWARE_PATH} \n"
124+ fatal_error " ${error} "
125+ fi
126+ module --ignore_cache load EESSI-extend/${EESSI_EXTEND_VERSION}
127+ unset EESSI_EXTEND_VERSION
123128
124129 # Install modules in hidden .modules dir to keep track of what was installed before
125130 # (this action is temporary, and we do not call Lmod again within the current shell context, but in EasyBuild
0 commit comments