meson
meson copied to clipboard
Using Intel MPI with GCC
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.
- run meson with CC=icc: succeeds
- 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
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.
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.
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.
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!
@acroucher if you have time, please consider seeing if #7373 also fixes MPICH. Thanks!
@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!
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.
Yes, I'm still pinning Meson at v 0.53 for this reason. mpich support has been broken since then.