Skip to content

Commit 3dfe565

Browse files
author
Caspar van Leeuwen
committed
Fix chicken and egg problem where EESSI_ACCELERATOR_TARGET is not set by the EESSI module, unless the installation directory already exists.
1 parent 0ab005b commit 3dfe565

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

EESSI-install-software.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@ else
150150
# make sure the the software and modules directory exist
151151
# (since it's expected by init/eessi_environment_variables when using archdetect and by the EESSI module)
152152
mkdir -p ${EESSI_PREFIX}/software/${EESSI_OS_TYPE}/${EESSI_SOFTWARE_SUBDIR_OVERRIDE}/{modules,software}
153+
154+
# If EESSI_ACCELERATOR_TARGET_OVERRIDE is defined, we are building for an accelerator target
155+
# In that case, make sure the modulepath for the accelerator subdir exists, otherwise the EESSI module will not
156+
# set EESSI_ACCELERATOR_TARGET and the if-condition later in this script which checks if EESSI_ACCELERATOR_TARGET
157+
# is equal to EESSI_ACCELERATOR_TARGET_OVERRIDE will fail
158+
# See https://github.com/EESSI/software-layer-scripts/pull/59#issuecomment-3173593882
159+
if [ -z $EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE ]; then
160+
mkdir -p ${EESSI_PREFIX}/software/${EESSI_OS_TYPE}/${EESSI_SOFTWARE_SUBDIR_OVERRIDE}/${EESSI_ACCELERATOR_TARGET_OVERRIDE}/modules/all
161+
else
162+
# At runtime, one might want to use a different CPU subdir for a given accelerator. E.g. one could use
163+
# a zen2 CPU subdir on a zen4 node if the required GPU software isn't available in the zen4 tree.
164+
# At build time, this doesn't make a lot of sense: we'd probably build in a CPU prefix that is different
165+
# from what the code will be optimized for, and we wouldn't want that
166+
msg="When building the software subdirectory for the CPU should almost certainly be that of the host."
167+
msg="$msg If you think this is incorrect, please implement behaviour that makes sense in "
168+
msg="$msg EESSI-software-installation.sh, essentially replacing this error."
169+
fatal_error "$msg"
170+
fi
153171
)
154172
fi
155173

0 commit comments

Comments
 (0)