meson icon indicating copy to clipboard operation
meson copied to clipboard

Using Intel MPI with GCC

Open laochailan opened this issue 5 years ago • 8 comments

Describe the bug It seems that in Meson 0.54.1, it is not possible anymore to use the mpi dependency to detect IntelMPI when using gcc. This worked in 0.53 and is probably due to the change in behavior in baca2cd07d632dd5d944b2b364a297a0adf42028

To Reproduce

project('mpitest', 'c')
dependency('mpi')

with Intel mpicc in $PATH.

  1. run meson with CC=icc: succeeds
  2. run meson with CC=gcc
mpicc found: NO
Run-time dependency MPI found: NO (tried pkgconfig and config-tool)

Expected behavior Meson should use the available mpicc to find the correct MPI implementation independent of the compiler. I am also not sure if the comment # OpenMPI, which doesn't work with intel in the code is accurate. I remember using OpenMPI with icc working just fine. Detecting whether we have Intel or OpenMPI based on compiler type therefore does not work.

system parameters

  • native build
  • CentOS 7.7
  • Python 3.7.3
  • Meson 0.45.1
  • 1.9.0.git.kitware.dyndep-1.jobserver-1

laochailan avatar Apr 27 '20 09:04 laochailan

I am also not sure if the comment # OpenMPI, which doesn't work with intel in the code is accurate. I remember using OpenMPI with > icc working just fine. Detecting whether we have Intel or OpenMPI based on compiler type therefore does not work.

I think that @scivision and I decided that comment was wrong, but neither of us have had the time to make it work.

dcbaker avatar Apr 27 '20 20:04 dcbaker

That inline code comment is incorrect, I think I made that code comment but later realized it's not true.

MPI system configurations that should ultimately work "TODO" for Meson include:

  • Intel compiler with OpenMPI on Linux
  • Intel compiler with IntelMPI on Windows and Linux
  • Microsoft MPI with MinGW GCC on Windows for C and Fortran (I use this daily via CMake)
  • GCC with OpenMPI on Mac (via Homebrew)
  • GCC with OpenMPI or IntelMPI on Linux

there are more scenarios than this e.g. Visual Studio with MS-MPI and MPICH in general but the ones above are popular in the scientific computing realm.

scivision avatar Apr 28 '20 04:04 scivision

I also just discovered that Meson no longer detects MPICH in version 0.54. Since it did work in previous versions (including 0.53), how difficult would it be to make it work again?

While OpenMPI is popular, it cannot always be used- for example, OpenMPI has been broken for years in Ubuntu and is still unusable on Bionic. On Linux systems, MPICH is often the obvious choice if OpenMPI can't be used.

acroucher avatar May 26 '20 03:05 acroucher

Hi - I'm trying to install SU2 (which also uses the Meson build system) and I think I am having this same issue at the moment. On my HPC cluster, we have Intel MPI set up (mpirun and mpicc etc are accessible on the path), but are not being picked up by Meson.

Are there any workarounds for this at the moment (such as setting the path manually)? I'm not so familiar with Meson as I just used to specify the directory with Make previously. Thanks!

timjim333 avatar Jun 23 '20 08:06 timjim333

@acroucher if you have time, please consider seeing if #7373 also fixes MPICH. Thanks!

scivision avatar Jun 24 '20 05:06 scivision

@scivision I just tested building a simple MPI program on an Ubuntu Bionic VM with MPICH installed, which fails on Meson 0.54. Your #7373 changes worked fine. It detected MPICH correctly whether pkg-config was installed or not. Great stuff- thanks!

acroucher avatar Jun 24 '20 06:06 acroucher

This is still an issue. Thus, Meson is very bad for MPI. For example, if I understand correctly, packages using Meson and MPI cannot be built with mpich on conda-forge.

paugier avatar Aug 29 '24 08:08 paugier

Yes, I'm still pinning Meson at v 0.53 for this reason. mpich support has been broken since then.

acroucher avatar Aug 29 '24 22:08 acroucher