Skip to content

Commit 156da00

Browse files
committed
WIP: Use findMPI earlier.
1 parent 248fef6 commit 156da00

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ if (C_COMPILER_NAME MATCHES "^[mM][pP][iI]")
282282
set (MPI_C_COMPILER "${CMAKE_C_COMPILER}")
283283
endif()
284284

285-
if(WIN32) # Only support building with GCC & GFortran using Intel MPI (OneAPI)
285+
find_package(MPI COMPONENTS C)
286+
287+
if(WIN32 AND NOT MPI_FOUND) # Only support building with GCC & GFortran using Intel MPI (OneAPI)
286288
# Here we assume Intel ONEAPI and the environment is loaded
287289
set( MPI_ASSUME_NO_BUILTIN_MPI TRUE )
288290
set( MPI_CXX_SKIP_MPICXX TRUE )

0 commit comments

Comments
 (0)