-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
89 lines (74 loc) · 3.68 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
cmake_minimum_required(VERSION 2.8)
project(port_authority)
set(CMAKE_C_COMPILER mpicc)
set(CMAKE_CXX_COMPILER mpic++)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++14")
set(CMAKE_CXX_FLAGS_DEBUG "-g -pedantic -pedantic-errors")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
if(CMAKE_BUILD_TYPE MATCHES "Release")
add_definitions(-DARMA_NO_DEBUG)
endif(CMAKE_BUILD_TYPE MATCHES "Release")
# use OpenMP if compiler supports it
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
find_package(MPI REQUIRED)
find_package(Boost COMPONENTS program_options REQUIRED)
set(CMAKE_BINARY_DIR build)
set(LIBRARY_OUTPUT_PATH lib)
set(EXECUTABLE_OUTPUT_PATH bin)
include_directories(include)
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
include_directories(${Boost_INCLUDE_DIR})
file(GLOB libsources "src/*.cpp" "include/*.cpp")
add_library(port_authority SHARED ${libsources})
target_link_libraries(port_authority armadillo yaml-cpp)
set(PROJECT_LIBS m armadillo port_authority ${MPI_CXX_LIBRARIES} ${Boost_LIBRARIES})
add_subdirectory(test test)
add_executable(spring_linear examples/spring/spring_linear.cpp)
add_executable(spring_linear_mpi examples/spring/spring_linear_mpi.cpp)
add_executable(spring_linear_mpi_study examples/spring/spring_linear_mpi_study.cpp)
add_executable(spring_quad_mpi examples/spring/spring_quad_mpi.cpp)
add_executable(spring_quad_mpi_study examples/spring/spring_quad_mpi_study.cpp)
add_executable(two_state examples/two-state/two_state.cpp)
add_executable(two_state_ic_study examples/two-state/two_state_ic_study.cpp)
add_executable(spring_linear_kawasaki_mpi examples/spring/spring_linear_kawasaki_mpi.cpp)
add_executable(spring_quad_kawasaki_mpi examples/spring/spring_quad_kawasaki_mpi.cpp)
add_executable(spring_linear_kawasaki_suite examples/suite/spring_linear_kawasaki_suite.cpp)
add_executable(lj_liquid_Ar examples/lj/lj_liquid_Ar.cpp)
add_executable(lj_liquid_Ar_debug examples/lj/lj_liquid_Ar_debug.cpp)
add_executable(avg_pressure_liquid_Ar examples/lj/avg_pressure_liquid_Ar.cpp)
add_executable(lj-lookup_liquid examples/lj-lookup/lj-lookup_liquid.cpp)
add_executable(lj_liquid_Ar_cv examples/lj/lj_liquid_Ar_cv.cpp)
add_executable(tst examples/spring/tst.cpp)
add_executable(harmonic1d examples/harmonic/harmonic1d.cpp)
add_executable(harmonic6d examples/harmonic/harmonic6d.cpp)
if (UNIX)
target_link_libraries(port_authority m)
target_link_libraries(lj_liquid_Ar_debug m)
target_link_libraries(avg_pressure_liquid_Ar m)
target_link_libraries(tst m)
target_link_libraries(harmonic1d m)
target_link_libraries(harmonic6d m)
endif (UNIX)
target_link_libraries(spring_linear ${PROJECT_LIBS})
target_link_libraries(spring_linear_mpi ${PROJECT_LIBS})
target_link_libraries(spring_linear_mpi_study ${PROJECT_LIBS})
target_link_libraries(spring_quad_mpi ${PROJECT_LIBS})
target_link_libraries(spring_quad_mpi_study ${PROJECT_LIBS})
target_link_libraries(two_state armadillo ${PROJECT_LIBS})
target_link_libraries(two_state_ic_study ${PROJECT_LIBS})
target_link_libraries(spring_linear_kawasaki_mpi ${PROJECT_LIBS})
target_link_libraries(spring_quad_kawasaki_mpi ${PROJECT_LIBS})
target_link_libraries(spring_linear_kawasaki_suite ${PROJECT_LIBS})
target_link_libraries(lj_liquid_Ar ${PROJECT_LIBS})
target_link_libraries(lj_liquid_Ar_debug ${PROJECT_LIBS})
target_link_libraries(avg_pressure_liquid_Ar ${PROJECT_LIBS})
target_link_libraries(lj-lookup_liquid ${PROJECT_LIBS})
target_link_libraries(lj_liquid_Ar_cv ${PROJECT_LIBS})
target_link_libraries(tst ${PROJECT_LIBS})
target_link_libraries(harmonic1d ${PROJECT_LIBS})
target_link_libraries(harmonic6d ${PROJECT_LIBS})
include(CTest)