Skip to content

Commit 42acf4f

Browse files
authored
Merge pull request #7360 from jsquyres/pr/v4.0.x/fortran-you-win-again
v4.0.x: Fortran fixes
2 parents a26cd34 + fbeebdb commit 42acf4f

File tree

13 files changed

+121
-26
lines changed

13 files changed

+121
-26
lines changed

config/ompi_config_files.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- shell-script -*-
22
#
3-
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
3+
# Copyright (c) 2009-2019 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2017-2018 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
# Copyright (c) 2018 Los Alamos National Security, LLC. All rights
@@ -38,6 +38,7 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
3838
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h
3939
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h
4040
ompi/mpi/fortran/use-mpi-f08/Makefile
41+
ompi/mpi/fortran/use-mpi-f08/base/Makefile
4142
ompi/mpi/fortran/use-mpi-f08/bindings/Makefile
4243
ompi/mpi/fortran/use-mpi-f08/mod/Makefile
4344
ompi/mpi/fortran/mpiext-use-mpi/Makefile

ompi/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# University of Stuttgart. All rights reserved.
1010
# Copyright (c) 2004-2005 The Regents of the University of California.
1111
# All rights reserved.
12-
# Copyright (c) 2008-2017 Cisco Systems, Inc. All rights reserved
12+
# Copyright (c) 2008-2019 Cisco Systems, Inc. All rights reserved
1313
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
1414
# Copyright (c) 2010-2011 Sandia National Laboratories. All rights reserved.
1515
# Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
@@ -92,6 +92,7 @@ SUBDIRS = \
9292
$(OMPI_MPIEXT_USEMPI_DIR) \
9393
$(OMPI_FORTRAN_USEMPI_DIR) \
9494
mpi/fortran/mpiext-use-mpi \
95+
mpi/fortran/use-mpi-f08/base \
9596
mpi/fortran/use-mpi-f08/mod \
9697
mpi/fortran/use-mpi-f08/bindings \
9798
$(OMPI_MPIEXT_USEMPIF08_DIRS) \
@@ -124,6 +125,7 @@ DIST_SUBDIRS = \
124125
mpi/fortran/use-mpi-ignore-tkr \
125126
mpi/fortran/mpiext-use-mpi \
126127
mpi/fortran/use-mpi-f08 \
128+
mpi/fortran/use-mpi-f08/base \
127129
mpi/fortran/use-mpi-f08/mod \
128130
mpi/fortran/use-mpi-f08/bindings \
129131
mpi/fortran/mpiext-use-mpi-f08 \

ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile.am

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
2+
# Copyright (c) 2012-2019 Cisco Systems, Inc. All rights reserved.
33
# Copyright (c) 2017 Research Organization for Information Science
44
# and Technology (RIST). All rights reserved.
55
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
@@ -10,6 +10,13 @@
1010
# $HEADER$
1111
#
1212

13+
# Note that Automake's Fortran-buidling rules uses CPPFLAGS and
14+
# AM_CPPFLAGS. This can cause weirdness (e.g.,
15+
# https://github.com/open-mpi/ompi/issues/7253). Let's just zero
16+
# those out and rely on AM_FCFLAGS.
17+
CPPFLAGS =
18+
AM_CPPFLAGS =
19+
1320
#
1421
# Only do the stuff in this file if we're going to build
1522
# the mpi_f08 ext modules.
@@ -22,7 +29,8 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
2229
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
2330
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
2431
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08/mod \
25-
-I$(top_srcdir) $(FCFLAGS_f90)
32+
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08 \
33+
-I$(top_srcdir) -I$(top_builddir) $(FCFLAGS_f90)
2634

2735
flibs =
2836

ompi/mpi/fortran/mpiext-use-mpi/Makefile.am

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
2+
# Copyright (c) 2012-2019 Cisco Systems, Inc. All rights reserved.
33
# Copyright (c) 2017 Research Organization for Information Science
44
# and Technology (RIST). All rights reserved.
55
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
@@ -10,6 +10,13 @@
1010
# $HEADER$
1111
#
1212

13+
# Note that Automake's Fortran-buidling rules uses CPPFLAGS and
14+
# AM_CPPFLAGS. This can cause weirdness (e.g.,
15+
# https://github.com/open-mpi/ompi/issues/7253). Let's just zero
16+
# those out and rely on AM_FCFLAGS.
17+
CPPFLAGS =
18+
AM_CPPFLAGS =
19+
1320
#
1421
# Only do the stuff in this file if we're going to build
1522
# the mpi ext modules.
@@ -21,7 +28,8 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
2128

