From 2c71c27882c0647bf4392144274da02f0d3de12e Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 31 May 2017 16:17:06 +0900 Subject: [PATCH 1/3] fortran2008: fix mpiext example in order to solve an egg and the chicken problem, in which mpiext need mpi-f08-types.mod and/but use-mpi-f08[-desc] needs mpiext, add an extra step - build fortran 2008 modules only - build fortran 2008 mpi extensions - and then build fortran 2008 bindings Fixes open-mpi/ompi#3605 Signed-off-by: Gilles Gouaillardet --- config/ompi_config_files.m4 | 4 + config/ompi_setup_mpi_fortran.m4 | 6 +- ompi/Makefile.am | 5 +- ompi/mpi/fortran/mpiext/Makefile.am | 7 +- ompi/mpi/fortran/use-mpi-f08-desc/Makefile.am | 15 ++- .../fortran/use-mpi-f08-desc/mod/Makefile.am | 69 ++++++++++++ .../{ => mod}/mpi-f08-interfaces.F90 | 0 .../{ => mod}/mpi-f08-types.f90 | 4 +- ompi/mpi/fortran/use-mpi-f08/Makefile.am | 43 +------- ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am | 102 ++++++++++++++++++ .../{ => mod}/mpi-f08-callbacks.F90 | 0 .../mpi-f08-interfaces-callbacks.F90 | 0 .../{ => mod}/mpi-f08-interfaces.F90 | 0 .../use-mpi-f08/{ => mod}/mpi-f08-types.F90 | 0 .../{ => mod}/pmpi-f08-interfaces.F90 | 0 ompi/mpiext/example/use-mpi-f08/Makefile.am | 4 +- 16 files changed, 203 insertions(+), 56 deletions(-) create mode 100644 ompi/mpi/fortran/use-mpi-f08-desc/mod/Makefile.am rename ompi/mpi/fortran/use-mpi-f08-desc/{ => mod}/mpi-f08-interfaces.F90 (100%) rename ompi/mpi/fortran/use-mpi-f08-desc/{ => mod}/mpi-f08-types.f90 (98%) create mode 100644 ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am rename ompi/mpi/fortran/use-mpi-f08/{ => mod}/mpi-f08-callbacks.F90 (100%) rename ompi/mpi/fortran/use-mpi-f08/{ => mod}/mpi-f08-interfaces-callbacks.F90 (100%) rename ompi/mpi/fortran/use-mpi-f08/{ => mod}/mpi-f08-interfaces.F90 (100%) rename ompi/mpi/fortran/use-mpi-f08/{ => mod}/mpi-f08-types.F90 (100%) rename ompi/mpi/fortran/use-mpi-f08/{ => mod}/pmpi-f08-interfaces.F90 (100%) diff --git a/config/ompi_config_files.m4 b/config/ompi_config_files.m4 index b20ca13400e..0748c5419ad 100644 --- a/config/ompi_config_files.m4 +++ b/config/ompi_config_files.m4 @@ -1,6 +1,8 @@ # -*- shell-script -*- # # Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2017 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -32,7 +34,9 @@ AC_DEFUN([OMPI_CONFIG_FILES],[ ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h ompi/mpi/fortran/use-mpi-f08/Makefile + ompi/mpi/fortran/use-mpi-f08/mod/Makefile ompi/mpi/fortran/use-mpi-f08-desc/Makefile + ompi/mpi/fortran/use-mpi-f08-desc/mod/Makefile ompi/mpi/fortran/mpiext/Makefile ompi/mpi/tool/Makefile ompi/mpi/tool/profile/Makefile diff --git a/config/ompi_setup_mpi_fortran.m4 b/config/ompi_setup_mpi_fortran.m4 index 089f7c5b934..dad8e22cda7 100644 --- a/config/ompi_setup_mpi_fortran.m4 +++ b/config/ompi_setup_mpi_fortran.m4 @@ -15,7 +15,7 @@ dnl Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2014-2016 Research Organization for Information Science +dnl Copyright (c) 2014-2017 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2016 IBM Corporation. All rights reserved. dnl $COPYRIGHT$ @@ -35,6 +35,7 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ OMPI_FORTRAN_USEMPI_LIB= OMPI_FORTRAN_USEMPIF08_DIR= + OMPI_FORTRAN_USEMPIF08_MOD= OMPI_FORTRAN_USEMPIF08_LIB= OMPI_FORTRAN_MAX_ARRAY_RANK=0 @@ -543,12 +544,14 @@ end type test_mpi_handle], AS_IF([test $OMPI_BUILD_FORTRAN_F08_SUBARRAYS -eq 1], [ # Case a) partial/prototype implementation OMPI_FORTRAN_USEMPIF08_DIR=mpi/fortran/use-mpi-f08-desc + OMPI_FORTRAN_USEMPIF08_MOD=$OMPI_FORTRAN_USEMPIF08_DIR/mod OMPI_FORTRAN_SUBARRAYS_SUPPORTED=.TRUE. OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=0 AC_MSG_RESULT([array subsections (partial/experimental)]) ], [ # Both cases b) and c) OMPI_FORTRAN_USEMPIF08_DIR=mpi/fortran/use-mpi-f08 + OMPI_FORTRAN_USEMPIF08_MOD=$OMPI_FORTRAN_USEMPIF08_DIR/mod OMPI_FORTRAN_SUBARRAYS_SUPPORTED=.FALSE. AS_IF([test $OMPI_FORTRAN_HAVE_OPTIONAL_ARGS -eq 1], [ # Case b) "good compiler" @@ -701,6 +704,7 @@ end type test_mpi_handle], # This goes into ompi/Makefile.am AC_SUBST(OMPI_FORTRAN_USEMPIF08_DIR) + AC_SUBST(OMPI_FORTRAN_USEMPIF08_MOD) # This goes into mpifort-wrapper-data.txt AC_SUBST(OMPI_FORTRAN_USEMPIF08_LIB) diff --git a/ompi/Makefile.am b/ompi/Makefile.am index 3adcb79a8ab..79adfb64ec7 100644 --- a/ompi/Makefile.am +++ b/ompi/Makefile.am @@ -15,7 +15,7 @@ # Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights # reserved. # Copyright (c) 2015-2017 Intel, Inc. All rights reserved. -# Copyright (c) 2015 Research Organization for Information Science +# Copyright (c) 2015-2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # $COPYRIGHT$ @@ -90,6 +90,7 @@ SUBDIRS = \ mpi/fortran/mpif-h \ $(OMPI_MPIEXT_USEMPI_DIR) \ $(OMPI_FORTRAN_USEMPI_DIR) \ + $(OMPI_FORTRAN_USEMPIF08_MOD) \ $(OMPI_MPIEXT_USEMPIF08_DIRS) \ $(OMPI_FORTRAN_USEMPIF08_DIR) \ mpi/fortran/mpiext \ @@ -119,7 +120,9 @@ DIST_SUBDIRS = \ mpi/fortran/use-mpi-tkr \ mpi/fortran/use-mpi-ignore-tkr \ mpi/fortran/use-mpi-f08 \ + mpi/fortran/use-mpi-f08/mod \ mpi/fortran/use-mpi-f08-desc \ + mpi/fortran/use-mpi-f08-desc/mod \ mpi/fortran/mpiext \ mpi/java \ $(OMPI_MPIEXT_ALL_SUBDIRS) \ diff --git a/ompi/mpi/fortran/mpiext/Makefile.am b/ompi/mpi/fortran/mpiext/Makefile.am index 542e7d47e19..f25a5cb6656 100644 --- a/ompi/mpi/fortran/mpiext/Makefile.am +++ b/ompi/mpi/fortran/mpiext/Makefile.am @@ -1,5 +1,7 @@ # -# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2017 Research Organization for Information Science +# and Technology (RIST). All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -18,6 +20,7 @@ if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \ $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \ + $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPIF08_MOD) \ -I$(top_srcdir) $(FCFLAGS_f90) flibs = @@ -61,7 +64,7 @@ libforce_usempif08_module_to_be_built_la_SOURCES = mpi-f08-ext-module.F90 # manually here. Bummer! # -mpi_f08_ext.lo: $(top_builddir)/ompi/mpi/fortran/use-mpi-f08/mpi-f08-types.lo +mpi_f08_ext.lo: $(top_builddir)/ompi/mpi/fortran/use-mpi-f08-modules/mpi-f08-types.lo mpi_f08_ext.lo: mpi-f08-ext-module.F90 endif diff --git a/ompi/mpi/fortran/use-mpi-f08-desc/Makefile.am b/ompi/mpi/fortran/use-mpi-f08-desc/Makefile.am index 9e55e5bd36d..559012f91e2 100644 --- a/ompi/mpi/fortran/use-mpi-f08-desc/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08-desc/Makefile.am @@ -1,7 +1,7 @@ # -*- makefile -*- # # Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2015 Research Organization for Information Science +# Copyright (c) 2015-2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # @@ -17,10 +17,12 @@ if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \ - -I$(top_srcdir) $(FCFLAGS) + -I$(top_srcdir) -Imod $(FCFLAGS) lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08.la +module_sentinel_file = \ + mod/libforce_usempif08_internal_modules_to_be_built.la # # This list is a subset of the full MPI API used for testing Fortran # descriptors usage in MPI-3 @@ -38,8 +40,6 @@ mpi_api_files = \ lib@OMPI_LIBMPI_NAME@_usempif08_la_SOURCES = \ $(mpi_api_files) \ - mpi-f08-types.f90 \ - mpi-f08-interfaces.F90 \ mpi-f-interfaces-bind.h \ mpi-f08.f90 \ ISO_Fortran_binding.h \ @@ -59,9 +59,7 @@ MOSTLYCLEANFILES = *.mod # manually here. Bummer! # -mpi-f08-types.lo: mpi-f08-types.f90 -mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 mpi-f08-types.lo -OMPI_Fortran_binding.lo: OMPI_Fortran_binding.f90 mpi-f08-types.lo +OMPI_Fortran_binding.lo: OMPI_Fortran_binding.f90 mod/mpi-f08-types.lo # @@ -73,9 +71,8 @@ mpi_api_lo_files = $(mpi_api_files:.f90=.lo) $(mpi_api_lo_files): mpi-f08.lo -mpi-f08.lo: mpi-f08-types.lo +mpi-f08.lo: $(module_sentinel_file) mpi-f08.lo: OMPI_Fortran_binding.lo -mpi-f08.lo: mpi-f08-interfaces.lo mpi-f08.lo: mpi-f-interfaces-bind.h mpi-f08.lo: mpi-f08.f90 diff --git a/ompi/mpi/fortran/use-mpi-f08-desc/mod/Makefile.am b/ompi/mpi/fortran/use-mpi-f08-desc/mod/Makefile.am new file mode 100644 index 00000000000..ec5a76fc983 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08-desc/mod/Makefile.am @@ -0,0 +1,69 @@ +# -*- makefile -*- +# +# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2015 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# Copyright (c) 2016 IBM Corporation. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# This Makefile is only relevant if we're building the "use mpi_f08" +# MPI bindings. +if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS + +AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \ + -I$(top_srcdir) $(FCFLAGS) + +module_sentinel_file = \ + libforce_usempif08_internal_modules_to_be_built.la + +noinst_LTLIBRARIES = $(module_sentinel_file) + +# f08 support modules + +libforce_usempif08_internal_modules_to_be_built_la_SOURCES = \ + mpi-f08-types.f90 \ + mpi-f08-interfaces.F90 + +# +# Clean up all F90 module files +# + +MOSTLYCLEANFILES = *.mod + +# +# Automake doesn't do Fortran dependency analysis, so must list them +# manually here. Bummer! +# + +mpi-f08-types.lo: mpi-f08-types.f90 +mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 mpi-f08-types.lo + + +install-exec-hook: + @ for file in `ls *.mod`; do \ + echo $(INSTALL) $$file $(DESTDIR)$(libdir); \ + $(INSTALL) $$file $(DESTDIR)$(libdir); \ + done + +uninstall-local: + @ for file in `ls *.mod`; do \ + echo rm -f $(DESTDIR)$(libdir)/$$file; \ + rm -f $(DESTDIR)$(libdir)/$$file; \ + done + +else + +# Need to have empty targets because AM can't handle having an +# AM_CONDITIONAL was targets in the "if" statement but not in the +# "else". :-( + +install-exec-hook: +uninstall-local: + +endif diff --git a/ompi/mpi/fortran/use-mpi-f08-desc/mpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08-desc/mod/mpi-f08-interfaces.F90 similarity index 100% rename from ompi/mpi/fortran/use-mpi-f08-desc/mpi-f08-interfaces.F90 rename to ompi/mpi/fortran/use-mpi-f08-desc/mod/mpi-f08-interfaces.F90 diff --git a/ompi/mpi/fortran/use-mpi-f08-desc/mpi-f08-types.f90 b/ompi/mpi/fortran/use-mpi-f08-desc/mod/mpi-f08-types.f90 similarity index 98% rename from ompi/mpi/fortran/use-mpi-f08-desc/mpi-f08-types.f90 rename to ompi/mpi/fortran/use-mpi-f08-desc/mod/mpi-f08-types.f90 index ec6fbf2ca31..382b42417cb 100644 --- a/ompi/mpi/fortran/use-mpi-f08-desc/mpi-f08-types.f90 +++ b/ompi/mpi/fortran/use-mpi-f08-desc/mod/mpi-f08-types.f90 @@ -3,7 +3,7 @@ ! Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2012 Los Alamos National Security, LLC. ! All rights reserved. -! Copyright (c) 2015 Research Organization for Information Science +! Copyright (c) 2015-2017 Research Organization for Information Science ! and Technology (RIST). All rights reserved. ! ! This file creates mappings between MPI C types (e.g., MPI_Comm) and @@ -153,6 +153,6 @@ module mpi_f08_types ! ! STATUS/STATUSES_IGNORE ! -#include "mpif-f08-types.h" +include 'mpif-f08-types.h' end module mpi_f08_types diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index 75bbf7600d8..0446e4a9e4c 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -7,7 +7,7 @@ # Copyright (c) 2012-2013 Inria. All rights reserved. # Copyright (c) 2013 Los Alamos National Security, LLC. All rights # reserved. -# Copyright (c) 2015-2016 Research Organization for Information Science +# Copyright (c) 2015-2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. # @@ -27,7 +27,7 @@ if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS AM_FCFLAGS = -I$(top_builddir)/ompi/include \ -I$(top_srcdir)/ompi/include \ $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPI_DIR) \ - $(OMPI_FC_MODULE_FLAG). \ + $(OMPI_FC_MODULE_FLAG)mod \ -I$(top_srcdir) $(FCFLAGS_f90) MOSTLYCLEANFILES = *.mod @@ -37,9 +37,7 @@ CLEANFILES += *.i90 lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempif08.la module_sentinel_file = \ - libforce_usempif08_internal_modules_to_be_built.la - -noinst_LTLIBRARIES = $(module_sentinel_file) + mod/libforce_usempif08_internal_modules_to_be_built.la mpi-f08.lo: $(module_sentinel_file) mpi-f08.lo: mpi-f08.F90 @@ -843,41 +841,6 @@ mpi-f08.lo: mpi-f-interfaces-bind.h pmpi-f-interfaces-bind.h ########################################################################### -# f08 support modules - -libforce_usempif08_internal_modules_to_be_built_la_SOURCES = \ - mpi-f08-types.F90 \ - mpi-f08-interfaces.F90 \ - mpi-f08-interfaces-callbacks.F90 \ - mpi-f08-callbacks.F90 \ - pmpi-f08-interfaces.F90 - -config_h = \ - $(top_builddir)/ompi/mpi/fortran/configure-fortran-output.h \ - $(top_srcdir)/ompi/mpi/fortran/configure-fortran-output-bottom.h - -# -# Automake doesn't do Fortran dependency analysis, so must list them -# manually here. Bummer! -# - -mpi-f08-types.lo: $(config_h) -mpi-f08-types.lo: mpi-f08-types.F90 -mpi-f08-interfaces.lo: $(config_h) -mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 -mpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo -mpi-f08-interfaces-callbacks.lo: $(config_h) -mpi-f08-interfaces-callbacks.lo: mpi-f08-interfaces-callbacks.F90 -mpi-f08-interfaces-callbacks.lo: mpi-f08-types.lo -mpi-f08-callbacks.lo: $(config_h) -mpi-f08-callbacks.lo: mpi-f08-callbacks.F90 -mpi-f08-callbacks.lo: mpi-f08-types.lo -pmpi-f08-interfaces.lo: $(config_h) -pmpi-f08-interfaces.lo: pmpi-f08-interfaces.F90 -pmpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo - -########################################################################### - # Install the generated .mod files. Unfortunately, each F90 compiler # may generate different filenames, so we have to use a glob. :-( diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am new file mode 100644 index 00000000000..e8dc8bfbb5c --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/mod/Makefile.am @@ -0,0 +1,102 @@ +# -*- makefile -*- +# +# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2012-2013 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2012-2013 Inria. All rights reserved. +# Copyright (c) 2013 Los Alamos National Security, LLC. All rights +# reserved. +# Copyright (c) 2015-2016 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# Copyright (c) 2016 IBM Corporation. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +include $(top_srcdir)/Makefile.ompi-rules + +# This Makefile is only relevant if we're building the "use mpi_f08" +# MPI bindings. +if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS + +AM_FCFLAGS = -I$(top_builddir)/ompi/include \ + -I$(top_srcdir)/ompi/include \ + $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPI_DIR) \ + $(OMPI_FC_MODULE_FLAG). \ + -I$(top_srcdir) $(FCFLAGS_f90) + +MOSTLYCLEANFILES = *.mod + +CLEANFILES += *.i90 + +########################################################################### + +module_sentinel_file = \ + libforce_usempif08_internal_modules_to_be_built.la + +noinst_LTLIBRARIES = $(module_sentinel_file) + +# f08 support modules + +libforce_usempif08_internal_modules_to_be_built_la_SOURCES = \ + mpi-f08-types.F90 \ + mpi-f08-interfaces.F90 \ + mpi-f08-interfaces-callbacks.F90 \ + mpi-f08-callbacks.F90 \ + pmpi-f08-interfaces.F90 + +config_h = \ + $(top_builddir)/ompi/mpi/fortran/configure-fortran-output.h \ + $(top_srcdir)/ompi/mpi/fortran/configure-fortran-output-bottom.h + +# +# Automake doesn't do Fortran dependency analysis, so must list them +# manually here. Bummer! +# + +mpi-f08-types.lo: $(config_h) +mpi-f08-types.lo: mpi-f08-types.F90 +mpi-f08-interfaces.lo: $(config_h) +mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 +mpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo +mpi-f08-interfaces-callbacks.lo: $(config_h) +mpi-f08-interfaces-callbacks.lo: mpi-f08-interfaces-callbacks.F90 +mpi-f08-interfaces-callbacks.lo: mpi-f08-types.lo +mpi-f08-callbacks.lo: $(config_h) +mpi-f08-callbacks.lo: mpi-f08-callbacks.F90 +mpi-f08-callbacks.lo: mpi-f08-types.lo +pmpi-f08-interfaces.lo: $(config_h) +pmpi-f08-interfaces.lo: pmpi-f08-interfaces.F90 +pmpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo + +########################################################################### + +# Install the generated .mod files. Unfortunately, each F90 compiler +# may generate different filenames, so we have to use a glob. :-( + +install-exec-hook: + @ for file in `ls *.mod`; do \ + echo $(INSTALL) $$file $(DESTDIR)$(libdir); \ + $(INSTALL) $$file $(DESTDIR)$(libdir); \ + done + +uninstall-local: + @ for file in `ls *.mod`; do \ + echo rm -f $(DESTDIR)$(libdir)/$$file; \ + rm -f $(DESTDIR)$(libdir)/$$file; \ + done +else + +# Need to have empty targets because AM can't handle having an +# AM_CONDITIONAL was targets in the "if" statement but not in the +# "else". :-( + +install-exec-hook: +uninstall-local: + +endif diff --git a/ompi/mpi/fortran/use-mpi-f08/mpi-f08-callbacks.F90 b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-callbacks.F90 similarity index 100% rename from ompi/mpi/fortran/use-mpi-f08/mpi-f08-callbacks.F90 rename to ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-callbacks.F90 diff --git a/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces-callbacks.F90 b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces-callbacks.F90 similarity index 100% rename from ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces-callbacks.F90 rename to ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces-callbacks.F90 diff --git a/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.F90 similarity index 100% rename from ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90 rename to ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.F90 diff --git a/ompi/mpi/fortran/use-mpi-f08/mpi-f08-types.F90 b/ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-types.F90 similarity index 100% rename from ompi/mpi/fortran/use-mpi-f08/mpi-f08-types.F90 rename to ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-types.F90 diff --git a/ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90 similarity index 100% rename from ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90 rename to ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90 diff --git a/ompi/mpiext/example/use-mpi-f08/Makefile.am b/ompi/mpiext/example/use-mpi-f08/Makefile.am index 656a036f098..1dcae9dd323 100644 --- a/ompi/mpiext/example/use-mpi-f08/Makefile.am +++ b/ompi/mpiext/example/use-mpi-f08/Makefile.am @@ -1,5 +1,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$ # # Additional copyrights may follow @@ -12,7 +14,7 @@ # We must set these #defines and include paths so that the inner OMPI # MPI prototype header files do the Right Thing. -AM_FCFLAGS = $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \ +AM_FCFLAGS = $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPIF08_MOD) \ -I$(top_srcdir) $(FCFLAGS_f90) # Note that the mpi_f08-based bindings are optional -- they can only From dfe7b2be3f5bd3a620aa4c7694a241bfcd8cacc6 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 9 Aug 2017 13:10:02 +0900 Subject: [PATCH 2/3] fortran/use-mpi-f08-desc: add a missing include file Signed-off-by: Gilles Gouaillardet --- ompi/mpi/fortran/use-mpi-f08-desc/OMPI_Fortran_binding_c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ompi/mpi/fortran/use-mpi-f08-desc/OMPI_Fortran_binding_c.c b/ompi/mpi/fortran/use-mpi-f08-desc/OMPI_Fortran_binding_c.c index fbd4e3531d6..efac7c957ab 100644 --- a/ompi/mpi/fortran/use-mpi-f08-desc/OMPI_Fortran_binding_c.c +++ b/ompi/mpi/fortran/use-mpi-f08-desc/OMPI_Fortran_binding_c.c @@ -4,6 +4,7 @@ #include "ompi_config.h" #include "ISO_Fortran_binding.h" +#include #include #define DEBUG_PRINT 0 From 344f000841b53e0aca4dce841bf9dc654cd0c761 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 9 Aug 2017 13:14:43 +0900 Subject: [PATCH 3/3] configury: enable Fortran 2008 subarray prototype so Open MPI can be configure'd with --enable-mpi-f08-subarray-prototype Signed-off-by: Gilles Gouaillardet --- config/ompi_configure_options.m4 | 8 ++------ config/ompi_ext.m4 | 5 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/config/ompi_configure_options.m4 b/config/ompi_configure_options.m4 index 3301df03c1b..39caab9b0fe 100644 --- a/config/ompi_configure_options.m4 +++ b/config/ompi_configure_options.m4 @@ -17,7 +17,7 @@ dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. dnl Copyright (c) 2013 Intel, Inc. All rights reserved. -dnl Copyright (c) 2015-2016 Research Organization for Information Science +dnl Copyright (c) 2015-2017 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl dnl $COPYRIGHT$ @@ -244,11 +244,7 @@ OMPI_BUILD_FORTRAN_F08_SUBARRAYS=0 AS_IF([test $OMPI_TRY_FORTRAN_BINDINGS -lt $OMPI_FORTRAN_USEMPIF08_BINDINGS], [AC_MSG_RESULT([none (use mpi_f08 disabled)])], [AS_IF([test "$enable_mpi_f08_subarray_prototype" = "yes"], - [OMPI_BUILD_FORTRAN_F08_SUBARRAYS=1 - AC_MSG_RESULT([extra crispy (subarray prototype)]) - AC_MSG_WARN([Sorry, the subarray prototype is no longer available]) - AC_MSG_WARN([Contact your favorite OMPI developer and ask for it to be re-enabled]) - AC_MSG_ERROR([Cannot continue])], + [OMPI_BUILD_FORTRAN_F08_SUBARRAYS=1], [AC_MSG_RESULT([regular (no subarray support)])]) ]) AC_DEFINE_UNQUOTED([OMPI_BUILD_FORTRAN_F08_SUBARRAYS], diff --git a/config/ompi_ext.m4 b/config/ompi_ext.m4 index ae0e91b2d34..41ddb2aa513 100644 --- a/config/ompi_ext.m4 +++ b/config/ompi_ext.m4 @@ -5,7 +5,7 @@ dnl University Research and Technology dnl Corporation. All rights reserved. dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2011-2012 Oak Ridge National Labs. All rights reserved. -dnl Copyright (c) 2015 Research Organization for Information Science +dnl Copyright (c) 2015-2017 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. dnl Copyright (c) 2017 The University of Tennessee and The University dnl of Tennessee Research Foundation. All rights @@ -216,8 +216,7 @@ EOF # Only build this mpi_f08_ext module if we're building the "use # mpi_f08" module *and* it's the non-descriptor one. - AS_IF([test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS && \ - test $OMPI_BUILD_FORTRAN_F08_SUBARRAYS -eq 0], + AS_IF([test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS] [OMPI_BUILD_FORTRAN_USEMPIF08_EXT=1], [OMPI_BUILD_FORTRAN_USEMPIF08_EXT=0]) AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPIF08_EXT,