-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathbash
More file actions
53 lines (41 loc) · 1.81 KB
/
bash
File metadata and controls
53 lines (41 loc) · 1.81 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
function show_msg {
# only echo msg if EESSI_SILENT is unset
msg=$1
if [[ -z ${EESSI_SILENT+x} ]]; then
echo "$msg"
fi
}
# The following method should be safe, but might break if file is a symlink
# (could switch to $(dirname "$(readlink -f "$BASH_SOURCE")") in that case)
source $(dirname "$BASH_SOURCE")/eessi_environment_variables
# only continue if setting EESSI environment variables worked fine
if [ $? -eq 0 ]; then
export PS1="{EESSI $EESSI_VERSION} $PS1"
# add location of commands provided by compat layer to $PATH;
# see https://github.com/EESSI/software-layer/issues/52
export PATH=$EPREFIX/usr/bin:$EPREFIX/bin:$PATH
# init Lmod
show_msg "Initializing Lmod..."
source $EESSI_EPREFIX/usr/share/Lmod/init/bash
# prepend location of modules for EESSI software stack to $MODULEPATH
show_msg "Prepending $EESSI_MODULEPATH to \$MODULEPATH..."
module use $EESSI_MODULEPATH
if [ ! -z ${EESSI_MODULEPATH_ACCEL} ]; then
show_msg "Prepending $EESSI_MODULEPATH_ACCEL to \$MODULEPATH..."
module use $EESSI_MODULEPATH_ACCEL
fi
show_msg "Prepending site path $EESSI_SITE_MODULEPATH to \$MODULEPATH..."
module use $EESSI_SITE_MODULEPATH
if [ ! -z ${EESSI_MODULEPATH_ACCEL} ]; then
show_msg "Prepending $EESSI_SITE_MODULEPATH_ACCEL to \$MODULEPATH..."
module use $EESSI_SITE_MODULEPATH_ACCEL
fi
#show_msg ""
#show_msg "*** Known problems in the ${EESSI_VERSION} software stack ***"
#show_msg ""
#show_msg "1) ..."
#show_msg ""
#show_msg ""
echo "Environment set up to use EESSI (${EESSI_VERSION}), have fun!"
printf "*****\nPlease note that by configuring and using the EESSI software stack,\nyou agree to abide by the EESSI Terms of Use\n(see https://www.eessi.io/docs/governance/terms_of_use/).\n*****\n"
fi