-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·379 lines (350 loc) · 11.2 KB
/
setup.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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
#/bin/bash
# Defines the installation directory for UCX
export UCX_ROOT=$PWD/validation/ucx
export UCX_INSTALL_DIR=$UCX_ROOT/install
# Defines the installation directory for MPICH
export MPICH_ROOT=$PWD/validation/mpich
export MPICH_INSTALL_DIR=$MPICH_ROOT/install
# Defines the installation directory for netcdf-fortran
export AUTOCONF_INSTALL_DIR=$PWD/deps/autoconf/install
export HDF5_INSTALL_DIR=$PWD/deps/hdf5/install
export NETCDF_C_INSTALL_DIR=$PWD/deps/netcdf-c/install
export NETCDF_FORTRAN_INSTALL_DIR=$PWD/deps/netcdf-fortran/install
export JOBS=64
export CC=gcc
export CXX=g++
export FC=gfortran
export MPICC=mpicc
export MPIFC=mpifort
echo "[INFO] Set up UCX ..."
# Asserts that the UCX source code is in the "validation" directory
if [ ! -d "validation/ucx" ]; then
echo "[ERROR] UCX source code not found in the 'validation' directory."
exit 1
fi
# Compiles UCX
echo "[INFO] Compiling UCX ..."
cd validation/ucx
./autogen.sh
./configure CC=$CC CXX=$CXX --prefix=$UCX_INSTALL_DIR
if [ $? -ne 0 ]; then
echo "[ERROR] UCX configuration failed."
exit 1
fi
# Copies the changed source files
cp ../latency-injector/ucx-src/ucp.h src/ucp/api/
cp ../latency-injector/ucx-src/ucp_request.h ../latency-injector/ucx-src/ucp_request.inl src/ucp/core/
cp ../latency-injector/ucx-src/tag_match.c ../latency-injector/ucx-src/tag_match.inl ucx-src/tag_recv.c src/ucp/tag/
make -j$JOBS
# Makes sure that the compilation was successful
if [ $? -ne 0 ]; then
echo "[ERROR] UCX compilation failed."
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "[ERROR] UCX installation failed."
exit 1
fi
export LD_LIBRARY_PATH=$UCX_INSTALL_DIR/lib:$LD_LIBRARY_PATH
export PATH=$UCX_INSTALL_DIR/bin:$PATH
# Makes sure that the installation was successful
# Asserts that ucx_info is in the PATH
if ! command -v ucx_info &> /dev/null
then
echo "[ERROR] ucx_info could not be found."
exit 1
fi
echo "[INFO] UCX installation: SUCCESS"
cd ../mpich
# Compile MPICH and install it
echo "[INFO] Set up MPICH ..."
# Checks if the MPICH source code is in the "validation" directory
if [ ! -d "validation/mpich" ]; then
echo "[INFO] MPICH source code not found in the 'validation' directory."
echo "[INFO] Downloading MPICH source code ..."
wget https://github.com/pmodels/mpich/releases/download/v4.1.2/mpich-4.1.2.tar.gz
tar -xvf mpich-4.1.2.tar.gz
# Moves the source code to the "validation" directory
mv mpich-4.1.2 validation/mpich
rm mpich-4.1.2.tar.gz
fi
# Compiles MPICH
echo "[INFO] Compiling MPICH ..."
echo "[INFO] Make sure to install the fortran compiler (gfortran) before compiling MPICH."
cd validation/mpich
./configure CC=$CC F77=$FC --prefix=$MPICH_INSTALL_DIR --with-ucx=$UCX_INSTALL_DIR
if [ $? -ne 0 ]; then
echo "[ERROR] MPICH configuration failed."
exit 1
fi
cp ../latency-injector/mpich-src/mpir_request.h src/include/
cp ../latency-injector/mpich-src/ucx_recv.h src/mpid/ch4/netmod/ucx/
cp ../latency-injector/mpich-src/ch4_* src/mpid/ch4/src/
make -j$JOBS
if [ $? -ne 0 ]; then
echo "[ERROR] MPICH compilation failed."
exit 1
fi
make install
# Makes sure that the compilation was successful
if [ $? -ne 0 ]; then
echo "[ERROR] MPICH installation failed."
exit 1
fi
export PATH=$MPICH_INSTALL_DIR/bin:$PATH
export LD_LIBRARY_PATH=$MPICH_INSTALL_DIR/lib:$LD_LIBRARY_PATH
# Makes sure that the installation was successful
# Asserts that mpicc is in the PATH
if ! command -v mpicc &> /dev/null
then
echo "[ERROR] mpicc could not be found."
exit 1
fi
echo "[INFO] MPICH installation: SUCCESS"
cd ../../
echo "[INFO] Set up liballprof ..."
cd liballprof/ && source ./setup.sh
# Asserts that the compilation was successful
if [ $? -ne 0 ]; then
echo "[ERROR] liballprof compilation failed."
exit 1
fi
echo "[INFO] Set up liballprof2"
cd ../liballprof2 && make clean && make -j8
# Asserts that the compilation was successful
if [ $? -ne 0 ]; then
echo "[ERROR] liballprof2 compilation failed."
exit 1
fi
export LIBALLPROF2_C=$PWD/liballprof2/liballprof.so
export LIBALLPROF2_F77=$PWD/liballprof2/liballprof_f77.so
echo "[INFO] liballprof2 setup: SUCCESS"
echo "[INFO] Set up Schedgen"
echo "[WARNING] Make sure to install the 'gengetopt' package before compiling Schedgen."
cd ../Schedgen && make clean && make -j8
# Asserts that the compilation was successful
if [ $? -ne 0 ]; then
echo "[ERROR] Schedgen compilation failed."
exit 1
fi
echo "[INFO] Schedgen setup: SUCCESS"
export PATH=$PWD:$PATH
echo "[INFO] Set up LogGOPSim"
echo "[WARNING] Make sure to install the 're2c' and 'graphviz-dev' packages before compiling Schedgen."
cd ../LogGOPSim && make clean && make -j8
# Asserts that the compilation was successful
if [ $? -ne 0 ]; then
echo "[ERROR] LogGOPSim compilation failed."
exit 1
fi
echo "[INFO] LogGOPSim setup: SUCCESS"
export PATH=$PWD:$PATH
cd ..
# Installs gurobi
echo "[INFO] Set up gurobi ..."
# Checks if gurobi has already been installed by using the gurobi_cli command
if ! command -v gurobi_cl &> /dev/null
then
echo "[INFO] Gurobi not found."
echo "[INFO] Downloading gurobi ..."
wget https://packages.gurobi.com/11.0/gurobi11.0.2_linux64.tar.gz
tar -xvf gurobi11.0.2_linux64.tar.gz
# Moves the gurobi directory to the "deps" directory
mv gurobi1102 deps/gurobi
rm gurobi11.0.2_linux64.tar.gz
# Asserts that the gurobi directory is in the "deps" directory
if [ ! -d "deps/gurobi" ]; then
echo "[ERROR] gurobi directory not found in the 'deps' directory."
exit 1
fi
else
echo "[INFO] Gurobi found."
fi
export GUROBI_HOME=$PWD/deps/gurobi/linux64
export PATH=$GUROBI_HOME/bin:$PATH
export LD_LIBRARY_PATH=$GUROBI_HOME/lib:$LD_LIBRARY_PATH
# Makes sure that the installation was successful
# Asserts that gurobi_cl is in the PATH
if ! command -v gurobi_cl &> /dev/null
then
echo "[ERROR] gurobi_cl could not be found."
exit 1
fi
echo "[INFO] Gurobi installation: SUCCESS"
# Compiles autoconf
echo "[INFO] Set up autoconf ..."
# Asserts that the autoconf source code is in the "deps" directory
if [ ! -d "deps/autoconf" ]; then
echo "[WARNING] autoconf source code not found in the 'deps' directory."
echo "[INFO] Downloading autoconf source code ..."
wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz
tar -xvf autoconf-2.71.tar.gz
# Moves the source code to the "deps" directory
mv autoconf-2.71 deps/autoconf
rm autoconf-2.71.tar.gz
fi
cd deps/autoconf
./configure --prefix=$AUTOCONF_INSTALL_DIR
if [ $? -ne 0 ]; then
echo "[ERROR] autoconf configuration failed."
exit 1
fi
make -j$JOBS
if [ $? -ne 0 ]; then
echo "[ERROR] autoconf compilation failed."
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "[ERROR] autoconf installation failed."
exit 1
fi
export PATH=$AUTOCONF_INSTALL_DIR/bin:$PATH
# Makes sure that the installation was successful
# Asserts that autoconf is in the PATH
if ! command -v autoconf &> /dev/null
then
echo "[ERROR] autoconf could not be found."
exit 1
fi
# Build hdf5
echo "[INFO] Set up hdf5 ..."
# Asserts that the hdf5 source code is in the "deps" directory
if [ ! -d "deps/hdf5" ]; then
echo "[ERROR] hdf5 source code not found in the 'deps' directory."
exit 1
fi
# Runs autogen.sh
cd deps/hdf5
./autogen.sh
if [ $? -ne 0 ]; then
echo "[ERROR] autogen.sh failed."
exit 1
fi
CC=$MPICC FC=$MPIFC CFLAGS=-fPIC ./configure --enable-shared --enable-parallel --enable-fortran --enable-fortran2003 --prefix=$HDF5_INSTALL_DIR
if [ $? -ne 0 ]; then
echo "[ERROR] hdf5 configuration failed."
exit 1
fi
make -j$JOBS
if [ $? -ne 0 ]; then
echo "[ERROR] hdf5 compilation failed."
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "[ERROR] hdf5 installation failed."
exit 1
fi
export PATH=$HDF5_INSTALL_DIR/bin:$PATH
export LD_LIBRARY_PATH=$HDF5_INSTALL_DIR/lib:$LD_LIBRARY_PATH
# Makes sure that the installation was successful
# Asserts that h5pfc is in the PATH
if ! command -v h5pfc &> /dev/null
then
echo "[ERROR] h5pfc could not be found."
exit 1
fi
# Build netcdf-c
echo "[INFO] Set up netcdf-c ..."
# Asserts that the netcdf-c source code is in the "deps" directory
if [ ! -d "deps/netcdf-c" ]; then
echo "[ERROR] netcdf-c source code not found in the 'deps' directory."
exit 1
fi
# Compiles netcdf-c
echo "[INFO] Compiling netcdf-c ..."
cd deps/netcdf-c
CC=$MPICC LDFLAGS=-L$HDF5_INSTALL_DIR/lib LIBS=-lhdf5 CPPFLAGS=-I$HDF5_INSTALL_DIR/include ./configure --enable-parallel-tests --prefix=$NETCDF_C_INSTALL_DIR --disable-libxml2
if [ $? -ne 0 ]; then
echo "[ERROR] netcdf-c configuration failed."
exit 1
fi
make -j$JOBS
if [ $? -ne 0 ]; then
echo "[ERROR] netcdf-c compilation failed."
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "[ERROR] netcdf-c installation failed."
exit 1
fi
export PATH=$NETCDF_C_INSTALL_DIR/bin:$PATH
export LD_LIBRARY_PATH=$NETCDF_C_INSTALL_DIR/lib:$LD_LIBRARY_PATH
# Asserts that the installation was successful
# Asserts that nc-config is in the PATH
if ! command -v nc-config &> /dev/null
then
echo "[ERROR] nc-config could not be found."
exit 1
fi
# Build netcdf-fortran
echo "[INFO] Set up netcdf-fortran ..."
# Asserts that the netcdf-fortran source code is in the "deps" directory
if [ ! -d "deps/netcdf-fortran" ]; then
echo "[ERROR] netcdf-fortran source code not found in the 'deps' directory."
exit 1
fi
# Compiles netcdf-fortran
echo "[INFO] Compiling netcdf-fortran ..."
cd deps/netcdf-fortran
CC=$MPICC FC=$MPIFC LIBS=-lnetcdf CPPFLAGS=-I$NETCDF_C_INSTALL_DIR/include LDFLAGS=-L$NETCDF_C_INSTALL_DIR/lib ./configure --enable-parallel-tests --prefix=$NETCDF_FORTRAN_INSTALL_DIR
if [ $? -ne 0 ]; then
echo "[ERROR] netcdf-fortran configuration failed."
exit 1
fi
make -j$JOBS
if [ $? -ne 0 ]; then
echo "[ERROR] netcdf-fortran compilation failed."
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "[ERROR] netcdf-fortran installation failed."
exit 1
fi
export PATH=$NETCDF_FORTRAN_INSTALL_DIR/bin:$PATH
export LD_LIBRARY_PATH=$NETCDF_FORTRAN_INSTALL_DIR/lib:$LD_LIBRARY_PATH
# Makes sure that the installation was successful
# Asserts that nf-config is in the PATH
if ! command -v nf-config &> /dev/null
then
echo "[ERROR] nf-config could not be found."
exit 1
fi
echo "[INFO] Set up netgauge..."
# Checks if the netgauge source code is in the "deps" directory
if [ ! -d "deps/netgauge" ]; then
echo "[INFO] netgauge source code not found in the 'deps' directory."
echo "[INFO] Downloading netgauge source code ..."
wget https://htor.inf.ethz.ch/research/netgauge/netgauge-2.4.6.tar.gz
tar -xvf netgauge-2.4.6.tar.gz
# Moves the source code to the "deps" directory
mv netgauge-2.4.6 deps/netgauge
rm netgauge-2.4.6.tar.gz
fi
# Compiles netgauge
echo "[INFO] Compiling netgauge ..."
cd deps/netgauge
./configure CC=$MPICC LIBS="-lpthread"
if [ $? -ne 0 ]; then
echo "[ERROR] netgauge configuration failed."
exit 1
fi
make -j$JOBS
if [ $? -ne 0 ]; then
echo "[ERROR] netgauge compilation failed."
exit 1
fi
export PATH=$PWD:$PATH
# Makes sure that the compilation was successful
# Asserts that netgauge is in the PATH
if ! command -v netgauge &> /dev/null
then
echo "[ERROR] netgauge could not be found."
exit 1
fi
pip install -r requirements.txt
echo "[INFO] All setup: SUCCESS"