Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open MPI: mpif90 doesn't -I/usr/include #49322

Closed
meator opened this issue Mar 16, 2024 · 5 comments
Closed

Open MPI: mpif90 doesn't -I/usr/include #49322

meator opened this issue Mar 16, 2024 · 5 comments
Labels
bug Something isn't working needs-testing Testing a PR or reproducing an issue needed

Comments

@meator
Copy link
Contributor

meator commented Mar 16, 2024

Is this a new report?

Yes

System Info

Void 6.6.21_1 x86_64 GenuineIntel uptodate hold rrrdDFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Package(s) Affected

openmpi-5.0.2_1

Does a report exist for this bug with the project's home (upstream) and/or another distro?

open-mpi/ompi#12257

Expected behaviour

Having the following code:

      program main
#include "mpif.h"
       integer ierr
       call mpi_init(ierr)
      end

I expect it to compile with

mpif90 code.F90

Note that I didn't make up this code, it comes from a configure script of a library I'd like to package which tries to test whether fortran compiler works by compiling the aforementioned code.

Actual behaviour

It doesn't compile. The following error message is shown:

/usr/include/mpif.h:56:0:

   56 |       include 'mpif-config.h'
      |
Fatal Error: Cannot open included file 'mpif-config.h'
compilation terminated.

It's obvious that it's caused by a missing include. It compiles with

mpif90 code.F90 -I/usr/include

To my knowledge (and please correct me if I'm wrong), mpif90 (like all other MPI wrappers which link to /usr/bin/opal_wrapper) should wrap the underlying compiler while providing all flags needed for compiling with MPI.

mpif90 --showme

shows

gfortran -I/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 -Wl,--enable-new-dtags -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi

which makes no mention of /usr/include.

I don't have proof of this, but I believe this is a regression, because it used to work in the past, so I assume an openmpi update broke it.

I've done some tests and it works without -I/usr/include on a Debian Docker container. Debian packages openmpi quite differently, its --showme looks like this:

gfortran -I/usr/lib/x86_64-linux-gnu/openmpi/lib/../../fortran/gfortran-mod-15/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/lib -L/usr/lib/x86_64-linux-gnu/openmpi/lib/fortran/gfortran -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lopen-rte -lopen-pal -lhwloc -levent_core -levent_pthreads -lm -lz

but it shows that it should work out of the box I believe.

Ping maintainer @ahesford

Steps to reproduce

Mentioned above.

@meator meator added bug Something isn't working needs-testing Testing a PR or reproducing an issue needed labels Mar 16, 2024
@meator meator changed the title Open MPI: mpiff77 doesn't -I/usr/include Open MPI: mpif90 doesn't -I/usr/include Mar 16, 2024
@oreo639
Copy link
Member

oreo639 commented Mar 16, 2024

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

open-mpi/ompi#12257

@meator
Copy link
Contributor Author

meator commented Mar 16, 2024

Thanks for including the upstream issue. I haven't noticed that.

@ahesford
Copy link
Member

Note that most C and C++ compilers look in /usr/include implicitly. Thus, mpicc should work automatically without the wrapper passing -I/usr/include. (Indeed, mpicc --showme shows no include arguments at all.) I'm not sure gfortran makes (or should make) the same assumption. Also note that the include file itself, mpif.h, seems to recommend explicitly passing -I$OMPI_HOME/include for a suitably defined $OMPI_HOME.

Let's see how the upstream issue shakes out before trying to resolve this regression.

@oreo639
Copy link
Member

oreo639 commented Mar 16, 2024

Let's see how the upstream issue shakes out before trying to resolve this regression.

It's from January with no response from the maintainers and the person who made the issue already worked around the issue on Arch Linux's side, so I'm not sure there will be much movement as-is.

@ahesford
Copy link
Member

I'll pull the Arch patch for 5.0.3 shortly. If, in the future, upstream explicitly rejects this or a similar fix, I'll drop the patch and users will have no choice but to specify -I/usr/include for FORTRAN programs.

atweiden added a commit to atweiden/voidpkgs that referenced this issue Apr 12, 2024
snwnde pushed a commit to snwnde/void-packages that referenced this issue Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-testing Testing a PR or reproducing an issue needed
Projects
None yet
Development

No branches or pull requests

3 participants