-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (46 loc) · 1.66 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
cmake_minimum_required(VERSION 2.8.8)
set(PROJECT_NAME_STR tinge)
PROJECT(${PROJECT_NAME_STR} C CXX)
#TODO CHANGE THIS OPTION
set(CMAKE_VERBOSE_MAKEFILE ON)
# set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE Release)
find_package(Threads REQUIRED)
# flags
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -std=c++11 -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -std=c++11")
# include jaz and mpix
include_directories("${PROJECT_SOURCE_DIR}/")
include_directories("${PROJECT_SOURCE_DIR}/src/")
#
# add MPI includes and libraries
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
message(STATUS "Found MPI:")
message(STATUS " headers: ${MPI_INCLUDE_PATH}")
message(STATUS " libs: ${MPI_LIBRARIES}")
message(STATUS " link flags: ${MPI_LINK_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_COMPILE_FLAGS}")
set(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} ${MPI_LINK_FLAGS}")
# Compile
set(PROJECT_EXEC ${PROJECT_NAME_STR}-mi)
ADD_EXECUTABLE(${PROJECT_EXEC}
src/main.cxx
src/adj_build.cpp
src/iomanip.cpp
src/read_adj.cpp
src/read_exp.cpp
src/read_tfs.cpp
src/transform_data.cpp
src/write_adj.cpp
src/write_lab.cpp)
# Link MPI library
target_link_libraries(${PROJECT_EXEC} "${MPI_LIBRARIES}")
# Compile
ADD_EXECUTABLE(residuals
tools/residuals.cxx
src/iomanip.cpp
src/read_exp.cpp)
target_link_libraries(residuals "${MPI_LIBRARIES}")