@@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved.
1111dnl Copyright (c) 2004-2005 The Regents of the University of California.
1212dnl All rights reserved.
1313dnl Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
14- dnl Copyright (c) 2017 IBM Corporation. All rights reserved.
14+ dnl Copyright (c) 2017 IBM Corporation. All rights reserved.
1515dnl $COPYRIGHT $
1616dnl
1717dnl Additional copyrights may follow
2828AC_DEFUN([OMPI_FORTRAN_CHECK_STORAGE_SIZE],[
2929 AS_VAR_PUSHDEF([fortran_storage_size_var], [ompi_cv_fortran_have_storage_size])
3030
31+ # Re PR: https://github.com/open-mpi/ompi/pull/3822
32+ # We explored correcting the following syntax to compile with gfortran 4.8
33+ # - size = storage_size(x) / 8
34+ # + size = storage_size(x(1)) / 8
35+ # That allowed gfortran 4.8 to pass this configure test, but fail to
36+ # correctly handle mpi_sizeof due to the weak test for INTERFACE in
37+ # ompi_fortran_check_interface.m4. Until we can strengthen that configure
38+ # check we reverted the commit from PR #3822 to keep the old logic here
39+ # so that gfortran 4.8 will disqualify itself correctly for mpi_sizeof()
40+ # support.
41+ #
3142 AC_CACHE_CHECK([if Fortran compiler supports STORAGE_SIZE for relevant types],
3243 fortran_storage_size_var,
3344 [AC_LANG_PUSH([Fortran])
@@ -62,7 +73,7 @@ SUBROUTINE storage_size_complex32_r1(x, size)
6273 COMPLEX(REAL32), DIMENSION(* )::x
6374 INTEGER, INTENT(OUT) :: size
6475
65- size = storage_size(x(1) ) / 8
76+ size = storage_size(x) / 8
6677END SUBROUTINE storage_size_complex32_r1
6778
6879SUBROUTINE storage_size_int32_scalar(x, size)
@@ -78,7 +89,7 @@ SUBROUTINE storage_size_int32_r1(x, size)
7889 INTEGER(INT32), DIMENSION(* )::x
7990 INTEGER, INTENT(OUT) :: size
8091
81- size = storage_size(x(1) ) / 8
92+ size = storage_size(x) / 8
8293END SUBROUTINE storage_size_int32_r1
8394
8495SUBROUTINE storage_size_real32_scalar(x, size)
@@ -94,7 +105,7 @@ SUBROUTINE storage_size_real32_r1(x, size)
94105 REAL(REAL32), DIMENSION(* )::x
95106 INTEGER, INTENT(OUT) :: size
96107
97- size = storage_size(x(1) ) / 8
108+ size = storage_size(x) / 8
98109END SUBROUTINE storage_size_real32_r1
99110]])],
100111 [AS_VAR_SET(fortran_storage_size_var, yes)],
0 commit comments