-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_all.sh
executable file
·149 lines (113 loc) · 3.47 KB
/
install_all.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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/usr/bin/env bash
set -e
#-------------------------------------------------------------------------------
# PARSE INPUTS
_skip_git=false
_overwrite_host=false
_host=""
while test $# -gt 0; do
case "$1" in
-h|-help)
echo "Valid flags are:"
echo " 1. -skip-git [default:false]"
echo " 2. -overwrite-host"
exit 0
;;
-skip-git)
shift
_skip_git=true
;;
-overwrite-host)
shift
_overwrite_host=true
_host=$1
shift
;;
*)
echo "Error: could not parse: $1"
exit 1
;;
esac
done
if [[ $_skip_git == true ]]; then
export SKIP_GIT=true
fi
if [[ $_overwrite_host == true ]]; then
export CCTBX_HOST=$_host
else
if [[ $NERSC_HOST == "cori" ]]; then
export CCTBX_HOST="cori"
else
_hostname=$(hostname -f)
if [[ ${_hostname#login*.} == "summit.olcf.ornl.gov" ]]; then
# if running on login node
export CCTBX_HOST="summit"
elif [[ ${_hostname#batch*.} == "summit.olcf.ornl.gov" ]]; then
# if running on interactive node
export CCTBX_HOST="summit"
fi
fi
fi
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# GIT DEPEDNTICES
#
# Update git LFS stores and update submodules. WARNING: this will clobber any
# changes to submodules that you've not yet commited
#
if [[ ! $SKIP_GIT == true ]]; then
# Cori has a dedicated `git-lfs module`
if [[ $CCTBX_HOST == "cori" ]]; then
module load git-lfs
fi
git lfs install
git lfs pull
git submodule update --init
fi
#-------------------------------------------------------------------------------
# use absolute paths:
project_root=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
#-------------------------------------------------------------------------------
# COMPATIBILITY WITH SITES
#
# This will load any site-specific settings
#
# Module files
source $project_root/opt/env/load_modules.sh -overwrite-host $CCTBX_HOST
# Conda-build settings
if [[ $CCTBX_HOST == "cori" ]]; then
source $project_root/conda/sites/nersc.sh
fi
if [[ $CCTBX_HOST == "cgpu" ]]; then
source $project_root/conda/sites/default.sh
fi
if [[ $CCTBX_HOST == "summit" ]]; then
source $project_root/conda/sites/olcf.sh
fi
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# CONDA
#
# Build miniconda and MPI4PY (linking with manually-install MPICH library above)
#
$project_root/conda/install_conda.sh
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# CONDA XTC_BASE ENVIRONMENT
#
# Build the conda environment used by cctbx
#
$project_root/opt/env/setup_env.sh
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# CCTBX + PSANA2
#
# Build XTC processing pipeline
#
# Build PSANA2
$project_root/opt/setup_lcls2.sh
# Build CCTBX
$project_root/opt/setup_cctbx.sh
# Create local env file
$project_root/opt/mk_env.sh
#-------------------------------------------------------------------------------