diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am index 4f0baa82680..bd11ded4657 100644 --- a/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/profile/Makefile.am @@ -28,6 +28,13 @@ include $(top_srcdir)/Makefile.ompi-rules +# Note that Automake's Fortran-buidling rules uses CPPFLAGS and +# AM_CPPFLAGS. This can cause weirdness (e.g., +# https://github.com/open-mpi/ompi/issues/7253). Let's just zero +# those out and rely on AM_FCFLAGS. +CPPFLAGS = +AM_CPPFLAGS = + # This Makefile is only relevant if we're building the "use mpi_f08" # MPI bindings. if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS diff --git a/ompi/mpiext/example/use-mpi-f08/Makefile.am b/ompi/mpiext/example/use-mpi-f08/Makefile.am index f495b4414d6..ef2ddd79d13 100644 --- a/ompi/mpiext/example/use-mpi-f08/Makefile.am +++ b/ompi/mpiext/example/use-mpi-f08/Makefile.am @@ -2,6 +2,7 @@ # Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2022 IBM Corporation. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -9,6 +10,14 @@ # $HEADER$ # +# Note that Automake's Fortran-buidling rules uses CPPFLAGS and +# AM_CPPFLAGS. This can cause weirdness (e.g., +# https://github.com/open-mpi/ompi/issues/7253 and +# https://github.com/open-mpi/ompi/issues/9716). Let's just zero +# those out and rely on AM_FCFLAGS. +CPPFLAGS = +AM_CPPFLAGS = + # This file builds the use_mpi_f08-based bindings for MPI extensions. It # is optional in MPI extensions. diff --git a/ompi/mpiext/ftmpi/use-mpi-f08/Makefile.am b/ompi/mpiext/ftmpi/use-mpi-f08/Makefile.am index d06c0aa6837..075bd2fbe12 100644 --- a/ompi/mpiext/ftmpi/use-mpi-f08/Makefile.am +++ b/ompi/mpiext/ftmpi/use-mpi-f08/Makefile.am @@ -6,6 +6,7 @@ # Copyright (c) 2018 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. +# Copyright (c) 2022 IBM Corporation. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -13,6 +14,14 @@ # $HEADER$ # +# Note that Automake's Fortran-buidling rules uses CPPFLAGS and +# AM_CPPFLAGS. This can cause weirdness (e.g., +# https://github.com/open-mpi/ompi/issues/7253 and +# https://github.com/open-mpi/ompi/issues/9716). Let's just zero +# those out and rely on AM_FCFLAGS. +CPPFLAGS = +AM_CPPFLAGS = + # This file builds the use_mpi_f08-based bindings for MPI extensions. It # is optional in MPI extensions.