Skip to content

Fortran fixes #7265

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

Merged
merged 2 commits into from
Feb 4, 2020
Merged

Fortran fixes #7265

merged 2 commits into from
Feb 4, 2020

Conversation

jsquyres
Copy link
Member

@jsquyres jsquyres commented Dec 31, 2019

This is an attempt at fixing #7253 with the originally-proposed mechanism (i.e., zeroing out CPPFLAGS / AM_CPPFLAGS when relevant). I think the original patch I posted was incomplete -- this one is hypothetically complete.

I went this direction because I don't think @jeffhammond's proposed patches on #7253 were correct -- we shouldn't be using CPPFLAGS / AM_CPPFLAGS for Fortran compilation. Indeed, the Makefiles in question already set AM_FCFLAGS. So if those are wrong, let's fix those values. The problem appears to be the incorrect-for-Fortran values in CPPFLAGS / AM_CPPFLAGS, so let's see if zeroing them out in all relevant places (and as a side-effect, moving the one .c file compilation in use-mpi-f08 into its own subdirectory) fixes the issue.

Fixes #7253

See the individual commit messages for details.

FYI @jeffhammond @marmistrz

@ibm-ompi
Copy link

The IBM CI (GNU Compiler) build failed! Please review the log, linked below.

Gist: https://gist.github.com/be4f601d51a0a5d426598783172d0a01

@awlauria
Copy link
Contributor

That looks to be a real issue with the GNU compiler and this pr:

FC       mpi_wtime_f90.lo
mpi.F90:23:0: fatal error: ompi/mpi/fortran/configure-fortran-output.h: No such file or directory
 #include "ompi/mpi/fortran/configure-fortran-output.h"

After fixing the config issue, other PR's are now passing the ibm build.

@jsquyres jsquyres force-pushed the pr/fortran-you-win-again branch from 2b7e91d to d9c8b9c Compare December 31, 2019 16:58
@jsquyres
Copy link
Member Author

jsquyres commented Jan 3, 2020

bot:lanl:retest

@jsquyres
Copy link
Member Author

jsquyres commented Jan 7, 2020

@jeffhammond @marmistrz Does this PR fix the issue for you?

@jeffhammond
Copy link
Contributor

Unfortunately, no.

  GENERATE sizeof_f.f90
  FC       sizeof_f.lo
  FCLD     libmpi_mpifh_sizeof.la
  CCLD     libmpi_mpifh.la
Making all in mpi/fortran/use-mpi-ignore-tkr
  GENERATE mpi-ignore-tkr-sizeof.h
  GENERATE mpi-ignore-tkr-sizeof.f90
  PPFC     mpi-ignore-tkr.lo
  FC       mpi-ignore-tkr-sizeof.lo
  FCLD     libmpi_usempi_ignore_tkr.la
Making all in mpi/fortran/mpiext-use-mpi
  PPFC     mpi-ext-module.lo
mpi-ext-module.F90(7): #error: can't find include file: ompi/mpi/fortran/configure-fortran-output.h
mpi-ext-module.F90(32): #error: can't find include file: ../ompi/mpiext/pcollreq/mpif-h/mpiext_pcollreq_mpifh.h
mpi-ext-module.F90(33): #error: can't find include file: ../ompi/mpiext/pcollreq/use-mpi/mpiext_pcollreq_usempi.h
mpi-ext-module.F90(38): #error: can't find include file: ompi/mpiext/shortfloat/mpif-h/mpiext_shortfloat_mpifh.h
mpi-ext-module.F90(39): #error: can't find include file: ../ompi/mpiext/shortfloat/use-mpi/mpiext_shortfloat_usempi.h
make[2]: *** [mpi-ext-module.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

@jsquyres
Copy link
Member Author

jsquyres commented Jan 9, 2020

@jeffhammond Well phooey. Can you send the output of that failure, but run via make V=1?

@jeffhammond
Copy link
Contributor

Making all in mpi/fortran/mpiext-use-mpi
/bin/sh ../../../../libtool  --tag=FC   --mode=compile ifort -DHAVE_CONFIG_H -I. -I../../../../../ompi/mpi/fortran/mpiext-use-mpi -I../../../../opal/include -I../../../../ompi/include -I../../../../oshmem/include -I../../../../opal/mca/hwloc/hwloc201/hwloc/include/private/autogen -I../../../../opal/mca/hwloc/hwloc201/hwloc/include/hwloc/autogen -I../../../../ompi/mpiext/cuda/c    -I../../../../ompi/include -I../../../../../ompi/include -I../../../../ompi/mpi/fortran/base -I../../../../ompi/mpi/fortran/use-mpi-ignore-tkr -I../../../../..   -c -o mpi-ext-module.lo mpi-ext-module.F90
libtool: compile:  ifort -DHAVE_CONFIG_H -I. -I../../../../../ompi/mpi/fortran/mpiext-use-mpi -I../../../../opal/include -I../../../../ompi/include -I../../../../oshmem/include -I../../../../opal/mca/hwloc/hwloc201/hwloc/include/private/autogen -I../../../../opal/mca/hwloc/hwloc201/hwloc/include/hwloc/autogen -I../../../../ompi/mpiext/cuda/c -I../../../../ompi/include -I../../../../../ompi/include -I../../../../ompi/mpi/fortran/base -I../../../../ompi/mpi/fortran/use-mpi-ignore-tkr -I../../../../.. -c mpi-ext-module.F90  -fno-common -o .libs/mpi-ext-module.o
mpi-ext-module.F90(7): #error: can't find include file: ompi/mpi/fortran/configure-fortran-output.h
mpi-ext-module.F90(32): #error: can't find include file: ../ompi/mpiext/pcollreq/mpif-h/mpiext_pcollreq_mpifh.h
mpi-ext-module.F90(33): #error: can't find include file: ../ompi/mpiext/pcollreq/use-mpi/mpiext_pcollreq_usempi.h
mpi-ext-module.F90(38): #error: can't find include file: ompi/mpiext/shortfloat/mpif-h/mpiext_shortfloat_mpifh.h
mpi-ext-module.F90(39): #error: can't find include file: ../ompi/mpiext/shortfloat/use-mpi/mpiext_shortfloat_usempi.h
make[2]: *** [mpi-ext-module.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

@jsquyres jsquyres force-pushed the pr/fortran-you-win-again branch 2 times, most recently from a986fb3 to 259debc Compare January 10, 2020 18:45
@jsquyres
Copy link
Member Author

@jeffhammond @marmistrz Looks like I missed some $(top_builddir) instances in my prior commit. I think that's now fixed. Can you try again?

BE AWARE: I rebased on top of the current Open MPI git master HEAD, which now uses git submodules. If you clone/pull/whatever this branch, you may need to:

$ git submodule update --init --recursive

(and fully autogen.pl + ./configure again) before you can build.

@jeffhammond
Copy link
Contributor

Making all in mpi/fortran/use-mpi-ignore-tkr
make[2]: Nothing to be done for `all'.
Making all in mpi/fortran/mpiext-use-mpi
make[2]: Nothing to be done for `all'.
Making all in mpi/fortran/use-mpi-f08/base
make[2]: Nothing to be done for `all'.
Making all in mpi/fortran/use-mpi-f08/mod
make[2]: Nothing to be done for `all'.
Making all in mpi/fortran/use-mpi-f08/bindings
make[2]: Nothing to be done for `all'.
Making all in mpiext/pcollreq/use-mpi-f08
/bin/sh ../../../../libtool  --tag=FC   --mode=compile ifort -DHAVE_CONFIG_H -I. -I../../../../../ompi/mpiext/pcollreq/use-mpi-f08 -I../../../../opal/include -I../../../../ompi/include -I../../../../oshmem/include -I../../../../opal/mca/hwloc/hwloc2/hwloc/include/private/autogen -I../../../../opal/mca/hwloc/hwloc2/hwloc/include/hwloc/autogen -I../../../../ompi/mpiext/cuda/c   -I../../../../.. -I../../../.. -I../../../../../opal/include -I../../../../../orte/include -I../../../../orte/include -I../../../../../ompi/include -I../../../../../oshmem/include -I/Users/jrhammon/Work/MPI/OMPI/github/build/opal/mca/event/libevent2022/libevent/include -I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/event/libevent2022/libevent -I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/event/libevent2022/libevent/include -I/Users/jrhammon/Work/MPI/OMPI/github/build/opal/mca/hwloc/hwloc2/hwloc/include -I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/hwloc/hwloc2/hwloc/include   -I/usr/local/include -I/usr/local/include -I../../../../ompi/mpi/fortran/use-mpi-f08/mod -I../../../../..   -c -o mpiext_pcollreq_f08.lo ../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90
libtool: compile:  ifort -DHAVE_CONFIG_H -I. -I../../../../../ompi/mpiext/pcollreq/use-mpi-f08 -I../../../../opal/include -I../../../../ompi/include -I../../../../oshmem/include -I../../../../opal/mca/hwloc/hwloc2/hwloc/include/private/autogen -I../../../../opal/mca/hwloc/hwloc2/hwloc/include/hwloc/autogen -I../../../../ompi/mpiext/cuda/c -I../../../../.. -I../../../.. -I../../../../../opal/include -I../../../../../orte/include -I../../../../orte/include -I../../../../../ompi/include -I../../../../../oshmem/include -I/Users/jrhammon/Work/MPI/OMPI/github/build/opal/mca/event/libevent2022/libevent/include -I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/event/libevent2022/libevent -I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/event/libevent2022/libevent/include -I/Users/jrhammon/Work/MPI/OMPI/github/build/opal/mca/hwloc/hwloc2/hwloc/include -I/Users/jrhammon/Work/MPI/OMPI/github/opal/mca/hwloc/hwloc2/hwloc/include -I/usr/local/include -I/usr/local/include -I../../../../ompi/mpi/fortran/use-mpi-f08/mod -I../../../../.. -c ../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90  -fno-common -o .libs/mpiext_pcollreq_f08.o
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(29): error #7013: This module file was not generated by any release of this compiler.   [MPI_F08_TYPES]
  use mpi_f08_types
------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(285): error #7013: This module file was not generated by any release of this compiler.   [MPI_F08_TYPES]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
----------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(285): error #6580: Name in only-list does not exist or is not accessible.   [MPI_DATATYPE]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
--------------------------------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(285): error #6580: Name in only-list does not exist or is not accessible.   [MPI_COMM]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
----------------------------------------------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(285): error #6580: Name in only-list does not exist or is not accessible.   [MPI_REQUEST]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
--------------------------------------------------------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(316): error #7013: This module file was not generated by any release of this compiler.   [MPI_F08_TYPES]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
----------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(316): error #6580: Name in only-list does not exist or is not accessible.   [MPI_DATATYPE]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
--------------------------------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(316): error #6580: Name in only-list does not exist or is not accessible.   [MPI_COMM]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
----------------------------------------------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(316): error #6580: Name in only-list does not exist or is not accessible.   [MPI_REQUEST]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
--------------------------------------------------------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(331): error #6580: Name in only-list does not exist or is not accessible.   [MPI_ADDRESS_KIND]
   use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request, MPI_ADDRESS_KIND
---------------------------------------------------------------------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(336): error #6683: A kind type parameter must be a compile-time constant.   [MPI_ADDRESS_KIND]
   INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: sdispls(*), rdispls(*)
-----------^
compilation aborted for ../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90 (code 1)
make[2]: *** [mpiext_pcollreq_f08.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
jrhammon-mac02:build jrhammon$ git status
On branch fortran-you-win-again
Your branch is up to date with 'jsquyres/pr/fortran-you-win-again'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
	modified:   ../opal/mca/hwloc/hwloc2/hwloc (untracked content)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	./

no changes added to commit (use "git add" and/or "git commit -a")
jrhammon-mac02:build jrhammon$ git log -1
commit 259debc5fc28c402824e9204a223663a5d2b7d0e (HEAD -> fortran-you-win-again, jsquyres/pr/fortran-you-win-again)
Author: Jeff Squyres <[email protected]>
Date:   Tue Dec 31 07:06:51 2019 -0800

    fortran: ensure not to use [AM_]CPPFLAGS
    
    Automake's Fortran compilation rules inexplicably use CPPFLAGS and
    AM_CPPFLAGS.  Unfortunately, this can cause problems in some cases
    (e.g., picking up already-installed mpi.mod in a system-default
    include search path).
    
    So in relevant module-using Fortran compilation Makefile.am's, zero
    out CPPFLAGS and AM_CPPFLAGS.
    
    This has a side-effect of requiring that we compile the one .c file in
    the F08 library in a new, separate subdirectory (with its own
    Makefile.am that does _not_ have CPPFLAGS/AM_CPPFLAGS zeroed out).
    
    Signed-off-by: Jeff Squyres <[email protected]>

@jsquyres
Copy link
Member Author

Do you have stale build artifacts?

../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(29): error #7013: This module file was not generated by any release of this compiler.   [MPI_F08_TYPES]
  use mpi_f08_types
------^
../../../../../ompi/mpiext/pcollreq/use-mpi-f08/mpiext_pcollreq_f08.F90(285): error #7013: This module file was not generated by any release of this compiler.   [MPI_F08_TYPES]

@jeffhammond
Copy link
Contributor

jeffhammond commented Jan 10, 2020

That is unlikely. I ran git clean -dfx and git reset --hard, switched to master, did an update, then checkout out your branch from scratch before running autogen.pl etc.

@ggouaillardet
Copy link
Contributor

@jsquyres did you omit to push (similar) changes to (at least) ompi/mpiext/pcollreq/use-mpi-f08/Makefie.am

@ggouaillardet
Copy link
Contributor

@jsquyres I made the changes and pushed them into this PR

@jeffhammond could you please give this updated PR an other try?

@jsquyres
Copy link
Member Author

bot:ompi:retest

@jsquyres
Copy link
Member Author

jsquyres commented Feb 2, 2020

@jeffhammond Ping.

@jeffhammond
Copy link
Contributor

jeffhammond commented Feb 3, 2020 via email

These -D's are for C compilation, not Fortran compilation.  Remove
this useless statement.

Signed-off-by: Jeff Squyres <[email protected]>
Automake's Fortran compilation rules inexplicably use CPPFLAGS and
AM_CPPFLAGS.  Unfortunately, this can cause problems in some cases
(e.g., picking up already-installed mpi.mod in a system-default
include search path).

So in relevant module-using Fortran compilation Makefile.am's, zero
out CPPFLAGS and AM_CPPFLAGS.

This has a side-effect of requiring that we compile the one .c file in
the F08 library in a new, separate subdirectory (with its own
Makefile.am that does _not_ have CPPFLAGS/AM_CPPFLAGS zeroed out).

Signed-off-by: Jeff Squyres <[email protected]>
Signed-off-by: Gilles Gouaillardet <[email protected]>
@jsquyres jsquyres force-pushed the pr/fortran-you-win-again branch from 626d4f1 to ab398f4 Compare February 3, 2020 22:45
@jsquyres
Copy link
Member Author

jsquyres commented Feb 3, 2020

Squashed @ggouaillardet's commit into the 1st commit. When this finishes CI, I'll merge.

@jsquyres jsquyres merged commit 827e9f6 into open-mpi:master Feb 4, 2020
@jsquyres jsquyres deleted the pr/fortran-you-win-again branch February 4, 2020 12:03
@jsquyres jsquyres mentioned this pull request Feb 4, 2020
jjhursey added a commit to jjhursey/ompi that referenced this pull request Jan 24, 2022
 * Some C and Fortran compilers use different preprocessors. If one preprocessor
   accepts `-iquote` and the other does not then a compiler error will occur
   when Open MPI tries to use it.
   - Nvidia/PGI v22.1-0 is one such. The C compiler supports `-iquote`
     while the Fortran compiler does not.
 * Similar to PR open-mpi#7265 we need to clear the `CPPFLAGS` and `AM_CPPFLAGS`

Signed-off-by: Joshua Hursey <[email protected]>
jjhursey added a commit to jjhursey/ompi that referenced this pull request Jan 24, 2022
 * Some C and Fortran compilers use different preprocessors. If one preprocessor
   accepts `-iquote` and the other does not then a compiler error will occur
   when Open MPI tries to use it.
   - Nvidia/PGI v22.1-0 is one such. The C compiler supports `-iquote`
     while the Fortran compiler does not.
 * Similar to PR open-mpi#7265 we need to clear the `CPPFLAGS` and `AM_CPPFLAGS`

Signed-off-by: Joshua Hursey <[email protected]>
jjhursey added a commit to jjhursey/ompi that referenced this pull request Jan 24, 2022
 * Some C and Fortran compilers use different preprocessors. If one preprocessor
   accepts `-iquote` and the other does not then a compiler error will occur
   when Open MPI tries to use it.
   - Nvidia/PGI v22.1-0 is one such. The C compiler supports `-iquote`
     while the Fortran compiler does not.
 * Similar to PR open-mpi#7265 we need to clear the `CPPFLAGS` and `AM_CPPFLAGS`

Signed-off-by: Joshua Hursey <[email protected]>
(cherry picked from commit bbe5788)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenMPI may pick up an old version of mpi.mod from an existing installation for building
5 participants