1
1
openmpi/config/ompi_fortran_check_ticket_4157.m4
Jeff Squyres 87651a1e18 Ensure configure test compiler turds are removed.
This particular test can leave various <foo>.mod files in the OMPI top
build dir, which leads developers to say "what are these .mod files in
my 'svn status' output?".

So make a subdir, run the tests in there, and then remove the subdir.

Reviewed by Dave Goodell.

This is not 100% necessary for OMPI 1.7.4, but it would be nice.  The
goal is to have this test removed by OMPI 1.7.5 (i.e., fix ticket
4157).  So I leave it up to the RM to decide whether this goes into
1.7.4 or not.

cmr=v1.7.4:reviewer=ompi-rm1.7

This commit was SVN r30524.
2014-01-31 16:45:29 +00:00

104 строки
2.6 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])
rm -rf conftest.$$.d
mkdir conftest.$$.d
cd conftest.$$.d
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])
cd ..
rm -rf contest.$$.d
])
AS_VAR_IF(ticket_4157_var, [happy], [$1], [$2])
AS_VAR_POPDEF([ticket_4157_var])
])