-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompile.sh
executable file
·53 lines (44 loc) · 1.19 KB
/
compile.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
#!/bin/bash
if [ "$COMPILER" = "gnu" ]; then
export CC=mpicc
export CXX=mpic++
elif [ "$COMPILER" = "intel" ]; then
export CC=mpiicc
export CXX=mpicxx
elif [ "$COMPILER" = "clang" ]; then
export CC="mpicc -cc=clang"
export CXX="mpicxx -cxx=clang++"
else
## Default to GNU, everything has that, right?
COMPILER=gnu
export CC=mpicc
export CXX=mpic++
fi
set -e
set -u
## 3rd-party libraries:
HDF5_ROOT="$HDF5_INSTALL_PATH"
METIS_ROOT="$METIS_INSTALL_PATH"
PARMETIS_ROOT="$PARMETIS_INSTALL_PATH"
PETSC_ROOT="$PETSC_INSTALL_PATH"
SQLITE_ROOT="$SQLITE_INSTALL_PATH"
## Link to treetimer library:
TREETIMER_ROOT="$TREETIMER_PATH"
## Optional: clean previous build files:
# rm -rf build
mkdir -p build
# Compile!
# RTYPE=Release
RTYPE=Debug
cd build
cmake .. -DHDF5_ROOT="$HDF5_ROOT" \
-DCMAKE_BUILD_TYPE="$RTYPE" -DCOMPILER="$COMPILER" \
-DMETIS_ROOT="$METIS_ROOT" \
-DPARMETIS_ROOT="$PARMETIS_ROOT" \
-DSQLITE_LIBS="$SQLITE_ROOT"/lib/libsqlite3.so \
-DPETSC_ROOT="$PETSC_ROOT" \
-DTREETIMER_LIBS="$TREETIMER_ROOT"/libtt.so \
-DTREETIMER_INCLUDE="$TREETIMER_ROOT"/include/timing_library/interface \
-DUSE_UNIT_TESTS=OFF
# make VERBOSE=1 -j`nproc`
make -j`nproc`