Fortran MPI on Windows

Get MPI on Windows with C and Fortran by any one of: MS-MPI, Intel oneAPI or Windows Subsystem for Linux libopenmpi-dev. We often use MPI via MSYS2 with GCC / Gfortran compilers on Windows.

The “mpi_f08” interface is not yet available via MS-MPI.

To install MS-MPI: download and install Microsoft MS-MPI. Make mpiexec.exe available by adding to user PATH: %PROGRAMFILES%\Microsoft MPI\Bin – this is needed even when using MSYS2. Install MSYS2 MS-MPI library from the MSYS2 Terminal:

pacman -S mingw-w64-x86_64-msmpi

OpenMPI is not currently available for native Windows. MPICH is not directly buildable on Windows, even with MSYS2.

Upon installing or updating Intel oneAPI compilers and libraries on Windows, you may experience CMake failing to find MPI for MinGW. This happens because Intel compilers put Intel MPI on the system PATH. Fix this by removing Intel MPI from the system PATH and use the Intel Compiler shell instead, which provides all the needed directories.