11# -*- makefile.am -*-
22#
3- # Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
3+ # Copyright (c) 2006-2019 Cisco Systems, Inc. All rights reserved.
44# Copyright (c) 2012-2013 The University of Tennessee and The University
55# of Tennessee Research Foundation. All rights
66# reserved.
2323
2424include $(top_srcdir ) /Makefile.ompi-rules
2525
26+ # Note that Automake's Fortran-buidling rules uses CPPFLAGS and
27+ # AM_CPPFLAGS. This can cause weirdness (e.g.,
28+ # https://github.com/open-mpi/ompi/issues/7253). Let's just zero
29+ # those out and rely on AM_FCFLAGS.
30+ CPPFLAGS =
31+ AM_CPPFLAGS =
32+
2633# This Makefile is only relevant if we're building the "use mpi_f08"
2734# MPI bindings.
2835if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
@@ -32,7 +39,7 @@ AM_FCFLAGS = -I$(top_builddir)/ompi/include \
3239 $(OMPI_FC_MODULE_FLAG )$(top_builddir ) /ompi/$(OMPI_FORTRAN_USEMPI_DIR ) \
3340 $(OMPI_FC_MODULE_FLAG ) mod \
3441 $(OMPI_FC_MODULE_FLAG ) bindings \
35- -I$(top_srcdir ) $(FCFLAGS_f90 )
42+ -I$(top_srcdir ) -I $( top_builddir ) $(FCFLAGS_f90 )
3643
3744MOSTLYCLEANFILES = *.mod
3845
@@ -795,10 +802,7 @@ pmpi_api_files = \
795802lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = \
796803 $(mpi_api_files ) \
797804 $(pmpi_api_files ) \
798- mpi-f08.F90 \
799- buffer_detach.c \
800- constants.h \
801- constants.c
805+ mpi-f08.F90
802806
803807# These are generated; do not ship them
804808nodist_lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES =
@@ -814,13 +818,18 @@ endif
814818#
815819# Include the mpi_f08-based MPI extensions in libmpi_usempif08, too.
816820#
821+ # Also include the one .c file that we need in this library -- because
822+ # we zero out CPPFLAGS and AM_CPPFLAGS in this Makefile.am, we have to
823+ # compile that .c file in a separate directory / Makefile.
824+ #
817825
818826lib@OMPI_LIBMPI_NAME@_usempif08_la_LIBADD = \
819827 $(module_sentinel_file ) \
820828 $(OMPI_MPIEXT_USEMPIF08_LIBS ) \
821829 $(top_builddir ) /ompi/mpi/fortran/mpif-h/lib@OMPI_LIBMPI_NAME@_mpifh.la \
822- $(top_builddir ) /ompi/lib@
[email protected] 823- lib@OMPI_LIBMPI_NAME@_usempif08_la_DEPENDENCIES = $(module_sentinel_file )
830+ $(top_builddir ) /ompi/lib@
[email protected] \ 831+ base/libusempif08_ccode.la
832+ lib@OMPI_LIBMPI_NAME@_usempif08_la_DEPENDENCIES = $(module_sentinel_files )
824833lib@OMPI_LIBMPI_NAME@_usempif08_la_LDFLAGS = -version-info $(libmpi_usempif08_so_version )
825834
826835#
0 commit comments