Skip to content

Commit 267d3bd

Browse files
committed
WIP: Use findMPI earlier.
1 parent 248fef6 commit 267d3bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
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)
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 )
@@ -319,7 +321,6 @@ if(WIN32) # Only support building with GCC & GFortran using Intel MPI (OneAPI)
319321
set(MPI_Fortran_HAVE_F08_MODULE FALSE)
320322

321323
endif()
322-
find_package( MPI )
323324

324325
if ( (NOT MPI_C_FOUND) OR (NOT MPI_Fortran_FOUND) OR (NOT MPIEXEC_EXECUTABLE))
325326
# Get default install location of MPICH from install.sh
@@ -339,7 +340,7 @@ MPIEXEC_EXECUTABLE = ${MPIEXEC_EXECUTABLE}
339340
HINTS "${FTN_COMPILER_DIR}" "${C_COMPILER_DIR}"
340341
PATH_SUFFIXES bin)
341342
set ( MPI_HOME "${MPI_HOME}" "${MY_MPI_EXEC}" "${MY_MPI_EXEC}/.." )
342-
find_package( MPI REQUIRED )
343+
# find_package( MPI REQUIRED )
343344
endif()
344345
list(REMOVE_DUPLICATES MPI_Fortran_INCLUDE_DIRS)
345346

0 commit comments

Comments
 (0)