6adc16081a
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
99 строки
2.4 KiB
Bash
99 строки
2.4 KiB
Bash
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])
|
|
])
|