cmake.opts 2.1 KB
Newer Older
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
GXX_RELEASE_WARNING_OPTS=" \
    -Wall \
    -Wunused \
    -Wmissing-include-dirs \
    -Wcast-align \
    -Wno-missing-braces \
    -Wmissing-field-initializers \
    -Wno-sign-compare"

GXX_RELEASE_OPTS=" \
    -fdiagnostics-color=always \
    -fno-strict-aliasing \
    -fstrict-overflow \
    -fno-finite-math-only \
    -DNDEBUG=1 \
    -O3 \
    -march=native \
    -funroll-loops \
    -g0"

SPECIFIC_COMPILER=""
# if you want to specify a specific compiler, do it by setting (comment the above line)
#SPECIFIC_COMPILER="
# -DCMAKE_C_COMPILER=/usr/bin/gcc-8
# -DCMAKE_CXX_COMPILER=/usr/bin/g++-8
#"

SPECIFIC_GENERATOR=""
# if you want to specify a specific make file generator (e.g. ninja), do it by setting (comment the above line)
#SPECIFIC_GENERATOR="
# -DCMAKE_GENERATOR='Ninja'
# -DCMAKE_MAKE_PROGRAM='/usr/bin/ninja'
#"

35
36
37
38
39
40
OPM_FLAGS=""
# to build opm it might be necessary to set manually the following variables (comment the above line)
#OPM_FLAGS="
#-DUSE_MPI=ON
#"

41
42
43
# set this to "ON" if you want to be able to have the headercheck target
DUMUX_ENABLE_HEADERCHECK=OFF

44
45
46
47
# to disable the property macros and the warning set this (set it if you don't use the macros anymore)
DUMUX_DISABLE_PROP_MACROS=""
#DUMUX_DISABLE_PROP_MACROS="-DDUMUX_ENABLE_OLD_PROPERTY_MACROS=0"

48
49
# to enable Python bindings
DUMUX_ENABLE_PYTHON_BINDINGS=""
50
#DUMUX_ENABLE_PYTHON_BINDINGS="-DDUNE_ENABLE_PYTHONBINDINGS=1 -DBUILD_SHARED_LIBS=1"
51

52
53
54
55
# for debug opts you can set DCMAKE_BUILD_TYPE to "Debug" or "RelWithDebInfo"
# you can also do this in any of the CMakeLists.txt in Dumux
# just rerun cmake again afterwards (run cmake <path-to-build-dir>)

56
CMAKE_FLAGS="$SPECIFIC_COMPILER $SPECIFIC_GENERATOR $OPM_FLAGS
57
58
59
-DCMAKE_CXX_FLAGS_RELEASE='$GXX_RELEASE_OPTS $GXX_RELEASE_WARNING_OPTS $DUMUX_DISABLE_PROP_MACROS'
-DCMAKE_CXX_FLAGS_DEBUG='-O0 -g -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare $DUMUX_DISABLE_PROP_MACROS'
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO='$GXX_RELEASE_OPTS $GXX_RELEASE_WARNING_OPTS -g -ggdb -Wall $DUMUX_DISABLE_PROP_MACROS'
60
61
-DCMAKE_BUILD_TYPE=Release
-DENABLE_HEADERCHECK=$DUMUX_ENABLE_HEADERCHECK
62
$DUMUX_ENABLE_PYTHON_BINDINGS
63
"