Skip to content

nvfortran-Error-Unknown switch: -iquote../../../../../.. #9716

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

Closed
jeffhammond opened this issue Dec 1, 2021 · 4 comments · Fixed by #9899 or #9911
Closed

nvfortran-Error-Unknown switch: -iquote../../../../../.. #9716

jeffhammond opened this issue Dec 1, 2021 · 4 comments · Fixed by #9899 or #9911
Assignees

Comments

@jeffhammond
Copy link
Contributor

I think this was caused #7169, unintentionally and indirectly.

The issue here is that configure assumes that the preprocessor used for C and Fortran are the same. This is not true when GCC C and NV/PGI Fortran are combined.

Background information

What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)

Every git update I've tried this year is affected.

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

git clone, e.g. 1da3f93 and bc7bb12

If you are building/installing from a git clone, please copy-n-paste the output from git submodule status.

the ones that come with the recursive clones of the git hashes above.

Please describe the system on which you are running

  • Operating system/version: Linux
  • Computer hardware: x86_64 or AArch64
  • Network type: does not matter

Details of the problem

Use the NVIDIA/PGI Fortran compiler with GCC C and C++.

../configure FC=nvfortran CC=gcc CXX=g++ --enable-fortran=all --disable-io-romio && make -j8
Making all in profile
make[3]: Entering directory '/tmp/ompi/build/ompi/mpi/fortran/use-mpi-f08/profile'
/bin/sh ../../../../../libtool  --tag=FC   --mode=compile nvfortran -DHAVE_CONFIG_H -I. -I../../../../../../ompi/mpi/fortran/use-mpi-f08/profile -I../../../../../opal/include -I../../../../../ompi/include -I../../../../../oshmem/include -I../../../../../ompi/mpiext/cuda/c   -iquote../../../../../.. -iquote../../../../.. -iquote../../../../../../opal/include -iquote../../../../../../ompi/include -iquote../../../../../../oshmem/include  -I/tmp/ompi/build/3rd-party/libevent-2.1.12-stable -I/tmp/ompi/build/3rd-party/libevent-2.1.12-stable/include -I/tmp/ompi/build/3rd-party/hwloc-2.4.0/include -I/tmp/ompi/3rd-party/hwloc-2.4.0/include -I/tmp/ompi/build/3rd-party/openpmix/include -I/tmp/ompi/3rd-party/openpmix/include -I/usr/local/include -I/usr/local/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:  nvfortran -DHAVE_CONFIG_H -I. -I../../../../../../ompi/mpi/fortran/use-mpi-f08/profile -I../../../../../opal/include -I../../../../../ompi/include -I../../../../../oshmem/include -I../../../../../ompi/mpiext/cuda/c -iquote../../../../../.. -iquote../../../../.. -iquote../../../../../../opal/include -iquote../../../../../../ompi/include -iquote../../../../../../oshmem/include -I/tmp/ompi/build/3rd-party/libevent-2.1.12-stable -I/tmp/ompi/build/3rd-party/libevent-2.1.12-stable/include -I/tmp/ompi/build/3rd-party/hwloc-2.4.0/include -I/tmp/ompi/3rd-party/hwloc-2.4.0/include -I/tmp/ompi/build/3rd-party/openpmix/include -I/tmp/ompi/3rd-party/openpmix/include -I/usr/local/include -I/usr/local/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  -o .libs/pabort_f08.o
nvfortran-Error-Unknown switch: -iquote../../../../../..
nvfortran-Error-Unknown switch: -iquote../../../../..
nvfortran-Error-Unknown switch: -iquote../../../../../../opal/include
nvfortran-Error-Unknown switch: -iquote../../../../../../ompi/include
nvfortran-Error-Unknown switch: -iquote../../../../../../oshmem/include
make[3]: *** [Makefile:2086: pabort_f08.lo] Error 1
make[3]: Leaving directory '/tmp/ompi/build/ompi/mpi/fortran/use-mpi-f08/profile'
make[2]: *** [Makefile:2450: all-recursive] Error 1
make[2]: Leaving directory '/tmp/ompi/build/ompi/mpi/fortran/use-mpi-f08'
make[1]: *** [Makefile:2674: all-recursive] Error 1
make[1]: Leaving directory '/tmp/ompi/build/ompi'
make: *** [Makefile:1434: all-recursive] Error 1
@jjhursey
Copy link
Member

FWIW: I get this even using the PGI/Nvidia C compiler combined with the PGI/Nvidia fortran compiler (I'm using 22.1-0 in this case). Note that this problem did not occur with older versions of the compiler (checked 20.11-0) since -iquote was not supported in that version.

./configure --prefix=/workspace/exports/ompi CC=pgcc CXX=pgc++ FC=pgfortran --disable-cuda --disable-nvml --with-cuda=no

It seems the pgcc/nvcc accepts -iquote, but pgfortran/nvfortran does not.

I think the only solution here is to strengthen the check here to check both a C program and a fortran program for -iquote support.

The alternative is to adjust the build system more extensively to have a C and Fortran version of the CPPFLAGS which seems like a much messier solution for this specific problem.

@jeffhammond
Copy link
Contributor Author

Perhaps messier, but necessary because there's absolutely no guarantee CC and FC preprocess the same. As you know, XLF doesn't (unless it has changed) accept -D at all, but rather -WF,-D. Even gfortran and gcc behave differently, just not with respect to the flags.

@jjhursey
Copy link
Member

I have a narrow fix in hand for this particular case as a short-term fix. But I agree that we should separate the CPPFLAGS from the FPPFLAGS (name?). I'll see if I can scope the amount of work needed for that.

@jjhursey jjhursey self-assigned this Jan 20, 2022
@jjhursey jjhursey linked a pull request Jan 20, 2022 that will close this issue
@jjhursey jjhursey linked a pull request Jan 24, 2022 that will close this issue
@jjhursey
Copy link
Member

Specific fix for master in PR #9899 and v5.0.x in PR #9911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants