CMakeLists.txt 1.65 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
22
23
set(Tasmanian_ENABLE_RECOMMENDED ON)
set(Tasmanian_ENABLE_MPI ON)

add_subdirectory(${PROJECT_SOURCE_DIR}/TASMANIAN)

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

niklas.baumgarten's avatar
niklas.baumgarten committed
27
28
29
30
# 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
31

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

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

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

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

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

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