-
Notifications
You must be signed in to change notification settings - Fork 44
/
build.analyze.sh
executable file
·141 lines (122 loc) · 4.34 KB
/
build.analyze.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
#!/bin/sh
# This script runs scan-build to perform a static code analysis
# https://clang-analyzer.llvm.org/scan-build.html
#
# The actual compilers have to be set in the CCC prefix env. variables. e.g:
# export CCC_CC=clang-3.8
# export CCC_CXX=clang++3.8
BUILD_DIR=./build.analyze
REPORT_DIR=report # relative to BUILD_DIR
BUILD_WRAPPER="${SCANBUILD_BIN}";
## !! NOTE !!
#
# See documentation of scan-build for details on recommended build
# configuration:
#
# https://clang-analyzer.llvm.org/scan-build.html#recommended_debug
#
##
# try to find build wrapper
if [ "$BUILD_WRAPPER" = "" ]; then
BUILD_WRAPPER="scan-build"
fi
if [ "$SCANBUILD_OPTS" = "" ]; then
SCANBUILD_OPTS="-analyze-headers -plist-html"
fi
SCANBUILD_OPTS="-o $REPORT_DIR ${SCANBUILD_OPTS}"
SCANBUILD_OPTS="--force-analyze-debug-code -v ${SCANBUILD_OPTS}"
which $BUILD_WRAPPER ||
(echo "This build requires $BUILD_WRAPPER. Set env. var SCANBUILD_BIN" \
& exit 1);
FORCE_BUILD=false
if [ "$1" = "-f" ]; then
FORCE_BUILD=true
shift
fi
await_confirm() {
if ! $FORCE_BUILD; then
echo ""
echo " To build and analyze using these settings, hit ENTER"
read confirm
fi
}
exit_message() {
echo "--------------------------------------------------------"
echo "Done. To install DASH, run: make -C $BUILD_DIR install"
}
if [ "${PAPI_HOME}" = "" ]; then
PAPI_HOME=$PAPI_BASE
fi
# To specify a build configuration for a specific system, use:
#
# -DENVIRONMENT_TYPE=<type> \
#
# For available types, see the files in folder ./config.
# To specify a custom build configuration, use:
#
# -DENVIRONMENT_CONFIG_PATH=<path to cmake file> \
#
# To use an existing installation of gtest instead of downloading the sources
# from the google test subversion repository, use:
#
# -DGTEST_LIBRARY_PATH=${HOME}/gtest \
# -DGTEST_INCLUDE_PATH=${HOME}/gtest/include \
#
# To build with MKL support, set environment variables MKLROOT and INTELROOT.
#
# To enable IPM runtime support, use:
#
# -DIPM_PREFIX=<IPM install path> \
# For likwid support, ensure that the likwid development headers are
# installed.
# Configure with default release build settings:
rm -Rf $BUILD_DIR/*
mkdir -p $BUILD_DIR/$REPORT_DIR
(cd $BUILD_DIR && $BUILD_WRAPPER $SCANBUILD_OPTS \
cmake3 -DCMAKE_BUILD_TYPE=Debug \
-DENVIRONMENT_TYPE=default \
-DENABLE_COMPTIME_RED=OFF \
\
-DDART_IF_VERSION=3.2 \
-DINSTALL_PREFIX=$HOME/opt/dash-0.4.0/ \
-DDART_IMPLEMENTATIONS=mpi \
-DENABLE_THREADSUPPORT=ON \
-DENABLE_DEV_COMPILER_WARNINGS=OFF \
-DENABLE_EXT_COMPILER_WARNINGS=OFF \
-DENABLE_LT_OPTIMIZATION=OFF \
-DENABLE_ASSERTIONS=ON \
\
-DENABLE_SHARED_WINDOWS=ON \
-DENABLE_DYNAMIC_WINDOWS=ON \
-DENABLE_DEFAULT_INDEX_TYPE_LONG=ON \
\
-DENABLE_LOGGING=OFF \
-DENABLE_TRACE_LOGGING=OFF \
-DENABLE_DART_LOGGING=OFF \
\
-DENABLE_LIBNUMA=ON \
-DENABLE_LIKWID=OFF \
-DENABLE_HWLOC=ON \
-DENABLE_PAPI=ON \
-DENABLE_MKL=OFF \
-DENABLE_BLAS=ON \
-DENABLE_LAPACK=ON \
-DENABLE_SCALAPACK=ON \
-DENABLE_PLASMA=ON \
-DENABLE_HDF5=ON \
-DENABLE_MEMKIND=ON \
\
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_DOCS=OFF \
\
-DIPM_PREFIX=${IPM_HOME} \
-DPAPI_PREFIX=${PAPI_HOME} \
\
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
"$@" \
../ &&
await_confirm &&
$BUILD_WRAPPER $SCANBUILD_OPTS make) &&
(cp $BUILD_DIR/compile_commands.json .) &&
exit_message