1
1
openmpi/Makefile.ompi-rules
Jeff Squyres d7eaca83fa Fortran: Fix MPI_SIZEOF. What a disaster. :-(
What started as a simple ticket ended up reaching the way up to the
MPI Forum.
    
It turns out that we are supposed to have MPI_SIZEOF for all Fortran
interfaces: mpif.h, the mpi module, and the mpi_f08 module.
    
It further turns out that to properly support MPI_SIZEOF, your Fortran
compiler *has* support the INTERFACE keyword and ISO_FORTRAN_ENV.  We
can't use "ignore TKR" functionality, because the whole point of
MPI_SIZEOF is that the implementation knows what type was passed to it
("ignore TKR" functionality, by definition, throws that information
away).  Hence, we have to have an MPI_SIZEOF interface+implementation
for all intrinsic types, kinds, and ranks.

This commit therefore adds a perl script that generates both the
interfaces and implementations for MPI_SIZEOF in each of mpif.h, the
mpi module, and mpi_f08 module (yay consolidation!).

The perl script uses the results of some new configure tests:

* check if the Fortran compiler supports the INTERFACE keyword
* check if the Fortran compiler supports ISO_FORTRAN_ENV
* find the max array rank (i.e., dimension) that the compiler supports

If the Fortran compiler supports both INTERFACE and ISO_FORTRAN_ENV,
then we'll build the MPI_SIZEOF interfaces.  If not, we'll skip
MPI_SIZEOF in mpif.h and the mpi module.  Note that we won't build the
mpi_f08 module -- to include the MPI_SIZEOF interfaces -- if the
Fortran compiler doesn't support INTERFACE, ISO_FORTRAN_ENV, and a
whole bunch of ther modern Fortran stuff.

Since MPI_SIZEOF interfaces are now generated by the perl script, this
commit also removes all the old MPI_SIZEOF implementations (which were
laden with a zillion #if blocks).

cmr=v1.8.3

This commit was SVN r32764.
2014-09-19 13:44:52 +00:00

54 строки
1.6 KiB
Makefile

# -*- makefile -*-
# Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
.1in.1:
@ echo " SED $@"
@ sed -e 's/#PACKAGE_NAME#/@PACKAGE_NAME@/g' \
-e 's/#PACKAGE_VERSION#/@PACKAGE_VERSION@/g' \
-e 's/#OMPI_DATE#/@OMPI_RELEASE_DATE@/g' \
-e 's/#OPAL_DATE#/@OMPI_RELEASE_DATE@/g' \
-e 's/#ORTE_DATE#/@OMPI_RELEASE_DATE@/g' \
> $@ < $<
.3in.3:
@ echo " SED $@"
@ sed -e 's/#PACKAGE_NAME#/@PACKAGE_NAME@/g' \
-e 's/#PACKAGE_VERSION#/@PACKAGE_VERSION@/g' \
-e 's/#OMPI_DATE#/@OMPI_RELEASE_DATE@/g' \
-e 's/#OPAL_DATE#/@OMPI_RELEASE_DATE@/g' \
-e 's/#ORTE_DATE#/@OMPI_RELEASE_DATE@/g' \
> $@ < $<
.7in.7:
@ echo " SED $@"
@ sed -e 's/#PACKAGE_NAME#/@PACKAGE_NAME@/g' \
-e 's/#PACKAGE_VERSION#/@PACKAGE_VERSION@/g' \
-e 's/#OMPI_DATE#/@OMPI_RELEASE_DATE@/g' \
-e 's/#OPAL_DATE#/@OMPI_RELEASE_DATE@/g' \
-e 's/#ORTE_DATE#/@OMPI_RELEASE_DATE@/g' \
> $@ < $<
# A little verbosity magic; "make" will show the terse output. "make
# V=1" will show the actual commands used (just like the other
# Automake-generated compilation/linker rules).
V=0
OMPI_V_LN_S = $(ompi__v_LN_S_$V)
ompi__v_LN_S_ = $(ompi__v_LN_S_$AM_DEFAULT_VERBOSITY)
ompi__v_LN_S_0 = @echo " LN_S " `basename $@`;
OMPI_V_MKDIR = $(ompi__v_MKDIR_$V)
ompi__v_MKDIR_ = $(ompi__v_MKDIR_$AM_DEFAULT_VERBOSITY)
ompi__v_MKDIR_0 = @echo " MKDIR " $@;
OMPI_V_GEN = $(ompi__v_GEN_$V)
ompi__v_GEN_ = $(ompi__v_GEN_$AM_DEFAULT_VERBOSITY)
ompi__v_GEN_0 = @echo " GENERATE" $@;