Configure eo-conf.cmake to enable or disable MPI use.
This commit is contained in:
parent
abc18a653d
commit
2851cad471
2 changed files with 33 additions and 3 deletions
|
|
@ -5,3 +5,10 @@ SET(PROJECT_VERSION_MINOR 3)
|
||||||
SET(PROJECT_VERSION_PATCH 0)
|
SET(PROJECT_VERSION_PATCH 0)
|
||||||
SET(PROJECT_VERSION_MISC "-edge")
|
SET(PROJECT_VERSION_MISC "-edge")
|
||||||
|
|
||||||
|
# If you plan to use MPI, precise here where are the static libraries from
|
||||||
|
# openmpi and boost::mpi.
|
||||||
|
|
||||||
|
SET(WITH_MPI FALSE CACHE BOOL "Use mpi ?" FORCE)
|
||||||
|
SET(MPI_DIR "put root directory of openmpi here" CACHE PATH "OpenMPI directory" FORCE)
|
||||||
|
SET(BOOST_DIR "put root directory of boost here" CACHE PATH "Boost directory" FORCE)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,30 @@
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
### 2) Define the eo target
|
### 2) Optionnal: add MPI and Boost MPI dependencies.
|
||||||
|
######################################################################################
|
||||||
|
|
||||||
|
IF(WITH_MPI)
|
||||||
|
MESSAGE("[EO] Compilation with MPI and BoostMPI.")
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_COMPILER "${MPI_DIR}/bin/mpicxx")
|
||||||
|
|
||||||
|
# headers location
|
||||||
|
INCLUDE_DIRECTORIES(${MPI_DIR}/include)
|
||||||
|
INCLUDE_DIRECTORIES(${BOOST_DIR}/include)
|
||||||
|
|
||||||
|
# lib location
|
||||||
|
LINK_DIRECTORIES(${MPI_DIR}/lib)
|
||||||
|
LINK_DIRECTORIES(${BOOST_DIR}/lib)
|
||||||
|
|
||||||
|
# for conditional compilation in code
|
||||||
|
ADD_DEFINITIONS(-DWITH_MPI)
|
||||||
|
|
||||||
|
LINK_LIBRARIES(boost_mpi boost_serialization)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
######################################################################################
|
||||||
|
### 3) Define the eo target
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
SET(EO_LIB_OUTPUT_PATH ${EO_BINARY_DIR}/lib)
|
SET(EO_LIB_OUTPUT_PATH ${EO_BINARY_DIR}/lib)
|
||||||
|
|
@ -27,14 +50,14 @@ FILE(GLOB HDRS *.h eo)
|
||||||
INSTALL(FILES ${HDRS} DESTINATION include/eo COMPONENT headers)
|
INSTALL(FILES ${HDRS} DESTINATION include/eo COMPONENT headers)
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
### 3) Optionnal: define your target(s)'s version: no effect for windows
|
### 4) Optionnal: define your target(s)'s version: no effect for windows
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
SET(EO_VERSION ${GLOBAL_VERSION})
|
SET(EO_VERSION ${GLOBAL_VERSION})
|
||||||
SET_TARGET_PROPERTIES(eo PROPERTIES VERSION "${EO_VERSION}")
|
SET_TARGET_PROPERTIES(eo PROPERTIES VERSION "${EO_VERSION}")
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
### 4) Where must cmake go now ?
|
### 5) Where must cmake go now ?
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(do)
|
ADD_SUBDIRECTORY(do)
|
||||||
|
|
|
||||||
Reference in a new issue