From 967550b3ace865ff31d39ad96e71bf778852e263 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 24 Jan 2014 23:17:14 +0000 Subject: [PATCH] Update the BIND(C, name="foo") test to see if the compiler supports names longer than 32 characters. Per discussion on the devel list starting here: http://www.open-mpi.org/community/lists/devel/2014/01/13799.php we need a new litmus test to disqualify older Fortran compilers (e.g., Pathscale 4.0.12) that *seem* to support all the Right Things, but a) do not support BIND(C, name="super_long_name") or b) run into an internal error when compiling our mpi_f08 module. Testing for b) is sketchy at best. But OMPI has some BIND(C) names that are >32 characters, and the same compilers that exhibit b) also seem to not support BIND(C) names that are >32 characters (i.e., a)). Hence, the following BIND(C) test checks to ensure that BIND(C, name="foo") works, where "foo" is actually a name >32 characters. cmr=v1.7.4:reviewer=rhc:subject=Update Fortran configure test to exclude older pathscale/open64 compilers from mpi_f08 This commit was SVN r30421. --- config/ompi_fortran_check_bind_c.m4 | 5 ++++- config/ompi_setup_mpi_fortran.m4 | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/config/ompi_fortran_check_bind_c.m4 b/config/ompi_fortran_check_bind_c.m4 index 2631676d78..0455308523 100644 --- a/config/ompi_fortran_check_bind_c.m4 +++ b/config/ompi_fortran_check_bind_c.m4 @@ -96,6 +96,9 @@ end module]])], AC_DEFUN([OMPI_FORTRAN_CHECK_BIND_C_TYPE_NAME],[ AS_VAR_PUSHDEF([bind_c_type_name_var], [ompi_cv_fortran_have_bind_c_type_name]) + # See comment in ompi_setup_mpi_fortran.m4: it is important that + # the bind(c) name in this text is longer than 32 characters. + AC_CACHE_CHECK([if Fortran compiler supports TYPE(type), BIND(C, NAME="name")], bind_c_type_name_var, [AC_LANG_PUSH([Fortran]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[module bindc_test @@ -104,7 +107,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_BIND_C_TYPE_NAME],[ integer :: value end type foo - type(foo), bind(c, name="c_name") :: bar + type(foo), bind(c, name="really_long_name_longer_than_32_chars") :: bar end module]])], [AS_VAR_SET(bind_c_type_name_var, yes)], [AS_VAR_SET(bind_c_type_name_var, no)]) diff --git a/config/ompi_setup_mpi_fortran.m4 b/config/ompi_setup_mpi_fortran.m4 index 276accbd53..cf419686db 100644 --- a/config/ompi_setup_mpi_fortran.m4 +++ b/config/ompi_setup_mpi_fortran.m4 @@ -375,6 +375,18 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[ [OMPI_FORTRAN_HAVE_BIND_C_TYPE=0 OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS=0])]) + # Per discussion on the devel list starting here: + # http://www.open-mpi.org/community/lists/devel/2014/01/13799.php + # we need a new litmus test to disqualify older Fortran compilers + # (e.g., Pathscale 4.0.12) that *seem* to support all the Right + # Things, but a) do not support BIND(C, name="super_long_name") or + # b) run into an internal error when compiling our mpi_f08 module. + # Testing for b) is sketchy at best. But OMPI has some BIND(C) + # names that are >32 characters, and the same compilers that + # exhibit b) also seem to not support BIND(C) names that are >32 + # characters (i.e., a)). Hence, the following BIND(C) test checks + # to ensure that BIND(C, name="foo") works, where "foo" is + # actually a name >32 characters. OMPI_FORTRAN_HAVE_BIND_C_TYPE_NAME=0 AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \ $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],