2229
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
2330
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \
24-
-I$(top_srcdir) $(FCFLAGS_f90)
31+
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-ignore-tkr \
32+
-I$(top_srcdir) -I$(top_builddir) $(FCFLAGS_f90)
2533

2634
flibs =
2735

ompi/mpi/fortran/use-mpi-f08/Makefile.am

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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.
@@ -23,6 +23,13 @@
2323

2424
include $(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.
2835
if 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

3744
MOSTLYCLEANFILES = *.mod
3845

@@ -795,10 +802,7 @@ pmpi_api_files = \
795802
lib@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
804808
nodist_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

818826
lib@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)
824833
lib@OMPI_LIBMPI_NAME@_usempif08_la_LDFLAGS = -version-info $(libmpi_usempif08_so_version)
825834

826835
#
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# -*- makefile -*-
2+
#
3+
# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved.
4+
#
5+
# $COPYRIGHT$
6+
#
7+
# Additional copyrights may follow
8+
#
9+
# $HEADER$
10+
#
11+
12+
include $(top_srcdir)/Makefile.ompi-rules
13+
14+
# This Makefile is only relevant if we're building the "use mpi_f08"
15+
# MPI bindings.
16+
if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
17+
18+
# This directory only exists so that we can separate C compilation
19+
# from Fortran compilation. Specifically: note that Automake's
20+
# Fortran-buidling rules uses CPPFLAGS and AM_CPPFLAGS. This can
21+
# cause weirdness (e.g.,
22+
# https://github.com/open-mpi/ompi/issues/7253). So when compiling
23+
# Fortran, we should zero out CPPFLAGS and AM_CPPFLAGS.
24+
25+
# HOWEVER, we have one .c file in the use-mpi-f08 library. So we have
26+
# to split it out to its own directory / Makefile.am where CPPFLAGS /
27+
# AM_CPPFLAGS are *not* zeroed out.
28+
29+
noinst_LTLIBRARIES = libusempif08_ccode.la
30+
31+
libusempif08_ccode_la_SOURCES = \
32+
buffer_detach.c
33+
34+
endif

ompi/mpi/fortran/use-mpi-f08/bindings/Makefile.am

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- makefile -*-
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.
@@ -20,6 +20,13 @@
2020

2121
include $(top_srcdir)/Makefile.ompi-rules
2222

23+
# Note that Automake's Fortran-buidling rules uses CPPFLAGS and
24+
# AM_CPPFLAGS. This can cause weirdness (e.g.,
25+
# https://github.com/open-mpi/ompi/issues/7253). Let's just zero
26+
# those out and rely on AM_FCFLAGS.
27+
CPPFLAGS =
28+
AM_CPPFLAGS =
29+
2330
# This Makefile is only relevant if we're building the "use mpi_f08"
2431
# MPI bindings.
2532
if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
@@ -29,7 +36,7 @@ AM_FCFLAGS = -I$(top_builddir)/ompi/include \
2936
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPI_DIR) \
3037
$(OMPI_FC_MODULE_FLAG). \
3138
$(OMPI_FC_MODULE_FLAG)../mod \
32-
-I$(top_srcdir) $(FCFLAGS_f90)
39+
-I$(top_srcdir) -I$(top_builddir) $(FCFLAGS_f90)
3340

3441
MOSTLYCLEANFILES = *.mod
3542

ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- makefile -*-
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.
@@ -20,6 +20,13 @@
2020

2121
include $(top_srcdir)/Makefile.ompi-rules
2222

23+
# Note that Automake's Fortran-buidling rules uses CPPFLAGS and
24+
# AM_CPPFLAGS. This can cause weirdness (e.g.,
25+
# https://github.com/open-mpi/ompi/issues/7253). Let's just zero
26+
# those out and rely on AM_FCFLAGS.
27+
CPPFLAGS =
28+
AM_CPPFLAGS =
29+
2330
# This Makefile is only relevant if we're building the "use mpi_f08"
2431
# MPI bindings.
2532
if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
@@ -28,7 +35,7 @@ AM_FCFLAGS = -I$(top_builddir)/ompi/include \
2835
-I$(top_srcdir)/ompi/include \
2936
$(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPI_DIR) \
3037
$(OMPI_FC_MODULE_FLAG). \
31-
-I$(top_srcdir) $(FCFLAGS_f90)
38+
-I$(top_srcdir) -I$(top_builddir) $(FCFLAGS_f90)
3239

3340
MOSTLYCLEANFILES = *.mod
3441

0 commit comments

Comments
 (0)