From 78fbc1e86412379e382e473f36bf7ae98b1613e2 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 18 Sep 2024 22:17:47 +0200 Subject: [PATCH] make sure removal script also takes software prefix into account --- EESSI-remove-software.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/EESSI-remove-software.sh b/EESSI-remove-software.sh index 446a156cb8..e435dd8088 100755 --- a/EESSI-remove-software.sh +++ b/EESSI-remove-software.sh @@ -79,6 +79,17 @@ echo ">> Setting up \$MODULEPATH..." module --force purge # ignore current $MODULEPATH entirely module unuse $MODULEPATH + +# if an accelerator target is specified, we need to make sure that the CPU-only modules are also still available +if [ ! -z ${EESSI_ACCELERATOR_TARGET} ]; then + CPU_ONLY_MODULES_PATH=$(echo $EASYBUILD_INSTALLPATH | sed "s@/accel/${EESSI_ACCELERATOR_TARGET}@@g")/modules/all + if [ -d ${CPU_ONLY_MODULES_PATH} ]; then + module use ${CPU_ONLY_MODULES_PATH} + else + fatal_error "Derived path to CPU-only modules does not exist: ${CPU_ONLY_MODULES_PATH}" + fi +fi + module use $EASYBUILD_INSTALLPATH/modules/all if [[ -z ${MODULEPATH} ]]; then fatal_error "Failed to set up \$MODULEPATH?!"