forked from EESSI/software-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EESSI-pilot-install-software.sh
executable file
·269 lines (225 loc) · 8.81 KB
/
EESSI-pilot-install-software.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#!/bin/bash
#
# Script to install EESSI pilot software stack (version 2020.10)
#
TOPDIR=$(dirname $(realpath $0))
function echo_green() {
echo -e "\e[32m$1\e[0m"
}
function echo_red() {
echo -e "\e[31m$1\e[0m"
}
function echo_yellow() {
echo -e "\e[33m$1\e[0m"
}
function error() {
echo_red "ERROR: $1" >&2
exit 1
}
# honor $TMPDIR if it is already defined, use /tmp otherwise
if [ -z $TMPDIR ]; then
export WORKDIR=/tmp/$USER
else
export WORKDIR=$TMPDIR/$USER
fi
TMPDIR=$(mktemp -d)
echo ">> Setting up environment..."
export CVMFS_REPO="/cvmfs/pilot.eessi-hpc.org"
export EESSI_PILOT_VERSION="2020.10"
export ARCH=$(uname -m)
export EESSI_PREFIX=${CVMFS_REPO}/${EESSI_PILOT_VERSION}
export EPREFIX=${EESSI_PREFIX}/compat/${ARCH}
DETECTION_PARAMETERS=''
GENERIC=0
EB='eb'
if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then
echo_yellow ">> GENERIC build requested, taking appropriate measures!"
DETECTION_PARAMETERS="$DETECTION_PARAMETERS --generic"
GENERIC=1
EB='eb --optarch=GENERIC'
fi
# make sure that $PATH starts with $CVMFS_REPO
# (if not, we're not running in the environment set up by 'startprefix')
if [[ $PATH = ${CVMFS_REPO}* ]]; then
echo_green ">> It looks like we're in a Gentoo Prefix environment, good!"
else
error "Not running in Gentoo Prefix environment, run '${EPREFIX}/startprefix' first!"
fi
echo ">> Initializing Lmod..."
source $EPREFIX/usr/lmod/lmod/init/bash
ml_version_out=$TMPDIR/ml.out
ml --version &> $ml_version_out
if [[ $? -eq 0 ]]; then
echo_green ">> Found Lmod ${LMOD_VERSION}"
else
error "Failed to initialize Lmod?! (see output in ${ml_version_out}"
fi
echo ">> Determining software subdirectory to use for current build host..."
export EESSI_SOFTWARE_SUBDIR=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS)
if [[ -z ${EESSI_SOFTWARE_SUBDIR} ]]; then
error "Failed to determine software subdirectory?!"
else
echo_green ">> Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory!"
fi
echo ">> Configuring EasyBuild..."
export EASYBUILD_PREFIX=${WORKDIR}/easybuild
export EASYBUILD_INSTALLPATH=${EESSI_PREFIX}/software/${EESSI_SOFTWARE_SUBDIR}
export EASYBUILD_SOURCEPATH=${WORKDIR}/easybuild/sources:${EESSI_SOURCEPATH}
# just ignore OS dependencies for now, see https://github.com/easybuilders/easybuild-framework/issues/3430
export EASYBUILD_IGNORE_OSDEPS=1
export EASYBUILD_SYSROOT=${EPREFIX}
export EASYBUILD_DEBUG=1
export EASYBUILD_TRACE=1
export EASYBUILD_ZIP_LOGS=bzip2
export EASYBUILD_RPATH=1
export EASYBUILD_FILTER_ENV_VARS=LD_LIBRARY_PATH
DEPS_TO_FILTER=Autoconf,Automake,Autotools,binutils,bzip2,gettext,libreadline,libtool,M4,ncurses,XZ,zlib
# For aarch64 we need to also filter out Yasm.
# See https://github.com/easybuilders/easybuild-easyconfigs/issues/11190
if [[ "$ARCH" == "aarch64" ]]; then
DEPS_TO_FILTER="${DEPS_TO_FILTER},Yasm"
fi
export EASYBUILD_FILTER_DEPS=$DEPS_TO_FILTER
export EASYBUILD_MODULE_EXTENSIONS=1
echo ">> Setting up \$MODULEPATH..."
# make sure no modules are loaded
module --force purge
# ignore current $MODULEPATH entirely
module unuse $MODULEPATH
module use $EASYBUILD_INSTALLPATH/modules/all
if [[ -z ${MODULEPATH} ]]; then
error "Failed to set up \$MODULEPATH?!"
else
echo_green ">> MODULEPATH set up: ${MODULEPATH}"
fi
echo ">> Checking for EasyBuild module..."
ml_av_easybuild_out=$TMPDIR/ml_av_easybuild.out
module avail easybuild &> ${ml_av_easybuild_out}
if [[ $? -eq 0 ]]; then
echo_green ">> EasyBuild module found!"
else
echo_yellow ">> No EasyBuild module yet, installing it..."
eb_bootstrap_out=${TMPDIR}/eb_bootstrap.out
workdir=${TMPDIR}/easybuild_bootstrap
mkdir -p ${workdir}
cd ${workdir}
curl --silent -OL https://raw.githubusercontent.com/easybuilders/easybuild-framework/develop/easybuild/scripts/bootstrap_eb.py
python3 bootstrap_eb.py ${EASYBUILD_INSTALLPATH} &> ${eb_bootstrap_out}
cd - > /dev/null
module avail easybuild &> ${ml_av_easybuild_out}
if [[ $? -eq 0 ]]; then
echo_green ">> EasyBuild module installed!"
else
error "EasyBuild module failed to install?! (output of bootstrap script in ${eb_bootstrap_out}, output of 'ml av easybuild' in ${ml_av_easybuild_out})"
fi
fi
echo ">> Loading EasyBuild module..."
module load EasyBuild
$EB --version
if [[ $? -eq 0 ]]; then
echo_green ">> Looking good!"
$EB --show-config
else
error "EasyBuild not working?!"
fi
echo_green "All set, let's start installing some software in ${EASYBUILD_INSTALLPATH}..."
export GCC_EC="GCC-9.3.0.eb"
echo ">> Starting slow with ${GCC_EC}..."
$EB ${GCC_EC} --robot
if [[ $? -eq 0 ]]; then
echo_green "${GCC_EC} installed, yippy! Off to a good start..."
else
error "Installation of ${GCC_EC} failed!"
fi
# side-step to fix missing build dependency for Perl,
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/11200
export PERL_EC="Perl-5.30.2-GCCcore-9.3.0.eb"
echo ">> Taking a small side step to install ${PERL_EC}..."
$EB --from-pr 11368 makeinfo-6.7-GCCcore-9.3.0.eb --robot && $EB --from-pr 11454 DB-18.1.32-GCCcore-9.3.0.eb --robot && $EB --from-pr 11200 --robot
if [[ $? -eq 0 ]]; then
echo_green "${PERL_EC} installed via easyconfigs PR #11200, that was just a small side step, don't worry..."
else
error "Installation of ${PERL_EC} failed!"
fi
# side-step to fix installation of CMake with zlib included in --filter-deps
# see https://github.com/easybuilders/easybuild-easyblocks/pull/2187
echo ">> Installing CMake with fixed easyblock..."
$EB CMake-3.16.4-GCCcore-9.3.0.eb --include-easyblocks-from-pr 2187 --robot
if [[ $? -eq 0 ]]; then
echo_green "CMake installation done, glad that worked out!"
else
error "Installation of CMake failed, pfft..."
fi
# required to make sure that libraries like zlib that are listed in --filter-deps can be found by pkg-config
# FIXME: fix this in EasyBuild framework!
# see https://github.com/easybuilders/easybuild-framework/pull/3451
export PKG_CONFIG_PATH=$EPREFIX/usr/lib64/pkgconfig
# FIXME custom installation of Qt5 with patch required to build with Gentoo's zlib
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/11385
echo ">> Installing Qt5 with extra patch to use zlib provided by Gentoo..."
$EB --from-pr 11385 --robot
if [[ $? -eq 0 ]]; then
echo_green "Done with custom Qt5!"
else
error "Installation of custom Qt5 failed, grrr..."
fi
echo ">> Installing OpenBLAS, Python 3 and Qt5..."
# If we're building OpenBLAS for GENERIC, we need https://github.com/easybuilders/easybuild-easyblocks/pull/1946
if [[ $GENERIC -eq 1 ]]; then
echo_yellow ">> Using https://github.com/easybuilders/easybuild-easyblocks/pull/1946 to build generic OpenBLAS."
$EB --include-easyblocks-from-pr 1946 OpenBLAS-0.3.9-GCC-9.3.0.eb Python-3.8.2-GCCcore-9.3.0.eb Qt5-5.14.1-GCCcore-9.3.0.eb --robot
else
$EB OpenBLAS-0.3.9-GCC-9.3.0.eb Python-3.8.2-GCCcore-9.3.0.eb Qt5-5.14.1-GCCcore-9.3.0.eb --robot
fi
if [[ $? -eq 0 ]]; then
echo_green "Done with OpenBLAS, Python 3 and Qt5!"
else
error "Installation of OpenBLAS, Python 3 and Qt5 failed!"
fi
# FIXME: customized installation of OpenMPI, that supports high speed interconnects properly...
# see https://github.com/EESSI/software-layer/issues/14
echo ">> Installing properly configured OpenMPI..."
$EB --from-pr 11387 OpenMPI-4.0.3-GCC-9.3.0.eb --include-easyblocks-from-pr 2188 --robot
if [[ $? -eq 0 ]]; then
echo_green "OpenMPI installed, w00!"
else
error "Installation of OpenMPI failed, that's not good..."
fi
# FIXME custom instalation LAME with patch required to build on top of ncurses provided by Gentoo
echo ">> Installing LAME with patch..."
$EB --from-pr 11388 LAME-3.100-GCCcore-9.3.0.eb --robot
if [[ $? -eq 0 ]]; then
echo_green "LAME installed, yippy!"
else
error "Installation of LAME failed, oops..."
fi
echo ">> Installing GROMACS..."
$EB GROMACS-2020.1-foss-2020a-Python-3.8.2.eb --robot
if [[ $? -eq 0 ]]; then
echo_green "GROMACS and OpenFOAM installed, wow!"
else
error "Installation of GROMACS failed, damned..."
fi
echo ">> Installing OpenFOAM (twice!)..."
$EB OpenFOAM-8-foss-2020a.eb OpenFOAM-v2006-foss-2020a.eb --robot --include-easyblocks-from-pr 2196
if [[ $? -eq 0 ]]; then
echo_green "OpenFOAM installed, now we're talking!"
else
error "Installation of OpenFOAM failed, we were so close..."
fi
echo ">> Installing R 4.0.0 (better be patient)..."
$EB R-4.0.0-foss-2020a.eb --robot --include-easyblocks-from-pr 2189
if [[ $? -eq 0 ]]; then
echo_green "R installed, wow!"
else
error "Installation of R failed, so sad..."
fi
echo ">> Installing Bioconductor 3.11 bundle..."
$EB R-bundle-Bioconductor-3.11-foss-2020a-R-4.0.0.eb --robot
if [[ $? -eq 0 ]]; then
echo_green "Bioconductor installed, enjoy!"
else
error "Installation of Bioconductor failed, that's annoying..."
fi
echo ">> Cleaning up ${TMPDIR}..."
rm -r ${TMPDIR}