Skip to content

Commit a4f8546

Browse files
committed
examples/mpi: use the MPI component
Also drop the explicit `MPI::MPI_C` link as `conduit::conduit_mpi` already does this.
1 parent 501388f commit a4f8546

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/examples/using-with-cmake-mpi/CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,14 @@ endif()
5858
#
5959
find_package(Conduit REQUIRED
6060
NO_DEFAULT_PATH
61-
PATHS ${CONDUIT_DIR}/lib/cmake/conduit)
61+
PATHS ${CONDUIT_DIR}/lib/cmake/conduit
62+
COMPONENTS MPI)
6263

63-
# make sure we have mpi, since we are going to use
64-
# conduits mpi features
65-
if(NOT MPI_FOUND)
66-
find_package(MPI COMPONENTS C)
64+
if(NOT Conduit_MPI_FOUND)
65+
message(STATUS "This example requires an MPI-enabled Conduit")
66+
return()
6767
endif()
6868

69-
7069
################################################################
7170
# Option 2: import conduit using find_package search
7271
################################################################
@@ -91,8 +90,7 @@ add_executable(conduit_mpi_example conduit_mpi_example.cpp)
9190

9291
# link to conduit targets
9392
target_link_libraries(conduit_mpi_example conduit::conduit
94-
conduit::conduit_mpi
95-
MPI::MPI_C)
93+
conduit::conduit_mpi)
9694

9795
# if you are using conduit's python CAPI capsule interface
9896
# target_link_libraries(conduit_mpi_example conduit::conduit_python)

0 commit comments

Comments
 (0)