Add a configure test that mimics what OMPI's current mpi_f08
implementation does (that is not quite adherant to the Fortran standard). If a compiler allows this behavior, build the mpi_f08 wrapper. For example, ifort allows it, but Pathscale/EKOPath 5.0 is stricter in its Fortran compliance and disallows it. This test is temporary; the real fix is to make OMPI adhere to Fortran properly (i.e., see #4157). Once we fix #4157, this test should be removed. The main reason for committing this test is to put it into v1.7.4 so that we can release, but with the intent to remove it by 1.7.5 (or 1.8.x at the latest!). Refs trac:4157 cmr=v1.7.4:reviewer=ompi-rm1.7:subject=Add mpi_f08-(non)compliance configure test This commit was SVN r30440. The following Trac tickets were found above: Ticket 4157 --> https://svn.open-mpi.org/trac/ompi/ticket/4157
Этот коммит содержится в:
родитель
af4a9a0688
Коммит
6adc16081a
21
README
21
README
@ -361,10 +361,20 @@ Compiler Notes
|
||||
(but are, as yet, only lightly tested). It is expected that this
|
||||
support will mature over time.
|
||||
|
||||
As of this release, the GNU Fortran compiler (gfortran) is *not*
|
||||
supported with the mpi_f08 module. It is likely that a future
|
||||
release of Open MPI will provide an mpi_f08 module that will be
|
||||
compatible with gfortran >= v4.9.
|
||||
There is a bug in Open MPI's mpi_f08 module that will (correctly)
|
||||
cause a compile failure when Open MPI is built with a
|
||||
strict-adherence Fortran compiler. As of this writing, such
|
||||
compilers include the (as-yet-unreleased) GNU Fortran compiler
|
||||
v4.9 and the Pathscale EKOPath 5.0 compiler (although Pathscale
|
||||
has committed to releasing version 5.1 that works around Open
|
||||
MPI's bug -- kudos!). A future version of Open MPI will fix this
|
||||
bug. See https://svn.open-mpi.org/trac/ompi/ticket/4157 for more
|
||||
details.
|
||||
|
||||
The GNU Fortran compiler (gfortran) version < v4.9 is *not*
|
||||
supported with the mpi_f08 module. Per the previous paragraph, it
|
||||
is likely that a future release of Open MPI will provide an
|
||||
mpi_f08 module that will be compatible with gfortran >= v4.9.
|
||||
|
||||
- All Fortran compilers support the mpif.h/shmem.fh-based bindings.
|
||||
|
||||
@ -1215,7 +1225,8 @@ MPI FUNCTIONALITY
|
||||
|
||||
* With no value for BINDING (i.e., just "--enable-mpi-fortran"):
|
||||
synonym for BINDING=all
|
||||
* BINDING=all or yes: attempt to build all 3 Fortran bindings
|
||||
* BINDING=all or yes: attempt to build all 3 Fortran bindings; skip
|
||||
any binding that cannot be built
|
||||
* BINDING=mpifh: build mpif.h support
|
||||
* BINDING=usempi: build mpif.h and "mpi" module support
|
||||
* BINDING=usempif08: build mpif.h, "mpi" module, and "mpi_f08"
|
||||
|
98
config/ompi_fortran_check_ticket_4157.m4
Обычный файл
98
config/ompi_fortran_check_ticket_4157.m4
Обычный файл
@ -0,0 +1,98 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# Special check for ticket 4157. This test will eventually disappear.
|
||||
# See https://svn.open-mpi.org/trac/ompi/ticket/4157.
|
||||
#
|
||||
# OMPI_FORTRAN_CHECK_TICKET_4157([action if happy], [action if not happy])
|
||||
# ----------------------------------------------------
|
||||
AC_DEFUN([OMPI_FORTRAN_CHECK_TICKET_4157],[
|
||||
AS_VAR_PUSHDEF([ticket_4157_var], [ompi_cv_fortran_ticket_4157])
|
||||
|
||||
AC_CACHE_CHECK([for ticket 4157 issues], ticket_4157_var,
|
||||
[AC_LANG_PUSH([Fortran])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
MODULE MY_ABSTRACT_MODULE
|
||||
ABSTRACT INTERFACE
|
||||
SUBROUTINE ABSTRACT_INTERFACE(A, B)
|
||||
IMPLICIT NONE
|
||||
INTEGER :: A
|
||||
LOGICAL :: B
|
||||
END SUBROUTINE ABSTRACT_INTERFACE
|
||||
END INTERFACE
|
||||
END MODULE MY_ABSTRACT_MODULE
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
MODULE MY_CONCRETE_MODULE
|
||||
INTERFACE
|
||||
SUBROUTINE MY_CONCRETE_SUB(A, B)
|
||||
IMPLICIT NONE
|
||||
INTEGER :: A
|
||||
LOGICAL :: B
|
||||
END SUBROUTINE MY_CONCRETE_SUB
|
||||
END INTERFACE
|
||||
END MODULE MY_CONCRETE_MODULE
|
||||
|
||||
SUBROUTINE MY_CONCRETE_SUB(A, B)
|
||||
IMPLICIT NONE
|
||||
INTEGER :: A
|
||||
LOGICAL :: B
|
||||
|
||||
PRINT *, "I'm in MY_CONCRETE_SUB", A, B
|
||||
END SUBROUTINE MY_CONCRETE_SUB
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
MODULE MY_MODULE
|
||||
INTERFACE
|
||||
SUBROUTINE MY_SUB(A, B) BIND(C, NAME="FOO")
|
||||
USE MY_ABSTRACT_MODULE
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(IN) :: A
|
||||
PROCEDURE(ABSTRACT_INTERFACE) :: B
|
||||
END SUBROUTINE MY_SUB
|
||||
END INTERFACE
|
||||
END MODULE MY_MODULE
|
||||
|
||||
SUBROUTINE MY_SUB(A, B) BIND(C, NAME="FOO")
|
||||
USE MY_ABSTRACT_MODULE
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(IN) :: A
|
||||
PROCEDURE(ABSTRACT_INTERFACE) :: B
|
||||
|
||||
LOGICAL :: C
|
||||
|
||||
C = .TRUE.
|
||||
PRINT *, "I'm in MY_SUB", A, C
|
||||
CALL B(A, C)
|
||||
END SUBROUTINE MY_SUB
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
PROGRAM TEST_ABSTRACT_PROCEDURE
|
||||
USE MY_ABSTRACT_MODULE
|
||||
USE MY_CONCRETE_MODULE
|
||||
USE MY_MODULE
|
||||
IMPLICIT NONE
|
||||
INTEGER :: FOO
|
||||
|
||||
FOO = 3
|
||||
CALL MY_SUB(FOO, MY_CONCRETE_SUB)
|
||||
END PROGRAM TEST_ABSTRACT_PROCEDURE
|
||||
]])],
|
||||
[AS_VAR_SET(ticket_4157_var, happy)],
|
||||
[AS_VAR_SET(ticket_4157_var, unhappy)])
|
||||
AC_LANG_POP([Fortran])
|
||||
])
|
||||
|
||||
AS_VAR_IF(ticket_4157_var, [happy], [$1], [$2])
|
||||
AS_VAR_POPDEF([ticket_4157_var])
|
||||
])
|
@ -448,6 +448,22 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
|
||||
[OMPI_FORTRAN_HAVE_PROCEDURE=1],
|
||||
[OMPI_FORTRAN_HAVE_PROCEDURE=0])])
|
||||
|
||||
# Per https://svn.open-mpi.org/trac/ompi/ticket/4157, temporarily
|
||||
# disqualify the fortran compiler if it exhibits the behavior
|
||||
# described in that ticket. Short version: OMPI does something
|
||||
# non-Fortran that we don't have time to fix 1.7.4. So we just
|
||||
# disqualify Fortran compilers who actually enforce this issue,
|
||||
# and we'll fix OMPI to be Fortran-compliant after 1.7.4
|
||||
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 && \
|
||||
test $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1 && \
|
||||
test $OMPI_FORTRAN_HAVE_PROCEDURE -eq 1 && \
|
||||
test $OMPI_FORTRAN_HAVE_ABSTRACT -eq 1],
|
||||
[ # Check for ticket 4157
|
||||
OMPI_FORTRAN_CHECK_TICKET_4157(
|
||||
[],
|
||||
[ # If we don't have this, don't build the mpi_f08 module
|
||||
OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS=0])])
|
||||
|
||||
OMPI_FORTRAN_F08_HANDLE_SIZE=4
|
||||
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
|
||||
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user