OpenMPI&cmake配置

2019-03-12 16:52:29 浏览数 (1)

MPI程序编译时的Cmake

代码语言:javascript复制
cmake_minim_required(VERSION 2.7)
project(ITK_MPI)

find_package(MPI REQUIRED)

include_directories(${MPI_INCLUDE_PATH})

add_executable(hello hello.cpp)
target_link_libraries(hello ${MPI_LIBRARIES})

if(MPI_COMPILE_FLAGS)
  set_target_properties(hello PROPERTIES
    COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
endif()

if(MPI_LINK_FLAGS)
  set_target_properties(hello PROPERTIES
    LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()

0 人点赞