forked from EESSI/software-layer-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsh
More file actions
95 lines (85 loc) · 3.84 KB
/
csh
File metadata and controls
95 lines (85 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env csh
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2020-2026 EESSI contributors
#
# EESSI - European Environment for Scientific Software Installations
#
# This file is a template for initialising EESSI via Lmod for the environment indicated by the shebang.
#
# Please refer to the reference bash implementation for full documentation, only minimal comments are included here
# Choose an EESSI CVMFS repository
if ( ! $?EESSI_CVMFS_REPO) then
set EESSI_CVMFS_REPO = "/cvmfs/software.eessi.io"
endif
# Choose an EESSI version (default is used if EESSI_VERSION is not provided)
if ( ! $?__EESSI_VERSION_USED_FOR_INIT ) then
set EESSI_VERSION_DEFAULT = "__EESSI_VERSION_DEFAULT__"
else
set EESSI_VERSION_DEFAULT = "$__EESSI_VERSION_USED_FOR_INIT"
endif
if ( ! $?__Init_EESSI_Default_Modules ) then
if ( $?EESSI_VERSION ) then
# keep existing value
else
set EESSI_VERSION "$EESSI_VERSION_DEFAULT"
endif
else
# If we have already initialised and this is being called again,
# then we must want the specific version
set EESSI_VERSION "__EESSI_VERSION_DEFAULT__"
endif
# On first run, record the EESSI version used for init as an environment variable.
# We use setenv to ensure it is available to child processes (equivalent to export).
if ( ! $?__EESSI_VERSION_USED_FOR_INIT ) then
setenv __EESSI_VERSION_USED_FOR_INIT "$EESSI_VERSION"
endif
# ability to predefine elsewhere the default list (with options to append or prepend)
set LMOD_SYSTEM_DEFAULT_MODULES = "EESSI/${EESSI_VERSION}"
if ( $?EESSI_DEFAULT_MODULES_PREPEND ) then
set LMOD_SYSTEM_DEFAULT_MODULES = "${EESSI_DEFAULT_MODULES_PREPEND}:${LMOD_SYSTEM_DEFAULT_MODULES}"
endif
if ( $?EESSI_DEFAULT_MODULES_APPEND ) then
set LMOD_SYSTEM_DEFAULT_MODULES = "${LMOD_SYSTEM_DEFAULT_MODULES}:${EESSI_DEFAULT_MODULES_APPEND}"
endif
setenv LMOD_SYSTEM_DEFAULT_MODULES "${LMOD_SYSTEM_DEFAULT_MODULES}"
if ( ! $?__Init_EESSI_Default_Modules ) then
setenv __Init_EESSI_Default_Modules 1
# Lmod version in 2023.06 has a problem with newer Lmod caches, so let's stick to more recent Lmod
# (has no effect except on Lmod itself, and compatible caches are still created/supported by EESSI)
set LMOD_EESSI_VERSION = "${EESSI_VERSION}"
if ( "${LMOD_EESSI_VERSION}" == "2023.06" ) then
set LMOD_EESSI_VERSION = "2025.06"
endif
if ( ! $?EESSI_NO_MODULE_PURGE_ON_INIT ) then
module purge >& /dev/null
if ( $status == 0 ) echo "Modules purged before initialising EESSI"
endif
# If there is a local Lmod, make it forget about the system set MODULEPATH
unsetenv __LMOD_REF_COUNT_MODULEPATH
# and clear out any memory Lmod might have
unsetenv _ModuleTable001_
# Path to top-level module tree
set modulepath = "${EESSI_CVMFS_REPO}/init/modules"
if ( $?EESSI_EXTRA_MODULEPATH ) then
# Now that we know it exists, check IF it is not empty
if ( "$EESSI_EXTRA_MODULEPATH" != "" ) then
set modulepath = "${modulepath}:${EESSI_EXTRA_MODULEPATH}"
endif
endif
setenv MODULEPATH "$modulepath"
source "${EESSI_CVMFS_REPO}/versions/${LMOD_EESSI_VERSION}/compat/linux/`uname -m`/usr/share/Lmod/init/csh"
module --initial_load --no_redirect restore
echo "EESSI has selected ${EESSI_SOFTWARE_SUBDIR} as the compatible CPU target for EESSI/${EESSI_VERSION}"
if ( $?EESSI_ACCEL_SUBDIR ) then
if ( "$EESSI_ACCEL_SUBDIR" != "" ) then
echo "EESSI has selected ${EESSI_ACCEL_SUBDIR} as the compatible accelerator target for EESSI/${EESSI_VERSION}"
else
echo "EESSI did not identify an accelerator on the system"
endif
else
echo "EESSI did not identify an accelerator on the system"
endif
echo "(for debug information when loading the EESSI module, set the environment variable EESSI_MODULE_DEBUG_INIT)"
else
module reset
endif