Skip to content

Commit baf1dfc

Browse files
committed
WIP: Use findMPI earlier.
1 parent 27f59b2 commit baf1dfc

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/win-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ jobs:
4646
# cat "${I_MPI_ROOT}/bin/mpifc.bat"
4747
# mpifc.bat -show
4848
# mpicc.bat -show
49-
mpifc.bat -version || echo "ifort not installed"
50-
mpicc.bat -version || echo "icc not installed"
49+
export I_MPI_CC=gcc
50+
export I_MPI_FC=gfortran
51+
mpifc.bat --version || echo "ifort not installed"
52+
mpicc.bat --version || echo "icc not installed"
5153
set +o verbose
5254
# echo The following environment variables are used:
5355
# echo CMPLR_ROOT Intel^(R^) Compiler installation directory path
@@ -62,6 +64,8 @@ jobs:
6264
6365
- name: Build and Test
6466
run: |
67+
export I_MPI_CC=gcc
68+
export I_MPI_FC=gfortran
6569
mkdir build
6670
cmake -Wdev -G "Unix Makefiles" -S . -B build -DCMAKE_INSTALL_PREFIX="${HOME}/apps/OpenCoarrays" -DCMAKE_BUILD_TYPE:STRING="Debug"
6771
cmake --build build -j

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)