f9ae932bfd
If a subroutine of the Fortran `use-mpi-f08` binding in an MPI extension have a `LOGICAL` parameter and no `TYPE(MPI_Status)` parameter, it needs to use the `mpi_ext` module and call its corresponding subroutine in the `mpif-h` directory, as explained in `ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h`. However, as shown in the figure below, the required directories are dependent on each other, and "Can't open module file" error occurs at build time. ompi/mpiext/{extension name}/use-mpi-f08 A | | | | V ompi/mpi/fortran/use-mpi-f08 <--- ompi/mpi/fortran/mpiext (mpi_ext.mod) In order to solve this problem, change the configuration and the build order. - divide Fortran extension directory (`ompi/mpi/fortran/mpiext`) into the directories for `use-mpi` and for `use-mpi-08` - `ompi/mpi/fortran/mpiext-use-mpi` : for `use-mpi` (mpi_ext.mod) - `ompi/mpi/fortran/mpiext-use-mpi-f08` : for `use-mpi-08` (mpi_f08_ext.mod) - change to the following build order about Fortran `use-mpi` and `use-mpi-f08` bindings in `ompi` 1. mpi_ext bindings of MPI extensions (`mpiext/{extension name}/use-mpi` directory) 2. Fortran use-mpi (`mpi/fortran/use-mpi-[ignore-]tkr` directory) 3. Fortran extension for use-mpi (`mpi/fortran/mpiext-use-mpi` directory) 4. Fortran use-mpi-f08 modules only (`mpi/fortran/use-mpi-f08/mod` directory) 5. mpi_f08_ext bindings of MPI extensions (`mpiext/{extension name}/use-mpi-f08` directory) 6. Fortran use-mpi-f08 (`mpi/fortran/use-mpi-f08` directory) 7. Fortran extension for use-mpi-f08 (`mpi/fortran/mpiext-use-mpi-f08` directory) Signed-off-by: Kurita, Takehiro <fj6370fp@aa.jp.fujitsu.com>
89 строки
2.0 KiB
Makefile
89 строки
2.0 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 \
|
|
-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
|
|
|