CMakeLists.txt 1.74 KB
Newer Older
niklas.baumgarten's avatar
niklas.baumgarten committed
1
cmake_minimum_required(VERSION 3.5.1)
niklas.baumgarten's avatar
niklas.baumgarten committed
2
project(MLMC)
niklas.baumgarten's avatar
niklas.baumgarten committed
3

niklas.baumgarten's avatar
niklas.baumgarten committed
4
5
6
7
# Compiler options
#set(CXX_VERSION "17")
#set(COMPILER_VERSION "c++")
#set(COMPILER_VERSION "gnu++")
niklas.baumgarten's avatar
niklas.baumgarten committed
8
set(COMPILER_OPTIMIZE "-O0")
niklas.baumgarten's avatar
niklas.baumgarten committed
9
10
#set(COMPILER_OPTIMIZE "-O1")
#set(COMPILER_OPTIMIZE "-O2")
niklas.baumgarten's avatar
niklas.baumgarten committed
11
#set(COMPILER_OPTIMIZE "-O3")
niklas.baumgarten's avatar
niklas.baumgarten committed
12
#set(COMPILER_OPTIMIZE "-Ofast")
niklas.baumgarten's avatar
niklas.baumgarten committed
13

niklas.baumgarten's avatar
niklas.baumgarten committed
14
# Problem options
niklas.baumgarten's avatar
niklas.baumgarten committed
15
option(NO_DEPRECATED "Suppress deprecated warnings" ON)
niklas.baumgarten's avatar
niklas.baumgarten committed
16
option(PROBLEM_NO_TIME "Time independent problem" ON)
niklas.baumgarten's avatar
niklas.baumgarten committed
17
option(PROBLEM_1D "1 dimensional problem" OFF)
niklas.baumgarten's avatar
niklas.baumgarten committed
18
19
20
21
22
23
24
25
26
27
option(PROBLEM_2D "2 dimensional problem" ON)
option(AFFINE_LINEAR_TRAFO "Only affine linear transformations" ON)

# Constants
#set(CONST_GEOMETRIC_TOLERANCE "1e-10")
#set(CONST_NEAR_ZERO "1e-15")
#set(CONST_VERY_LARGE "1e30")
#set(CONST_INFTY "1e100")

# SuperLU options
niklas.baumgarten's avatar
niklas.baumgarten committed
28
option(USE_SUPERLU30 "Use SuperLU 3.0 (old version)" OFF)
niklas.baumgarten's avatar
niklas.baumgarten committed
29
30
31
32
33

# Test options
option(BUILD_TESTS "Build test executables" OFF)
option(BUILD_MLMC_TESTS "Build mlmc test executables" ON)
#---------------------------------------------------------------------------------------#
niklas.baumgarten's avatar
niklas.baumgarten committed
34
35
36
37
38
39

# Set path for mpp
set(PROJECT_MPP_DIR ${PROJECT_SOURCE_DIR}/mpp)

# Include settings for mpp
include(${PROJECT_MPP_DIR}/CMakeListsMpp.inc)
niklas.baumgarten's avatar
niklas.baumgarten committed
40

niklas.baumgarten's avatar
niklas.baumgarten committed
41
# Link libraries
niklas.baumgarten's avatar
niklas.baumgarten committed
42
#find_package(FFTW3 REQUIRED)   (Can't be found but still seems to link in)
niklas.baumgarten's avatar
niklas.baumgarten committed
43
link_directories(${PROJECT_SOURCE_DIR}/sprng5/lib)
niklas.baumgarten's avatar
niklas.baumgarten committed
44

niklas.baumgarten's avatar
niklas.baumgarten committed
45
46
47
48
# Include directories
include_directories(${PROJECT_SOURCE_DIR}/sprng5/include)
include_directories(${PROJECT_SOURCE_DIR}/mlmc/src)

niklas.baumgarten's avatar
niklas.baumgarten committed
49
# Subdirectory
niklas.baumgarten's avatar
niklas.baumgarten committed
50
add_subdirectory(mlmc/src)
niklas.baumgarten's avatar
niklas.baumgarten committed
51
52

# Libraries
53
set(MLMC_LIBRARIES PDESOLVER MONTECARLO PROBLEMS GENERATORS sprng fftw3 m ${MPP_LIBRARIES})
54

niklas.baumgarten's avatar
niklas.baumgarten committed
55
# Executables
niklas.baumgarten's avatar
niklas.baumgarten committed
56
add_executable(MLMC-M++ mlmc/src/Main.cpp)
niklas.baumgarten's avatar
niklas.baumgarten committed
57
58

# Linking
niklas.baumgarten's avatar
niklas.baumgarten committed
59
target_link_libraries(MLMC-M++ ${MLMC_LIBRARIES})
niklas.baumgarten's avatar
niklas.baumgarten committed
60
61
62

# Tests
if (BUILD_MLMC_TESTS)
63
    add_subdirectory(mlmc/tests)
niklas.baumgarten's avatar
niklas.baumgarten committed
64
endif ()