1
1
KAWASHIMA Takahiro b380dd58b5 config/ompi_ext: use mpi module in mpi_ext module
If MPI extensions are enabled, all
`ompi/mpiext/pcollreq/use-mpi/mpiext_*_usempi.h` are included in
`ompi/mpi/fortran/mpiext-use-mpi/mpi-ext-module.F90` and all
`ompi/mpiext/pcollreq/use-mpi/mpiext_*_usempif08.h` are included in
`ompi/mpi/fortran/mpiext-use-mpi-f08/mpi-f08-ext-module.F90` using
`#include` directives.

In `mpiext_*_usempi.h` and `mpiext_*_usempif08.h`, some MPI extension
may want to use constants or handles defined in the `mpi` module and
the `mpi_f08` module. For example, if you want to define a new
datatype in `mpi_f08_ext`, you'll need the definition of
`type(mpi_datatype)`. However, putting `use mpi_f08` line in thier
`mpiext_*_usempif08.h` may cause a compilation error if more than
one MPI extensions are enabled because the `use` statement must be
put prior to any variable declarations.

To resolve this problem, this commit puts `use mpi` and `use mpi_f08`
as first lines of `mpi-ext-module.F90` and `mpi-f08-ext-module.F90`
respectively.

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
2019-01-16 11:55:55 +09:00

90 строки
2.1 KiB
Makefile

#
# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
#
# Only do the stuff in this file if we're going to build
# the mpi ext modules.
#
if OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT
# Setup
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/mpi/fortran/use-mpi-ignore-tkr \
-I$(top_srcdir) $(FCFLAGS_f90)
flibs =
#
# "use mpi" ext module
#
# If we're building the Fortran "use mpi" bindings, compile and
# generate the mpi_ext module file. Do this by compiling a fake
# library; the modulefile will be created as a side-effect of
# compiling usempi-ext.f90.
#
if OMPI_BUILD_FORTRAN_USEMPI_EXT
flibs += libforce_usempi_module_to_be_built.la
libforce_usempi_module_to_be_built_la_SOURCES = mpi-ext-module.F90
#
# Automake doesn't do Fortran dependency analysis, so must list them
# manually here. Bummer!
#
mpi_ext.lo: mpi-ext-module.F90
endif
noinst_LTLIBRARIES = $(flibs)
#
# Clean up all F90 module files and all generated files
#
MOSTLYCLEANFILES = *.mod
CLEANFILES += *.i90
#
# 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
# If we're not building either of the modules, we still need stubs for
# install-exec-hook and uninstall-local, due to a bug in automake. :-(
install-exec-hook:
uninstall-local:
endif
# Remove the auto-generated files (they are generated by configure)
distclean-local:
rm -f mpi-ext-module.F90