fixed CMake + added compile options for communication mode in wrapper

parent abc54a73
......@@ -12,6 +12,11 @@ include_directories(${MPI_INCLUDE_PATH})
#option(ENABLE_DEBUG "Compile debug mode" OFF)
option(ENABLE_SMARTMPI "Enables support for SmartMPI library" OFF)
set(COMMUNICATION_MODE_STRINGS "client_server_mpi" "client_server_gpi")
set(SMARTMPI_COMMUNICATION_MODE "client_server_mpi" CACHE STRING "default communication mode")
set_property(CACHE SMARTMPI_COMMUNICATION_MODE PROPERTY STRINGS ${COMMUNICATION_MODE_STRINGS})
#if(ENABLE_DEBUG)
# set(CMAKE_CXX_COMPILER_FLAGS ${CMAKE_CXX_COMPILER_FLAGS} " -DENABLE_ASSERTS")
#endif()
......@@ -44,9 +49,19 @@ add_library(tmpi SHARED
if(ENABLE_SMARTMPI)
find_library(SMARTMPI smartmpi HINTS "$ENV{SMARTMPI_PATH}/build/smartmpi_lib")
target_include_directories(tmpi PUBLIC $ENV{SMARTMPI_PATH}/smartmpi_lib)
target_link_libraries(tmpi PUBLIC ${SMARTMPI})
target_include_directories(tmpi PUBLIC ${SMARTMPI}/smartmpi_lib)
target_link_directories(tmpi PUBLIC ${SMARTMPI}/build/smartmpi_lib)
target_link_libraries(tmpi PUBLIC smartmpi)
set(CMAKE_CXX_COMPILER_FLAGS ${CMAKE_CXX_COMPILER_FLAGS} "-DUSE_SMARTMPI")
if(SMARTMPI_COMMUNICATION_MODE STREQUAL "client_server_mpi")
target_compile_definitions(tmpi PUBLIC COMMUNICATION_MODE=0)
endif()
if(SMARTMPI_COMMUNICATION_MODE STREQUAL "client_server_gpi")
target_compile_definitions(tmpi PUBLIC COMMUNICATION_MODE=2)
endif()
endif()
target_compile_options(tmpi PRIVATE ${CMAKE_CXX_COMPILER_FLAGS})
......
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