File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,14 @@ set(KOKKOSCOMM_ENABLE_PERFTESTS ${KokkosComm_ENABLE_PERFTESTS} CACHE BOOL "" FOR
6868set (KOKKOSCOMM_ENABLE_TESTS ${KokkosComm_ENABLE_TESTS} CACHE BOOL "" FORCE)
6969set (KOKKOSCOMM_ENABLE_MPI ${KokkosComm_ENABLE_MPI} CACHE BOOL "" FORCE)
7070
71+ if (KOKKOSCOMM_HAS_TRILINOS)
72+ if (TPL_ENABLE_MPI)
73+ if (NOT KOKKOSCOMM_ENABLE_MPI)
74+ message (WARNING "TPL_ENABLE_MPI is set. Overriding KOKKOSCOMM_ENABLE_MPI to ON" )
75+ set (KOKKOSCOMM_ENABLE_MPI ON CACHE BOOL "" FORCE)
76+ endif ()
77+ endif ()
78+ endif ()
7179
7280if (KOKKOSCOMM_HAS_TRILINOS)
7381 # Trilinos will "find" Kokkos and MPI
Original file line number Diff line number Diff line change 1717add_library (KokkosComm INTERFACE )
1818add_library (KokkosComm::KokkosComm ALIAS KokkosComm)
1919
20-
21-
2220# Public headers
2321target_sources (
2422 KokkosComm
@@ -115,8 +113,10 @@ kokkoscomm_check_and_add_compile_options(KokkosCommFlags -Wno-gnu-zero-variadic-
115113# linked before CUDA and friends, so link MPI before Kokkos.
116114# TODO_CMAKE: in CMake 3.31, we can use LINK_LIBRARIES_STRATEGY to explicitly ask CMake not to
117115# reorder how libraries are linked. In the mean time, we have to just hope (?).
118- if (KOKKOSCOMM_ENABLE_MPI)
119- target_link_libraries (KokkosComm INTERFACE MPI::MPI_CXX)
116+ if (NOT KOKKOSCOMM_HAS_TRILINOS)
117+ if (KOKKOSCOMM_ENABLE_MPI)
118+ target_link_libraries (KokkosComm INTERFACE MPI::MPI_CXX)
119+ endif ()
120120endif ()
121121target_link_libraries (KokkosComm INTERFACE KokkosComm::KokkosCommFlags Kokkos::kokkos)
122122
You can’t perform that action at this time.
0 commit comments