Commit 8959bf4e authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

new build structure

parent 04011c9f
......@@ -2,67 +2,37 @@ cmake_minimum_required(VERSION 3.5.1)
project(MLMC)
#---------------------------------------------------------------------------------------#
# Google test (Placed here to not compile it with mpiCC)
add_subdirectory(mpp/googletest)
include_directories(${PROJECT_BINARY_DIR}/mpp/googletest/googletest/include)
include_directories(${PROJECT_BINARY_DIR}/mpp/googletest/googlemock/include)
set(GTEST_LIB gtest gtest_main gmock gmock_main)
#---------------------------------------------------------------------------------------#
# MPI
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
set(CMAKE_C_COMPILER ${MPI_C_COMPILER})
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS})
set(CMAKE_BUILD_TYPE distribution)
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-Ofast")
set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O0")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O0")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O1")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O2")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3")
set(CMAKE_CXX_FLAGS "-fPIC -g -Wno-deprecated -std=gnu++11")
#set(CMAKE_CXX_FLAGS "-fPIC -g -Wno-deprecated -Wall -std=gnu++11")
#---------------------------------------------------------------------------------------#
# Blas Lapack
#find_package(FFTW3 REQUIRED) (Can't be found but still seems to link in)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
#---------------------------------------------------------------------------------------#
option(NO_DEPRECATED "Suppress deprecated warnings" OFF)
# Manage folder structure build folder
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/dual)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/gp)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/py)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/log)
#---------------------------------------------------------------------------------------#
option(BUILD_TESTS "Build test executables" 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_2D "2 dimensional problem" OFF)
option(USE_SUPERLU30 "Use SuperLU 3.0 (old version)" OFF)
option(AFFINE_LINEAR_TRAFO "Only affine linear transformations" OFF)
# Set path for mpp
set(PROJECT_MPP_DIR ${PROJECT_SOURCE_DIR}/mpp)
# Include settings for mpp
include(${PROJECT_MPP_DIR}/CMakeListsMpp.inc)
# Link libraries
#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}/mpp/superlu/lib)
if (UNIX AND NOT APPLE)
set(SUPERLU superlu_4.3)
elseif (APPLE)
set(SUPERLU superlu_4.3_mac10.10)
elseif (WIN32)
set(SUPERLU superlu_4.3_cygwin)
endif ()
#---------------------------------------------------------------------------------------#
# Include directories
include_directories(${PROJECT_SOURCE_DIR}/sprng5/include)
include_directories(${PROJECT_SOURCE_DIR}/mlmc/src)
include_directories(${PROJECT_SOURCE_DIR}/mpp/src)
#---------------------------------------------------------------------------------------#
# Subdirectories
add_subdirectory(mpp)
add_subdirectory(mlmc/src)
#---------------------------------------------------------------------------------------#
......@@ -81,4 +51,4 @@ target_link_libraries(MLMC-M++ MLMC sprng SRC LIB_PS ${SUPERLU} blas lapack fftw
#target_link_libraries(TestCirculantEmbedding MLMC sprng SRC LIB_PS ${SUPERLU}
# blas lapack fftw3 m ${GTEST_LIB})
#target_link_libraries(TestRNManager MLMC sprng fftw3 m ${GTEST_LIB})
#---------------------------------------------------------------------------------------#
#---------------------------------------------------------------------------------------#
\ No newline at end of file
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