Skip to content

Commit b784f3f

Browse files
committed
ompi_fortran_check_ignore_tkr.m4: fix fortran test errors
Fix bugs in the Fortran test code: 1. Called with "type(*)" instead of "type(*), dimension(*)" 2. Subroutine type was "real" when it should have been "complex" 3. Don't use a common block + BIND in the "use...only" test. Per #9812 (comment), this seems to violate the Fortran standard. Instead, just use conflicting variables in the aaa and bbb modules, and trust "use...only" to avoid the conflicts. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 89c09f1 commit b784f3f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

config/ompi_fortran_check_ignore_tkr.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dnl All rights reserved.
1313
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
1414
dnl reserved.
1515
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
16-
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
16+
dnl Copyright (c) 2009-2022 Cisco Systems, Inc. All rights reserved.
1717
dnl $COPYRIGHT$
1818
dnl
1919
dnl Additional copyrights may follow
@@ -72,7 +72,7 @@ AC_DEFUN([_OMPI_FORTRAN_CHECK_IGNORE_TKR], [
7272

7373
# Vendor-neutral, TYPE(*) syntax
7474
OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
75-
[!], [type(*)],
75+
[!], [type(*), dimension(*)],
7676
[TYPE(*), DIMENSION(*)],
7777
[happy=1], [happy=0])
7878

@@ -185,7 +185,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [
185185

186186
subroutine force_assumed_shape(a, count)
187187
integer :: count
188-
real, dimension(:,:) :: a
188+
complex, dimension(:,:) :: a
189189
call foo(a, count)
190190
end subroutine force_assumed_shape
191191

config/ompi_fortran_check_use_only.m4

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,19 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_USE_ONLY],[
4242
[AC_LANG_PUSH([Fortran])
4343
cat > aaa.f90 << EOF
4444
MODULE aaa
45-
INTEGER :: CMON(1)
46-
COMMON/CMMON/CMON
45+
! These 2 have the same names as variables in bbb
46+
! but they should not clash if we only import global_aaa
47+
INTEGER :: local1
48+
REAL :: local2
4749
INTEGER :: global_aaa
4850
END MODULE aaa
4951
EOF
5052
cat > bbb.f90 << EOF
5153
MODULE bbb
52-
integer, bind(C, name="cmmon_") :: CMON
54+
! These 2 have the same names as variables in aaa
55+
! but they should not clash if we only import global_bbb
56+
INTEGER :: local1
57+
COMPLEX :: local2
5358
INTEGER :: global_bbb
5459
END MODULE bbb
5560
EOF

0 commit comments

Comments
 (0)