Skip to content

Commit 0c6bf77

Browse files
authored
Merge pull request #93 from bedroge/add_eessi_init_prefix_variable
introduce variable `$EESSI_INIT_PREFIX` for overriding location of `init` directory
2 parents 6ce874b + 2ae6dab commit 0c6bf77

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

EESSI-extend-easybuild.eb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ end
176176
setenv ("EASYBUILD_SYSROOT", sysroot)
177177
setenv ("EASYBUILD_PREFIX", pathJoin(working_dir, "easybuild"))
178178
setenv ("EASYBUILD_INSTALLPATH", easybuild_installpath)
179-
setenv ("EASYBUILD_HOOKS", pathJoin(os.getenv("EESSI_PREFIX"), "init", "easybuild", "eb_hooks.py"))
179+
eessi_init_prefix = os.getenv("EESSI_INIT_PREFIX") or pathJoin(os.getenv("EESSI_PREFIX"), "init")
180+
setenv ("EASYBUILD_HOOKS", pathJoin(eessi_init_prefix, "easybuild", "eb_hooks.py"))
180181
181182
-- Make sure to use the general umask that allows a global read
182183
setenv ("EASYBUILD_UMASK", "022")

init/eessi_defaults

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,32 @@
1010

1111
export EESSI_VERSION_DEFAULT='__EESSI_VERSION_DEFAULT__'
1212

13-
# use different defaults for RISC-V, as we want to redirect to the riscv.eessi.io repo
13+
# use different defaults for RISC-V clients
1414
if [[ $(uname -m) == "riscv64" ]]; then
15-
export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/riscv.eessi.io}"
16-
export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=20240402}"
17-
if [[ -z ${EESSI_SILENT+x} ]]; then
18-
echo "RISC-V architecture detected, but there is no RISC-V support yet in the production repository."
19-
echo "Automatically switching to version ${EESSI_VERSION} of the RISC-V development repository ${EESSI_CVMFS_REPO}."
20-
echo "For more details about this repository, see https://www.eessi.io/docs/repositories/riscv.eessi.io/."
21-
echo ""
15+
export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:-${EESSI_VERSION_DEFAULT}}"
16+
if [[ "${EESSI_VERSION}" == "2023.06" ]] || [[ "${EESSI_VERSION}" == "20240402" ]]; then
17+
export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=20240402}"
18+
export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/riscv.eessi.io}"
19+
export EESSI_INIT_PREFIX="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init"
20+
if [[ -z ${EESSI_SILENT+x} ]]; then
21+
echo "RISC-V architecture detected, but there is no RISC-V support yet in the production repository."
22+
echo "Automatically switching to version ${EESSI_VERSION} of the RISC-V development repository ${EESSI_CVMFS_REPO}."
23+
echo "For more details about this repository, see https://www.eessi.io/docs/repositories/riscv.eessi.io/."
24+
echo ""
25+
fi
26+
elif [[ "${EESSI_VERSION_DEFAULT}" == "2025.06" ]]; then
27+
export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/dev.eessi.io/riscv}"
28+
export EESSI_COMPAT_LAYER_DIR="/cvmfs/software.eessi.io/versions/${EESSI_VERSION_DEFAULT}/compat/linux/$(uname -m)"
29+
export EESSI_INIT_PREFIX="/cvmfs/software.eessi.io/versions/${EESSI_VERSION_DEFAULT}/init"
30+
if [[ -z ${EESSI_SILENT+x} ]]; then
31+
echo "This EESSI production version only provides a RISC-V compatibility layer,"
32+
echo "software installations are provided by the EESSI development repository at ${EESSI_CVMFS_REPO}."
33+
fi
2234
fi
2335
else
2436
export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/software.eessi.io}"
2537
export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=${EESSI_VERSION_DEFAULT}}"
38+
export EESSI_INIT_PREFIX="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init"
2639
fi
2740
# use archdetect by default, unless otherwise specified
2841
export EESSI_USE_ARCHDETECT="${EESSI_USE_ARCHDETECT:=1}"

init/modules/EESSI/2023.06.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ local eessi_version = myModuleVersion()
1515
local eessi_repo = "/cvmfs/software.eessi.io"
1616
local eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version)
1717
local eessi_compat_prefix = pathJoin(eessi_prefix, "compat")
18-
local eessi_archdetect_prefix = pathJoin(eessi_prefix, "init")
18+
local eessi_init_prefix = pathJoin(eessi_prefix, "init")
1919
local eessi_os_type = "linux"
2020
-- for RISC-V clients we need to do some overrides, as things are stored in different CVMFS repositories
2121
if (subprocess("uname -m"):gsub("\n$","") == "riscv64") then
@@ -53,7 +53,7 @@ function eessiDebug(text)
5353
end
5454
end
5555
function archdetect_cpu()
56-
local script = pathJoin(eessi_archdetect_prefix, 'lmod_eessi_archdetect_wrapper.sh')
56+
local script = pathJoin(eessi_init_prefix, 'lmod_eessi_archdetect_wrapper.sh')
5757
-- make sure that we grab the value for architecture before the module unsets the environment variable (in unload mode)
5858
local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or (os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") or "")
5959
if not os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") then
@@ -83,7 +83,7 @@ function archdetect_cpu()
8383
end
8484
end
8585
function archdetect_accel()
86-
local script = pathJoin(eessi_archdetect_prefix, 'lmod_eessi_archdetect_wrapper_accel.sh')
86+
local script = pathJoin(eessi_init_prefix, 'lmod_eessi_archdetect_wrapper_accel.sh')
8787
-- for unload mode, we need to grab the value before it is unset
8888
local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or (os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE") or "")
8989
if not os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE") then
@@ -131,6 +131,8 @@ setenv("EESSI_SOFTWARE_SUBDIR", eessi_software_subdir)
131131
eessiDebug("Setting EESSI_SOFTWARE_SUBDIR to " .. eessi_software_subdir)
132132
setenv("EESSI_PREFIX", eessi_prefix)
133133
eessiDebug("Setting EESSI_PREFIX to " .. eessi_prefix)
134+
setenv("EESSI_INIT_PREFIX", eessi_init_prefix)
135+
eessiDebug("Setting EESSI_INIT_PREFIX to " .. eessi_init_prefix)
134136
setenv("EESSI_EPREFIX", eessi_eprefix)
135137
eessiDebug("Setting EPREFIX to " .. eessi_eprefix)
136138
prepend_path("PATH", pathJoin(eessi_eprefix, "bin"))

run_in_compat_layer_env.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ fi
5656
if [ ! -z ${EASYBUILD_ROBOT_PATHS} ]; then
5757
INPUT="export EASYBUILD_ROBOT_PATHS=${EASYBUILD_ROBOT_PATHS}; ${INPUT}"
5858
fi
59+
if [ ! -z ${EESSI_INIT_PREFIX} ]; then
60+
INPUT="export EESSI_INIT_PREFIX=${EESSI_INIT_PREFIX}; ${INPUT}"
61+
fi
5962

6063
echo "Running '${INPUT}' in EESSI (${EESSI_CVMFS_REPO}) ${EESSI_VERSION} compatibility layer environment..."
6164
${EESSI_COMPAT_LAYER_DIR}/startprefix <<< "${INPUT}"

0 commit comments

Comments
 (0)