Skip to content

Commit f96c733

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

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/win-ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535

3636
- name: MPI info
3737
run: |
38-
echo "${{ steps.setup-mpi.outputs.mpi }}"
3938
set -o verbose
4039
# mpiexec -help
4140
type mpiexec
@@ -46,8 +45,13 @@ jobs:
4645
# cat "${I_MPI_ROOT}/bin/mpifc.bat"
4746
# mpifc.bat -show
4847
# mpicc.bat -show
49-
mpifc.bat -version || echo "ifort not installed"
50-
mpicc.bat -version || echo "icc not installed"
48+
export I_MPI_CC=gcc
49+
export I_MPI_FC=gfortran
50+
export CMPLR_ROOT=/usr/bin
51+
gfortran --version
52+
gcc --version
53+
mpifc.bat --version || echo "ifort not installed"
54+
mpicc.bat --version || echo "icc not installed"
5155
set +o verbose
5256
# echo The following environment variables are used:
5357
# echo CMPLR_ROOT Intel^(R^) Compiler installation directory path
@@ -62,6 +66,8 @@ jobs:
6266
6367
- name: Build and Test
6468
run: |
69+
export I_MPI_CC=gcc
70+
export I_MPI_FC=gfortran
6571
mkdir build
6672
cmake -Wdev -G "Unix Makefiles" -S . -B build -DCMAKE_INSTALL_PREFIX="${HOME}/apps/OpenCoarrays" -DCMAKE_BUILD_TYPE:STRING="Debug"
6773
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)