Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions init/modules/EESSI/2023.06.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,34 @@ conflict("EESSI")
-- this is a version-agnostic module file, works for EESSI/2023.06, EESSI/2025.06, etc.
local eessi_version = myModuleVersion()
local eessi_repo = "/cvmfs/software.eessi.io"
if (subprocess("uname -m"):gsub("\n$","") == "riscv64") then
eessi_version = os.getenv("EESSI_VERSION_OVERRIDE") or "20240402"
eessi_repo = "/cvmfs/riscv.eessi.io"
LmodMessage("RISC-V architecture detected, but there is no RISC-V support yet in the production repository.\n" ..
"Automatically switching to version " .. eessi_version .. " of the RISC-V development repository " .. eessi_repo .. ".\n" ..
"For more details about this repository, see https://www.eessi.io/docs/repositories/riscv.eessi.io/.")
end
local eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version)
local eessi_archdetect_prefix = pathJoin(eessi_prefix, "init")
local eessi_os_type = "linux"
-- for RISC-V clients we need to do some overrides, as things are stored in different CVMFS repositories
if (subprocess("uname -m"):gsub("\n$","") == "riscv64") then
if (eessi_version == "2023.06" or eessi_version == "20240402") then
eessi_version = os.getenv("EESSI_VERSION_OVERRIDE") or "20240402"
eessi_repo = "/cvmfs/riscv.eessi.io"
eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version)
if mode() == "load" then
LmodMessage("RISC-V architecture detected, but there is no RISC-V support yet in the production repository.\n" ..
"Automatically switching to version " .. eessi_version .. " of the RISC-V development repository " .. eessi_repo .. ".\n" ..
"For more details about this repository, see https://www.eessi.io/docs/repositories/riscv.eessi.io/.")
end
elseif (eessi_version == "2025.06") then
eessi_repo = "/cvmfs/dev.eessi.io/riscv"
eessi_version = os.getenv("EESSI_VERSION_OVERRIDE") or eessi_version
eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version)
if mode() == "load" then
LmodMessage("This EESSI production version only provides a RISC-V compatibility layer,\n" ..
"software installations are provided by the EESSI development repository at " .. eessi_repo .. ".\n")
end
if not isDir(eessi_repo) then
LmodError("The EESSI development repository dev.eessi.io is not mounted on your system.\n" ..
"This is required for RISC-V systems.")
end
end
end
setenv("EESSI_VERSION_DEFAULT", eessi_version)
setenv("EESSI_VERSION", eessi_version)
setenv("EESSI_CVMFS_REPO", eessi_repo)
Expand All @@ -32,7 +51,7 @@ function eessiDebug(text)
end
end
function archdetect_cpu()
local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper.sh')
local script = pathJoin(eessi_archdetect_prefix, 'lmod_eessi_archdetect_wrapper.sh')
-- make sure that we grab the value for architecture before the module unsets the environment variable (in unload mode)
local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or (os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") or "")
if not os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") then
Expand Down Expand Up @@ -62,7 +81,7 @@ function archdetect_cpu()
end
end
function archdetect_accel()
local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper_accel.sh')
local script = pathJoin(eessi_archdetect_prefix, 'lmod_eessi_archdetect_wrapper_accel.sh')
-- for unload mode, we need to grab the value before it is unset
local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or (os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE") or "")
if not os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE") then
Expand Down