Skip to content

Commit

Permalink
added cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
srirampc committed Aug 2, 2018
1 parent fc49201 commit f5e5d2e
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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}")


0 comments on commit f5e5d2e

Please sign in to comment.