Skip to content

Commit 60a1dc0

Browse files
authored
Simplify MPI linkage handling (#591)
- find the C++ MPI component when configuring - simplify MPI linkage and drop obsolete flag handling
1 parent eaac6b7 commit 60a1dc0

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

cmake/mpi.cmake

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
find_package(MPI REQUIRED)
1+
find_package(MPI REQUIRED COMPONENTS CXX)
22
if(NOT MPI_FOUND)
33
message(FATAL_ERROR "MPI NOT FOUND")
44
endif()
55

66
function(ppc_link_mpi exec_func_lib)
7-
if(MPI_COMPILE_FLAGS)
8-
set_target_properties(${exec_func_lib} PROPERTIES COMPILE_FLAGS
9-
"${MPI_COMPILE_FLAGS}")
10-
endif(MPI_COMPILE_FLAGS)
11-
12-
if(MPI_LINK_FLAGS)
13-
set_target_properties(${exec_func_lib} PROPERTIES LINK_FLAGS
14-
"${MPI_LINK_FLAGS}")
15-
endif(MPI_LINK_FLAGS)
16-
target_include_directories(${exec_func_lib} PUBLIC ${MPI_INCLUDE_PATH})
17-
target_link_libraries(${exec_func_lib} PUBLIC ${MPI_LIBRARIES})
7+
target_link_libraries(${exec_func_lib} PUBLIC MPI::MPI_CXX)
188
endfunction()

0 commit comments

Comments
 (0)