Skip to content
Snippets Groups Projects
Commit a62b2ce1 authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

fix: generate_modules.sh for non-apptainer builds

Change-Id: I8bef8290fd95908d16630e8239830d26c3b01b2d
parent ab2102dc
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ source "${PATH_MODULES}/\$(readlink -f /proc/\$\$/exe | xargs -r basename)" ...@@ -33,7 +33,7 @@ source "${PATH_MODULES}/\$(readlink -f /proc/\$\$/exe | xargs -r basename)"
EOF EOF
# Provide MODULESHOME for all singularity environments # Provide MODULESHOME for all singularity environments
cat <<EOF >> ${SINGULARITY_ENVIRONMENT} cat <<EOF >> ${SINGULARITY_ENVIRONMENT:-/environment.sh}
MODULESHOME=${MODULESHOME} MODULESHOME=${MODULESHOME}
export MODULESHOME export MODULESHOME
EOF EOF
...@@ -42,9 +42,11 @@ EOF ...@@ -42,9 +42,11 @@ EOF
# to use after sourcing /opt/init/modules.sh # to use after sourcing /opt/init/modules.sh
( (
IFS=$'\n' IFS=$'\n'
if [ -d "/opt/spack/share/spack/modules" ]; then
for moduledir in $(find /opt/spack/share/spack/modules -mindepth 1 -maxdepth 1 -type d); do for moduledir in $(find /opt/spack/share/spack/modules -mindepth 1 -maxdepth 1 -type d); do
cat <<EOF >> "${TARGET}" cat <<EOF >> "${TARGET}"
export MODULEPATH="${moduledir}\${MODULEPATH:+:\${MODULEPATH}}" export MODULEPATH="${moduledir}\${MODULEPATH:+:\${MODULEPATH}}"
EOF EOF
done done
fi
) )
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment