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

Fix Fortran preprocessor issue with CPPFLAGS #9911

Merged
merged 2 commits into from
Jan 25, 2022

Conversation

jjhursey
Copy link
Member

  • 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 Fortran fixes #7265 we need to clear the CPPFLAGS and AM_CPPFLAGS

Signed-off-by: Joshua Hursey jhursey@us.ibm.com
(cherry picked from commit bbe5788)

 * 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 <jhursey@us.ibm.com>
(cherry picked from commit bbe5788)
@jjhursey
Copy link
Member Author

Humm. A build I kicked off a while ago failed somewhere else on this - just in the v5 branch. I'm cleaning up and rebuilding. There may be more places that need this fix just in the v5 branch.

In the meantime, while I'm double checking things I'm going to put a WIP on this.

@jjhursey
Copy link
Member Author

It looks like v5.0.x branch is missing ca03269 I'll add it to this cherry-pick

Making all in profile
make[1]: Entering directory '/opt/mpi_src/ompi/mpi/fortran/use-mpi-f08/profile'
/bin/sh ../../../../../libtool  --tag=FC   --mode=compile pgfortran -DHAVE_CONFIG_H -I. -I../../../../../opal/include -I../../../../../ompi/include -I../../../../../oshmem/include -I../../../../../ompi/mpiext/cuda/c   -iquote../../../../..  -I/opt/mpi_src/3rd-party/libevent-2.1.12-stable -I/opt/mpi_src/3rd-party/libevent-2.1.12-stable/include -I/opt/mpi_src/3rd-party/hwloc-2.7.0/include -I/opt/mpi_src/3rd-party/hwloc-2.7.0/include -I/opt/mpi_src/3rd-party/openpmix/include -I/opt/mpi_src/3rd-party/openpmix/include -I../../../../../ompi/mpi/fortran/use-mpi-f08/mod -I../../../../../ompi/include -I../../../../../ompi/include -I../../../../../ompi/mpi/fortran/use-mpi -I../../../../../ompi/mpi/fortran/use-mpi-ignore-tkr -I../mod -I../bindings -I../../../../.. -I../../../../..  -DOMPI_BUILD_MPI_PROFILING=1  -c -o pabort_f08.lo pabort_f08.F90
libtool: compile:  pgfortran -DHAVE_CONFIG_H -I. -I../../../../../opal/include -I../../../../../ompi/include -I../../../../../oshmem/include -I../../../../../ompi/mpiext/cuda/c -iquote../../../../.. -I/opt/mpi_src/3rd-party/libevent-2.1.12-stable -I/opt/mpi_src/3rd-party/libevent-2.1.12-stable/include -I/opt/mpi_src/3rd-party/hwloc-2.7.0/include -I/opt/mpi_src/3rd-party/hwloc-2.7.0/include -I/opt/mpi_src/3rd-party/openpmix/include -I/opt/mpi_src/3rd-party/openpmix/include -I../../../../../ompi/mpi/fortran/use-mpi-f08/mod -I../../../../../ompi/include -I../../../../../ompi/include -I../../../../../ompi/mpi/fortran/use-mpi -I../../../../../ompi/mpi/fortran/use-mpi-ignore-tkr -I../mod -I../bindings -I../../../../.. -I../../../../.. -DOMPI_BUILD_MPI_PROFILING=1 -c pabort_f08.F90  -fpic -o .libs/pabort_f08.o
pgfortran-Error-Unknown switch: -iquote../../../../..
make[1]: *** [Makefile:2174: pabort_f08.lo] Error 1
make[1]: Leaving directory '/opt/mpi_src/ompi/mpi/fortran/use-mpi-f08/profile'
make: *** [Makefile:2566: all-recursive] Error 1

Add missing bits from open-mpi/ompi@ab398f4

Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
(cherry picked from commit ca03269)
@awlauria
Copy link
Contributor

awlauria commented Jan 25, 2022

It looks like ca03269 is included in this draft pr: #9837

Should we wait for that to be resolved, or take it here?

@jjhursey
Copy link
Member Author

If @jsquyres is ok with it I'd like to just include it here and drop it from PR #9837 since that other PR is still in progress.

With this PR I can update our CI build boxes to the latest PGI compiler which I'd like to get off my plate.

@jjhursey
Copy link
Member Author

FYI: My build is finished and all is good with this PR now. It's ready for review.

@jsquyres
Copy link
Member

@jjhursey I'm confused -- are you going to add a cherry pick of ca03269 to this PR or not? I'm ok with it if you want to do that. But it looks like there's still only a single commit on this PR.

@jjhursey
Copy link
Member Author

Doh. It's on there now. I forgot to push last night.

@awlauria awlauria merged commit b191681 into open-mpi:v5.0.x Jan 25, 2022
@jjhursey jjhursey deleted the v5-fix-iquote branch January 25, 2022 16:35
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.

nvfortran-Error-Unknown switch: -iquote../../../../../..
5 participants