forked from JeffersonLab/ceInstall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoftenv.sh
65 lines (55 loc) · 1.36 KB
/
softenv.sh
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
#!/bin/bash
# Wrapper script to set up the JLab SciComp software within bash.
#
# - Brad Sawatky <brads@jlab.org> Nov 17, 2016
# Set defaults if vars not already defined
export JLAB_ROOT="${JLAB_ROOT:=/site/12gev_phys}"
export JLAB_VERSION="${JLAB_VERSION:="unset"}"
if [ -n "$1" ]; then
export JLAB_VERSION="$1"
fi
## Mechanism to allow users to overwrite/keep own settings
OVERWRITE="yes"
if [ "${2:-NA}" == "keepmine" ]; then
OVERWRITE="$2"
fi
## Make sure we use one of the supported versions
case "$JLAB_VERSION" in
2.[0123] ) ## Match good versions here
;;
devel ) ## Match good versions here
;;
*)
echo
echo " Usage: 'source $JLAB_ROOT/softenv.csh <version>'"
echo
echo " Supported Versions: "
echo
echo " - 2.3 "
echo " - 2.2 (production)"
echo " - 2.1 "
echo " - 2.0 "
echo " - devel "
echo; echo
return 1
;;
esac
if [ "${JLAB_ROOT}" == "2.3" ]; then
export QT_VERSION=5.10.1
fi
config_sh="${JLAB_ROOT}/${JLAB_VERSION}/ce/jlab.sh"
if [ -e "$config_sh" ]; then
source "$config_sh" $OVERWRITE
else
echo
echo " Configuration '$1' not available on this machine."
echo " For documentation on the environment please visit https://data.jlab.org "
echo
return 1
fi
case $- in
*i*) # interactive shell
echo ' >> For documentation on the environment please visit https://data.jlab.org'
echo
;;
esac