Skip to content

CMake: Fix Intel MPI detection on Windows

Christian Pfeiffer requested to merge ChrisTX/cmake:intel-mpi-windows-fix into master

Currently FindMPI suffers from two issues on Windows when used with Intel MPI:

  • The include path is being returned by mpiifort -show as -I"C:\Program Files...", which the script does not properly strip the quotes of. Using the MPI__INCLUDE_PATH then in turn adds another batch of quotes, breaking the build.
  • The MPI wrappers provided by Intel are batch scripts. This on its own isn't an issue, but find_program(...) can't find them if given without extension. By adding them to the names arrays, this fixes building Intel MPI with Intel C/C++/Fortran as well as enabling MSVC++ with Intel MPI automatically.

Merge request reports