CMakeLists.txt 1.69 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
set(SPACE_DIM 2 CACHE STRING "SPACE_DIM")
niklas.baumgarten's avatar
niklas.baumgarten committed
5
set(USE_FFTW ON CACHE STRING "USE_FFTW")
6
set(USE_SPLITTED_COMMS ON CACHE STRING "USE_SPLITTED_COMMS")
7
set(USE_SPACETIME OFF CACHE STRING "USE_SPACETIME")
niklas.baumgarten's avatar
niklas.baumgarten committed
8
9
#set(COMPILER_OPTIMIZE -O0 CACHE STRING "COMPILER_OPTIMIZE")
set(COMPILER_OPTIMIZE -O3 CACHE STRING "COMPILER_OPTIMIZE")
niklas.baumgarten's avatar
niklas.baumgarten committed
10
11
12
13
set(NO_DEPRECATED OFF CACHE STRING "NO_DEPRECATED")
set(AFFINE_LINEAR_TRAFO ON CACHE STRING "AFFINE_LINEAR_TRAFO")
set(BUILD_TESTS OFF CACHE STRING "BUILD_TESTS")
set(BUILD_MLMC_TESTS ON CACHE STRING "BUILD_MLMC_TESTS")
niklas.baumgarten's avatar
niklas.baumgarten committed
14
#---------------------------------------------------------------------------------------#
niklas.baumgarten's avatar
niklas.baumgarten committed
15

16
17
set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR})
set(CMAKE_BUILD_TYPE Release)
niklas.baumgarten's avatar
niklas.baumgarten committed
18
set(BUILD_SHARED_LIBS ON)
19
20
21
set(Tasmanian_ENABLE_RECOMMENDED ON)
set(Tasmanian_ENABLE_MPI ON)

niklas.baumgarten's avatar
niklas.baumgarten committed
22
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
23
24
add_subdirectory(${PROJECT_SOURCE_DIR}/TASMANIAN)

niklas.baumgarten's avatar
niklas.baumgarten committed
25
26
# include M++
include(mpp/CMakeLists.txt)
niklas.baumgarten's avatar
niklas.baumgarten committed
27

niklas.baumgarten's avatar
niklas.baumgarten committed
28
29
30
31
# Manage folder structure build folder
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/py)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtu)
niklas.baumgarten's avatar
niklas.baumgarten committed
32

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

niklas.baumgarten's avatar
niklas.baumgarten committed
37
# Include directories -> Todo move to kernel
niklas.baumgarten's avatar
niklas.baumgarten committed
38
39
include_directories(${PROJECT_SOURCE_DIR}/sprng5/include)

niklas.baumgarten's avatar
niklas.baumgarten committed
40
# Subdirectories
niklas.baumgarten's avatar
niklas.baumgarten committed
41
add_mpp_subdirectory(${PROJECT_SOURCE_DIR}/mlmc/src/)
niklas.baumgarten's avatar
niklas.baumgarten committed
42

niklas.baumgarten's avatar
niklas.baumgarten committed
43
# Executables
niklas.baumgarten's avatar
niklas.baumgarten committed
44
add_executable(MLMC-M++ mlmc/src/Main.cpp)
niklas.baumgarten's avatar
niklas.baumgarten committed
45
46

# Linking
niklas.baumgarten's avatar
niklas.baumgarten committed
47
target_link_libraries(MLMC-M++ MONTECARLO)
niklas.baumgarten's avatar
niklas.baumgarten committed
48
49
50

# Tests
if (BUILD_MLMC_TESTS)
niklas.baumgarten's avatar
niklas.baumgarten committed
51
    include_directories(mlmc/tests/)
niklas.baumgarten's avatar
niklas.baumgarten committed
52
    add_subdirectory(mlmc/tests/)
niklas.baumgarten's avatar
niklas.baumgarten committed
53
endif ()
niklas.baumgarten's avatar
niklas.baumgarten committed
54
55
56
57
58