1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
|
# -*- makefile -*-
#
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2021 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2014-2021 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016-2022 IBM Corporation. All rights reserved.
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
include $(top_srcdir)/Makefile.ompi-rules
# THIS MAKEFILE IS OLD AND ONLY TO SUPPORT FORTRAN COMPILERS THAT DO
# NOT SUPPORT "IGNORE TKR" FUNCTIONALITY (i.e., gfortran before v4.9).
# All other Fortran compilers support ignore TKR and don't compile
# this directory -- instead, they compile
# ompi/fortran/use-mpi-ignore-tkr.
# Note that Automake's Fortran-buidling rules uses CPPFLAGS and
# AM_CPPFLAGS. This can cause weirdness (e.g.,
# https://github.com/open-mpi/ompi/issues/7253). Let's just zero
# those out and rely on AM_FCFLAGS.
CPPFLAGS =
AM_CPPFLAGS =
if OMPI_BUILD_FORTRAN_USEMPI_TKR_BINDINGS
########################################################################
# Note the "-I." in the flags below. This is because mpi.F90 includes
# mpi-f90-interfaces.h, which will be in the build tree (i.e., the
# current directory) because it is generated.
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
$(OMPI_FC_MODULE_FLAG). -I$(top_srcdir) -I$(top_builddir) -I. \
-I$(top_builddir)/ompi/mpi/fortran/use-mpi \
-I$(top_builddir)/ompi/mpi/fortran/use-mpi-tkr $(FCFLAGS_f90)
# Do different things if the top-level configure decided that we're
# going to build F90 bindings or not.
lib_LTLIBRARIES =
# Add the f90 library to the list of libraries to build
lib_LTLIBRARIES += lib@OMPI_LIBMPI_NAME@_usempi.la
# Automake doesn't know how to do F90 dependency analysis, so manually
# list this here (i.e., "mpi-f90-interfaces.h" is included in
# mpi.F90).
mpi.lo: mpi.F90
mpi.lo: mpi-f90-interfaces.h
mpi.lo: mpi-f90-status.h
mpi.lo: mpi-f90-file-interfaces.h
mpi.lo: mpi-f90-removed-interfaces.h
mpi.lo: $(top_builddir)/ompi/mpi/fortran/configure-fortran-output.h
mpi.lo: mpi-f90-cptr-interfaces.h
mpi.lo: pmpi-f90-interfaces.h
mpi.lo: pmpi-f90-status.h
mpi.lo: pmpi-f90-file-interfaces.h
mpi.lo: pmpi-f90-removed-interfaces.h
mpi.lo: pmpi-f90-cptr-interfaces.h
# Per MPI-3 p610:34-41, if we're building a TKR mpi module, we should
# not build any interfaces for MPI subroutines that take a choice
# buffer dummy argument. We therefore really only need to build a
# handful of subroutines.
lib@OMPI_LIBMPI_NAME@_usempi_la_SOURCES = \
mpi.F90 \
mpi_aint_add_f90.f90 \
mpi_aint_diff_f90.f90 \
mpi_wtick_f90.f90 \
mpi_wtime_f90.f90
# Don't distribute mpi-tkr-sizeof-*; they're generated.
nodist_lib@OMPI_LIBMPI_NAME@_usempi_la_SOURCES =
if BUILD_FORTRAN_SIZEOF
nodist_lib@OMPI_LIBMPI_NAME@_usempi_la_SOURCES += \
mpi-tkr-sizeof.h \
mpi-tkr-sizeof.f90
endif
mpi.lo: $(nodist_lib@OMPI_LIBMPI_NAME@_usempi_la_SOURCES)
libusempi_internal_modules =
if OMPI_FORTRAN_HAVE_TYPE_MPI_STATUS
libusempi_internal_modules += $(top_builddir)/ompi/mpi/fortran/use-mpi/libusempi_internal_modules.la
endif
# Note that we invoke some OPAL functions directly in
# libmpi_usempi.la, so we need to link in the OPAL library directly
# (pulling it in indirectly via libmpi.la does not work on all
# platforms).
lib@OMPI_LIBMPI_NAME@_usempi_la_LIBADD = \
$(top_builddir)/ompi/mpi/fortran/mpif-h/lib@OMPI_LIBMPI_NAME@_mpifh.la \
$(libusempi_internal_modules) \
$(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_NAME@.la
# Set the library version
lib@OMPI_LIBMPI_NAME@_usempi_la_LDFLAGS = \
-version-info $(libmpi_usempi_tkr_so_version) \
$(OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS)
#
# mpi-ignore-tkr-sizeof.* are generated based on some results from
# configure tests.
#
sizeof_pl=$(top_srcdir)/ompi/mpi/fortran/base/gen-mpi-sizeof.pl
mpi-tkr-sizeof.h: $(top_builddir)/config.status
mpi-tkr-sizeof.h: $(sizeof_pl)
mpi-tkr-sizeof.h:
$(OMPI_V_GEN) $(sizeof_pl) \
--header=$@ --ierror=mandatory \
--maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \
--generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \
--real2=$(OMPI_HAVE_FORTRAN_REAL2) \
--iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \
--real16=$(OMPI_HAVE_FORTRAN_REAL16) \
--complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \
--complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32) \
--mpi_version=$(MPI_VERSION) \
--request_deprecate=$(OMPI_FORTRAN_HAVE_ATTR_DEPRECATED)
mpi-tkr-sizeof.f90: $(top_builddir)/config.status
mpi-tkr-sizeof.f90: $(sizeof_pl)
mpi-tkr-sizeof.f90:
$(OMPI_V_GEN) $(sizeof_pl) \
--impl=$@ --ierror=mandatory --mpi --pmpi \
--maxrank=$(OMPI_FORTRAN_MAX_ARRAY_RANK) \
--generate=$(OMPI_FORTRAN_BUILD_SIZEOF) \
--real2=$(OMPI_HAVE_FORTRAN_REAL2) \
--iso_real16=$(OMPI_FORTRAN_HAVE_ISO_FORTRAN_ENV_REAL16) \
--real16=$(OMPI_HAVE_FORTRAN_REAL16) \
--complex4=$(OMPI_HAVE_FORTRAN_COMPLEX4) \
--complex32=$(OMPI_HAVE_FORTRAN_COMPLEX32)
#
# Clean up all F90 module files and all generated files
#
CLEANFILES += mpi-tkr-sizeof.h mpi-tkr-sizeof.f90
MOSTLYCLEANFILES = *.mod
DISTCLEANFILES = $(nodist_lib@OMPI_LIBMPI_NAME@_usempi_la_SOURCES)
#
# 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)$(OMPI_FORTRAN_MODULEDIR); \
$(INSTALL) $$file $(DESTDIR)$(OMPI_FORTRAN_MODULEDIR); \
done
uninstall-local:
@ for file in `ls *.mod`; do \
echo rm -f $(DESTDIR)$(OMPI_FORTRAN_MODULEDIR)/$$file; \
rm -f $(DESTDIR)$(OMPI_FORTRAN_MODULEDIR)/$$file; \
done
# if OMPI_BUILD_FORTRAN_USEMPI_TKR_BINDINGS
endif
# These files must be EXTRA_DIST'ed because they are included; they
# are not compiled directly (and we *can't* list the .F90 file in
# _SOURCES, because it would be compiled -- but it *must* have a .F90
# suffix so that the Fortran compiler will interpret the #if
# directives properly).
EXTRA_DIST = \
mpi-f90-interfaces.h \
mpi-f90-status.h \
mpi-f90-file-interfaces.h \
mpi-f90-removed-interfaces.h \
mpi-f90-cptr-interfaces.h \
pmpi-f90-interfaces.h \
pmpi-f90-status.h \
pmpi-f90-file-interfaces.h \
pmpi-f90-removed-interfaces.h \
pmpi-f90-cptr-interfaces.h
|