-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathbuild_all.sh
More file actions
executable file
·589 lines (515 loc) · 15.1 KB
/
build_all.sh
File metadata and controls
executable file
·589 lines (515 loc) · 15.1 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
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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
#!/bin/bash
set -e
if [[ ! -d deps ]]; then
echo "The directory deps does not exist."
echo "Please run ./get_deps.sh and try again."
false
fi
source deps/env.sh
if [[ $(uname -s) = Linux ]]; then
DEFAULT_THREADS=$(nproc --all)
elif [[ $(uname -s) = Darwin ]]; then
DEFAULT_THREADS=$(sysctl -n hw.ncpu)
else
DEFAULT_THREADS=4
fi
THREADS=${THREADS:-$DEFAULT_THREADS}
if [[ ${DEBUG:-0} -eq 0 ]]; then
export CMAKE_BUILD_TYPE=Release
else
export CMAKE_BUILD_TYPE=Debug
fi
make -C core clean
make -C core -j$THREADS
if [[ $(uname -s) != Darwin ]]; then
make -C kernel_bench clean
make -C kernel_bench all -j$THREADS
fi
if [[ $TASKBENCH_USE_MPI -eq 1 ]]; then
make -C mpi clean
make -C mpi all -j$THREADS
fi
if [[ $USE_MPI_OPENMP -eq 1 ]]; then
make -C mpi_openmp clean
make -C mpi_openmp all -j$THREADS
(
if [[ -n $CRAYPE_VERSION ]]; then
export LDFLAGS="-L/opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64 -liomp5 -lpthread"
rm -rf mpi_openmp_kmp
cp -r mpi_openmp mpi_openmp_kmp
make -C mpi_openmp_kmp clean
make -C mpi_openmp_kmp all -j$THREADS
fi
)
fi
if [[ $USE_GASNET -eq 1 ]]; then
make -C "$GASNET_DIR"
fi
if [[ $TASKBENCH_USE_HWLOC -eq 1 && -z $CI ]]; then
pushd "$HWLOC_DL_DIR"
if [[ ! -d $HWLOC_DIR ]]; then
mkdir build
pushd build
$HWLOC_SRC_DIR/configure --prefix=$HWLOC_DIR
make -j$THREADS
make install
popd
rm -rf build
fi
popd
fi
if [[ $USE_LEGION -eq 1 || $USE_PYGION -eq 1 ]]; then
pushd "$LEGION_DIR"
if [[ ! -d build ]]; then
mkdir build
legion_cmake_flags=(
-DBUILD_SHARED_LIBS=ON
-DCMAKE_INSTALL_PREFIX="$LEGION_DIR"/install
)
if [[ $USE_PYGION -eq 1 ]]; then
legion_cmake_flags=(
-DLegion_BUILD_BINDINGS=ON
-DLegion_USE_Python=ON
)
fi
if [[ $USE_GASNET -eq 1 ]]; then
legion_cmake_flags+=(
-DLegion_NETWORKS=gasnetex
-DGASNet_ROOT="$GASNET_DIR"/release
-DGASNet_CONDUIT="$GASNET_CONDUIT"
)
fi
pushd build
cmake .. "${legion_cmake_flags[@]}"
make install -j$THREADS
popd
fi
popd
fi
if [[ $USE_LEGION -eq 1 ]]; then
mkdir -p legion/build
pushd legion/build
cmake .. -DLegion_ROOT="$LEGION_DIR"/install
make -j$THREADS
popd
fi
if [[ $USE_PYGION -eq 1 ]]; then
(
source "$PYGION_DIR"/env.sh
make -C "$LEGION_DIR"/bindings/python -j$THREADS
make -C pygion -j$THREADS
)
fi
(
if [[ -n $CRAYPE_VERSION ]]; then
export HOST_CC=gcc HOST_CXX=g++
fi
if [[ $USE_REGENT -eq 1 ]]; then
pushd "$REGENT_DIR"
if [[ $USE_GASNET -eq 1 ]]; then
ln -sf "$GASNET_DIR" gasnet
fi
(
if [[ -z $CC ]]; then
export CC=cc
fi
if [[ -z $CXX ]]; then
export CXX=c++
fi
./scripts/setup_env.py -j$THREADS
)
popd
(
if [[ -n $CRAYPE_VERSION ]]; then
export CC=gcc CXX=g++
fi
make -C regent -j$THREADS
)
fi
)
if [[ $USE_REALM -eq 1 ]]; then
pushd "$REALM_DIR"
if [[ ! -d build ]]; then
mkdir build
realm_cmake_flags=(
-DBUILD_SHARED_LIBS=ON
-DCMAKE_INSTALL_PREFIX="$REALM_DIR"/install
)
if [[ $USE_GASNET -eq 1 ]]; then
realm_cmake_flags+=(
-DREALM_ENABLE_GASNETEX=ON
-DGASNet_ROOT="$GASNET_DIR"/release
-DGASNET_CONDUIT="$GASNET_CONDUIT"
)
fi
pushd build
cmake .. "${realm_cmake_flags[@]}"
make install -j$THREADS
popd
fi
popd
for variant in realm realm_subgraph realm_old; do
mkdir -p $variant/build
pushd $variant/build
cmake .. -DRealm_ROOT="$REALM_DIR"/install
make -j$THREADS
popd
done
fi
if [[ $USE_STARPU -eq 1 ]]; then
pushd "$STARPU_DL_DIR"
if [[ ! -d install ]]; then
mkdir build
starpu_configure_flags=(
--disable-cuda
--disable-opencl
--disable-fortran
--disable-build-tests
--disable-build-examples
--disable-mlr
--disable-hdf5
--enable-fast
--enable-maxnodes=1
)
if [[ $TASKBENCH_USE_HWLOC -ne 1 ]]; then
starpu_configure_flags+=(--without-hwloc)
fi
pushd build
"$STARPU_SRC_DIR"/configure --prefix=$STARPU_DIR "${starpu_configure_flags[@]}"
make -j$THREADS
make install
popd
rm -rf build
fi
popd
make -C starpu clean
make -C starpu -j$THREADS
fi
if [[ $USE_PARSEC -eq 1 ]]; then
mkdir -p "$PARSEC_DIR"
pushd "$PARSEC_DIR"
if [[ $TASKBENCH_USE_HWLOC -eq 1 ]]; then
../configure --prefix=$PWD --with-mpi --with-hwloc=$HWLOC_DIR --disable-debug --with-cuda=no --disable-testing -DPARSEC_MAX_LOCAL_COUNT=30 -DPARSEC_MAX_DEP_OUT_COUNT=15
else
../configure --prefix=$PWD --with-mpi --disable-debug --with-cuda=no --disable-testing -DPARSEC_MAX_LOCAL_COUNT=30 -DPARSEC_MAX_DEP_OUT_COUNT=15
fi
ninja install
popd
make -C parsec clean
make -C parsec -j$THREADS
fi
(if [[ $USE_CHARM -eq 1 ]]; then
if [[ -n $CRAYPE_VERSION ]]; then
module load craype-hugepages8M
fi
pushd "$CHARM_DIR"
./build charm++ $CHARM_VERSION --with-production -j$THREADS
popd
pushd "$CHARM_SMP_DIR"
./build charm++ $CHARM_VERSION smp --with-production -j$THREADS
popd
make -C charm++ clean
make -C charm++
(
export CHARM_DIR="$CHARM_SMP_DIR"
rm -rf charm++_smp
cp -r charm++ charm++_smp
make -C charm++_smp clean
make -C charm++_smp
)
fi)
(if [[ $USE_HPX -eq 1 ]]; then
source "$HPX_DIR"/env.sh
pushd $HWLOC_SRC_DIR
if [[ ! -d build ]]; then
mkdir build
cd build
../configure --prefix=$HPX_INSTALL_ROOT/hwloc --disable-opencl
make -j$THREADS
make install
fi
popd
pushd $JEMALLOC_SRC_DIR
if [[ ! -d build ]]; then
./autogen.sh
mkdir build
cd build
../configure --prefix=$HPX_INSTALL_ROOT/jemalloc
make -j$THREADS
make install
fi
popd
pushd $HPX_SOURCE_ROOT/hpx
if [[ ! -d build ]]; then
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=$HPX_INSTALL_ROOT/hpx \
-DHPX_WITH_PKGCONFIG=OFF \
-DHPX_WITH_FETCH_ASIO=ON \
-DHPX_WITH_PARCELPORT_MPI=ON \
-DHPX_WITH_PARCELPORT_TCP=OFF \
-DHPX_WITH_EXAMPLES=OFF \
-DHPX_WITH_MALLOC=jemalloc \
-DHWLOC_ROOT=$HPX_INSTALL_ROOT/hwloc \
-DJEMALLOC_ROOT=$HPX_INSTALL_ROOT/jemalloc
# -DBOOST_ROOT=$HPX_INSTALL_ROOT/boost \
make -j$THREADS
make install
fi
popd
pushd hpx
if [[ ! -d build ]]; then
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=$HPX_INSTALL_ROOT/hpx -DCMAKE_INSTALL_PREFIX=$PWD/..
else
cd build
fi
make -j$THREADS
make install
popd
fi)
(if [[ $USE_CHAPEL -eq 1 ]]; then
if [[ -n $CRAYPE_VERSION ]]; then
module load craype-hugepages16M
fi
export PATH="$CHPL_HOME/bin/$CHPL_HOST_PLATFORM-$CHPL_HOST_ARCH:$PATH"
pushd "$CHPL_HOME"
make -j$THREADS
popd
make -C chapel clean
make -C chapel
fi)
(if [[ $USE_X10 -eq 1 ]]; then
source "$X10_DIR"/env.sh
ANT_FLAGS=("-DX10RT_MPI=true")
if [[ ${DEBUG:-0} -eq 0 ]]; then
ANT_FLAGS+=("-Doptimize=true" "-DNO_CHECKS=true")
fi
if [[ -n $CRAYPE_VERSION ]]; then
ANT_FLAGS+=("-DCROSS_COMPILE_MODULES=true")
fi
pushd "$X10_DIR"/x10/x10.dist
ant "${ANT_FLAGS[@]}" dist # squeakyclean dist
popd
make -C x10 clean
make -C x10
fi)
if [[ $USE_OPENMP -eq 1 ]]; then
make -C openmp clean
make -C openmp -j$THREADS
fi
if [[ $USE_OMPSS -eq 1 ]]; then
pushd "$OMPSS_NOSV_SRC_DIR"
if [[ ! -d build ]]; then
mkdir build
pushd build
../configure --prefix=$OMPSS_TARGET
make -j$THREADS
make install
popd
# Hack: remove the build directory and remake it to track whether we've built or not
rm -rf build
mkdir build
fi
popd
pushd "$OMPSS_NANOS6_SRC_DIR"
if [[ ! -d build ]]; then
mkdir build
pushd build
../configure --prefix=$OMPSS_TARGET --with-boost=/usr --with-hwloc=pkgconfig
make all -j$THREADS
make install -j$THREADS
popd
# Hack: remove the build directory and remake it to track whether we've built or not
rm -rf build
mkdir build
fi
popd
pushd "$OMPSS_NODES_SRC_DIR"
if [[ ! -d build ]]; then
mkdir build
pushd build
../configure --prefix=$OMPSS_TARGET --with-nosv=$OMPSS_TARGET --with-boost=/usr
make -j$THREADS
make install
popd
# Hack: remove the build directory and remake it to track whether we've built or not
rm -rf build
mkdir build
fi
popd
pushd "$OMPSS_LLVM_SRC_DIR"
if [[ ! -d build ]]; then
cmake -S llvm -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$OMPSS_TARGET \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
-DCLANG_DEFAULT_OMPSS2_RUNTIME=libnanos6 \
-DCLANG_DEFAULT_NANOS6_HOME=$OMPSS_TARGET \
-DCLANG_DEFAULT_NODES_HOME=$OMPSS_TARGET \
-DCLANG_DEFAULT_NOSV_HOME=$OMPSS_TARGET
make -C build -j$THREADS
make -C build install
# Hack: remove the build directory and remake it to track whether we've built or not
rm -rf build
mkdir build
fi
popd
make -C ompss clean
make -C ompss -j$THREADS
fi
(if [[ $USE_SPARK -eq 1 ]]; then
source "$SPARK_DIR"/env.sh
export CORE_DIR="$PWD"/core
export SPARK_PROJ_DIR="$PWD"/spark
pushd "$SPARK_SWIG_DIR"
if [[ ! -d build ]]; then
Tools/pcre-build.sh
mkdir build
cd build
PATH="$PWD/../pcre/pcre-swig-install/bin:$PATH" \
../configure --prefix="$SPARK_PREFIX"
make -j$THREADS
make install
fi
popd
pushd "$SPARK_PROJ_DIR"
swig -c++ -java -outcurrentdir -I../core -outdir "$SPARK_PROJ_DIR"/src/main/java core_c.i
g++ -fpic -c -O3 -std=c++11 -I../core -I"$JAVA_HOME"/include -I"$JAVA_HOME"/include/linux core_c_wrap.cxx
g++ -shared -O3 -z noexecstack -std=c++11 core_c_wrap.o -L"$CORE_DIR" -lcore -o libcore_c.so
popd
#make jar in sbt dir
pushd "$SPARK_PROJ_DIR"
"$SPARK_SBT_DIR"/sbt assembly
popd
# Hack: configure logging (needs to be located in $SPARK_HOME which auto-detects to $SPARK_SRC_DIR)
cp "$SPARK_PROJ_DIR"/log4j.properties "$SPARK_SRC_DIR"/conf/log4j.properties
fi)
(if [[ $USE_SWIFT -eq 1 ]]; then
source "$SWIFT_DIR"/env.sh
pushd "$SWIFT_DIR"
# tcl
(
if [[ -n $CRAYPE_VERSION ]]; then
export CC=gcc CXX=g++
fi
pushd tcl8.6.14/unix
if [[ ! -d build ]]; then
mkdir build
cd build
../configure --prefix="$SWIFT_PREFIX" --enable-shared
make -j$THREADS
make install
fi
popd
)
# swig
(
if [[ -n $CRAYPE_VERSION ]]; then
export CC=gcc CXX=g++
fi
pushd swig-4.2.1
export LDFLAGS=-L"$SWIFT_PREFIX"/lib
export CPPFLAGS=-I"$SWIFT_PREFIX"/include
if [[ ! -d build ]]; then
Tools/pcre-build.sh
mkdir build
cd build
PATH="$PWD/../pcre/pcre-swig-install/bin:$PATH" \
../configure --prefix="$SWIFT_PREFIX" --enable-shared
make -j$THREADS
make install
fi
popd
)
# ncurses
(
if [[ -n $CRAYPE_VERSION ]]; then
export CC=gcc CXX=g++
fi
pushd ncurses-6.4
export CXXFLAGS=" -fPIC"
export CFLAGS=" -fPIC"
if [[ ! -d build ]]; then
mkdir build
cd build
../configure --prefix="$SWIFT_PREFIX" --enable-shared
make -j$THREADS
make install
fi
popd
)
# zsh
(
if [[ -n $CRAYPE_VERSION ]]; then
export CC=gcc CXX=g++
fi
pushd zsh-5.9
export CPPFLAGS="-I$SWIFT_PREFIX/include"
export LDFLAGS="-L$SWIFT_PREFIX/lib"
if [[ ! -d build ]]; then
mkdir build
cd build
../configure --prefix="$SWIFT_PREFIX" --without-tcsetpgrp
make -j$THREADS
make install
fi
popd
)
# swift-t
if [[ -n $CRAYPE_VERSION ]]; then
if [[ ! -d cc-wrapper ]]; then
mkdir cc-wrapper
pushd cc-wrapper
cat >cc <<EOF
#!/bin/bash
$(which cc) -dynamic "\$@"
EOF
chmod +x cc
popd
fi
export PATH="$PWD"/cc-wrapper:"$PATH"
fi
pushd swift-t-1.6.7
if [[ ! -f ./dev/build/swift-t-settings.sh ]]; then
./dev/build/init-settings.sh
sed -i 's@SWIFT_T_PREFIX=/tmp/swift-t-install@SWIFT_T_PREFIX='"$SWIFT_PREFIX"'@g' ./dev/build/swift-t-settings.sh
sed -i 's@# TCLSH_LOCAL=/usr/bin/tclsh@TCLSH_LOCAL='"$SWIFT_PREFIX"'/bin/tclsh8.6@g' ./dev/build/swift-t-settings.sh
sed -i 's@# export JAVA_HOME=@export JAVA_HOME='"$JAVA_HOME"'@g' ./dev/build/swift-t-settings.sh
sed -i 's@# export ANT_HOME=@export ANT_HOME='"$ANT_HOME"'@g' ./dev/build/swift-t-settings.sh
sed -i 's@MAKE_PARALLELISM=1@MAKE_PARALLELISM='"$THREADS"'@g' ./dev/build/swift-t-settings.sh
if [[ -n $CRAYPE_VERSION ]]; then
sed -i 's@export CC=mpicc@export CC=cc@g' ./dev/build/swift-t-settings.sh
fi
fi
export SWIFT_T_OPT_BUILD=1
if [[ -n $CRAYPE_VERSION ]]; then
sed -i 's@mpicc@cc@g' ./dev/build/check-tools.sh
export CFLAGS="-fPIC"
export SWIFT_T_CUSTOM_MPI=1
export MPI_INCLUDE=$CRAY_MPICH_DIR/include
export MPI_LIB_DIR=$CRAY_MPICH_DIR/lib
# extra flags for turbine configure script
export CRAY_ARGS="--with-launcher=/usr/bin/srun"
fi
find . -type f \( -name '*.sh' -o -name '*.zsh' \) -exec sed -i 's@#!/bin/zsh@'"#!$SWIFT_PREFIX"'/bin/zsh@g' {} +
./dev/build/build-swift-t.sh
popd
popd
pushd swift
./swig_script.sh
stc -O3 benchmark.swift
popd
fi)
(if [[ $USE_TENSORFLOW -eq 1 ]]; then
source "$TENSORFLOW_DIR"/env.sh
export TF_CFLAGS="$(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))')"
export TF_LFLAGS="$(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))')"
make -C tensorflow/ops clean
make -C tensorflow/ops all -j$THREADS
fi)
echo
echo "Build completed successfully."