-
Notifications
You must be signed in to change notification settings - Fork 1
/
300-build-ippl
executable file
·59 lines (53 loc) · 1.62 KB
/
300-build-ippl
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
#!/bin/bash -l
P=ippl
build_type=${build_type:-serial}
ENABLE_FFT=${ENABLE_FFT:-ON}
ENABLE_SOLVERS=${ENABLE_SOLVERS:-ON}
ENABLE_ALPINE=${ENABLE_ALPINE:-ON}
ENABLE_UNIT_TESTS=${ENABLE_UNIT_TESTS:-ON}
NJOBS=8
trap "itb_exit" EXIT
CXXFLAGS=""
build_mode=${build_mode:-Release}
compiler=${compiler:-"$(which gcc)"}
if [[ "$build_type" == "cuda" ]]; then
echo "Build Cuda mode."
compiler="${Kokkos_DIR:?Kokkos install directory must be provided}/bin/nvcc_wrapper"
CXXFLAGS="--expt-relaxed-constexpr"
elif [[ "$build_type" == "serial" ]]; then
echo "Build serial mode."
elif [[ "$build_type" == "openmp" ]]; then
echo "Build OpenMP mode."
else
echo "Wrong build type."
fi
cd "${ITB_SRC_DIR}" || exit "${ITB_ARG_ERR}"
if [ -d "ippl" ]
then
echo "Found existing IPPL source directory"
else
echo "Clone ippl repo ... "
if [ -n "$USE_SSH" ]; then
git clone [email protected]:IPPL-framework/ippl.git
else
git clone https://github.com/IPPL-framework/ippl.git
fi
fi
mkdir -p "${ITB_SRC_DIR}/$P/build_$build_type" && cd "$_" || exit "${ITB_ARG_ERR}"
echo "Unit tests ${ENABLE_UNIT_TESTS}"
cmake \
-DCMAKE_BUILD_TYPE="${build_mode}" \
-DCMAKE_INSTALL_PREFIX="${ITB_PREFIX}" \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DENABLE_TESTS=ON \
-DENABLE_UNIT_TESTS="${ENABLE_UNIT_TESTS}" \
-DENABLE_FFT="${ENABLE_FFT}" \
-DENABLE_SOLVERS="${ENABLE_SOLVERS}" \
-DENABLE_ALPINE="${ENABLE_ALPINE}" \
-DCMAKE_CXX_COMPILER="${compiler}" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-error=parentheses" \
$ADDITIONAL_CMAKE_FLAGS \
"${ITB_SRC_DIR}/$P"
# compile & install
make -j ${NJOBS}
make install