Commit 081896da authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

updated cmake run

parent d2426525
cmake_minimum_required(VERSION 3.5.1) cmake_minimum_required(VERSION 3.5.1)
project(MLMC) project(MLMC)
#---------------------------------------------------------------------------------------#
set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O0") # Compiler options
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O1") #set(CXX_VERSION "17")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O2") #set(COMPILER_VERSION "c++")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") #set(COMPILER_VERSION "gnu++")
#set(COMPILER_OPTIMIZE "-O0")
#set(COMPILER_OPTIMIZE "-O1")
#set(COMPILER_OPTIMIZE "-O2")
set(COMPILER_OPTIMIZE "-O3")
#set(COMPILER_OPTIMIZE "-Ofast")
option(NO_DEPRECATED "Suppress deprecated warnings" ON)
option(NO_DEPRECATED "Suppress deprecated warnings" OFF) # Problem options
option(BUILD_TESTS "Build test executables" ON) option(PROBLEM_NO_TIME "Time independent problem" ON)
option(USE_CXSC "Use interval arithmetic library cxsc" OFF)
option(PROBLEM_NO_TIME "Time independent problem" OFF)
option(PROBLEM_1D "1 dimensional problem" OFF) option(PROBLEM_1D "1 dimensional problem" OFF)
option(PROBLEM_2D "2 dimensional problem" OFF) 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
option(USE_SUPERLU30 "Use SuperLU 3.0 (old version)" OFF) option(USE_SUPERLU30 "Use SuperLU 3.0 (old version)" OFF)
option(AFFINE_LINEAR_TRAFO "Only affine linear transformations" OFF)
# Test options
option(BUILD_TESTS "Build test executables" OFF)
option(BUILD_MLMC_TESTS "Build mlmc test executables" ON)
#---------------------------------------------------------------------------------------#
# Set path for mpp # Set path for mpp
set(PROJECT_MPP_DIR ${PROJECT_SOURCE_DIR}/mpp) set(PROJECT_MPP_DIR ${PROJECT_SOURCE_DIR}/mpp)
...@@ -26,19 +42,24 @@ include(${PROJECT_MPP_DIR}/CMakeListsMpp.inc) ...@@ -26,19 +42,24 @@ include(${PROJECT_MPP_DIR}/CMakeListsMpp.inc)
#find_package(FFTW3 REQUIRED) (Can't be found but still seems to link in) #find_package(FFTW3 REQUIRED) (Can't be found but still seems to link in)
link_directories(${PROJECT_SOURCE_DIR}/sprng5/lib) link_directories(${PROJECT_SOURCE_DIR}/sprng5/lib)
# Include directories # Include directories
include_directories(${PROJECT_SOURCE_DIR}/sprng5/include) include_directories(${PROJECT_SOURCE_DIR}/sprng5/include)
include_directories(${PROJECT_SOURCE_DIR}/mlmc/src) include_directories(${PROJECT_SOURCE_DIR}/mlmc/src)
# Subdirectories # Subdirectory
add_subdirectory(mlmc/src) add_subdirectory(mlmc/src)
add_subdirectory(tests)
#---------------------------------------------------------------------------------------# # Libraries
set(MLMC_LIBRARIES MLMC sprng fftw3 m ${MPP_LIBRARIES})
# Executables # Executables
add_executable(MLMC-M++ mlmc/src/Main.cpp) add_executable(MLMC-M++ mlmc/src/Main.cpp)
# Linking # Linking
target_link_libraries(MLMC-M++ MLMC sprng SRC LIB_PS ${SUPERLU} target_link_libraries(MLMC-M++ ${MLMC_LIBRARIES})
${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} fftw3 m)
#---------------------------------------------------------------------------------------# # Tests
if (BUILD_MLMC_TESTS)
add_subdirectory(tests)
endif ()
# Includes for mlmc tests
#---------------------------------------------------------------------------------------#
# Manage folder structure build folder # Manage folder structure build folder
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/vtk) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/gp) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/gp)
...@@ -8,9 +5,6 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/py) ...@@ -8,9 +5,6 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/py)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/log) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/log)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/dual) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/dual)
set(libs MLMC sprng SRC LIB_PS fftw3 m ${SUPERLU}
${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GTEST_LIB})
# Test Executables # Test Executables
add_executable(TestMainProgram TestMainProgram.cpp) add_executable(TestMainProgram TestMainProgram.cpp)
add_executable(BenchmarkEllipticResults BenchmarkEllipticResults.cpp) add_executable(BenchmarkEllipticResults BenchmarkEllipticResults.cpp)
...@@ -18,8 +12,7 @@ add_executable(BenchmarkTransportResults BenchmarkTransportResults.cpp) ...@@ -18,8 +12,7 @@ add_executable(BenchmarkTransportResults BenchmarkTransportResults.cpp)
add_executable(TestMultilevelPlotter TestMultilevelPlotter.cpp) add_executable(TestMultilevelPlotter TestMultilevelPlotter.cpp)
# Linking # Linking
target_link_libraries(TestMainProgram ${libs}) target_link_libraries(TestMainProgram ${MLMC_LIBRARIES} ${GTEST_LIB})
target_link_libraries(BenchmarkEllipticResults ${libs}) target_link_libraries(BenchmarkEllipticResults ${MLMC_LIBRARIES} ${GTEST_LIB})
target_link_libraries(BenchmarkTransportResults ${libs}) target_link_libraries(BenchmarkTransportResults ${MLMC_LIBRARIES} ${GTEST_LIB})
target_link_libraries(TestMultilevelPlotter ${libs}) target_link_libraries(TestMultilevelPlotter ${MLMC_LIBRARIES} ${GTEST_LIB})
#---------------------------------------------------------------------------------------#
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment