Skip to content

Commit

Permalink
make MPI find_package call more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Feb 15, 2023
1 parent e0c7983 commit 8c4cfd8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ endif()
set(GINKGO_HAVE_GPU_AWARE_MPI OFF)
set(GINKGO_FORCE_SPMV_BLOCKING_COMM OFF)
if(GINKGO_BUILD_MPI)
find_package(MPI REQUIRED)
find_package(MPI 3.1 COMPONENTS CXX REQUIRED)
if(GINKGO_FORCE_GPU_AWARE_MPI)
set(GINKGO_HAVE_GPU_AWARE_MPI ON)
else()
Expand Down
2 changes: 1 addition & 1 deletion cmake/GinkgoConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ endif()

# Check for MPI if it is enabled
if(GINKGO_BUILD_MPI)
find_package(MPI REQUIRED)
find_package(MPI 3.1 COMPONENTS CXX REQUIRED)
endif()

# HIP and OpenMP depend on Threads::Threads in some circumstances, but don't find it
Expand Down
2 changes: 1 addition & 1 deletion cmake/autodetect_executors.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (NOT DEFINED GINKGO_BUILD_OMP)
endif()

if (NOT DEFINED GINKGO_BUILD_MPI)
find_package(MPI 3.1)
find_package(MPI 3.1 COMPONENTS CXX)
if(MPI_FOUND)
message(STATUS "Enabling MPI support")
set(GINKGO_HAS_MPI ON)
Expand Down
2 changes: 1 addition & 1 deletion cmake/create_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(ginkgo_create_gtest_mpi_main)
target_sources(gtest_mpi_main
PRIVATE
${PROJECT_SOURCE_DIR}/core/test/mpi/gtest/mpi_listener.cpp)
find_package(MPI REQUIRED)
find_package(MPI 3.1 COMPONENTS CXX REQUIRED)
target_link_libraries(gtest_mpi_main PRIVATE GTest::GTest MPI::MPI_CXX)
endfunction(ginkgo_create_gtest_mpi_main)

Expand Down

0 comments on commit 8c4cfd8

Please sign in to comment.