Skip to content

Commit 8c601e1

Browse files
committed
configury: harden Fortran IGNORE_TKR check
as reported in #12506, upcoming LLVM 19 can generate some false positive that will make the mpi Fortran modules unusable. Harden the test by using a module in order to fix that. Thanks Paul Osmialowski for bringing this to our attention. Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent 8ef1ef8 commit 8c601e1

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

config/ompi_fortran_check_ignore_tkr.m4

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ 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.
1616
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
17+
dnl Copyright (c) 2024 Research Organization for Information Science
18+
dnl and Technology (RIST). All rights reserved.
1719
dnl $COPYRIGHT$
1820
dnl
1921
dnl Additional copyrights may follow
@@ -133,6 +135,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [
133135
AC_MSG_CHECKING([for Fortran compiler support of $3])
134136
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[[!
135137
! Autoconf puts "program main" at the top
138+
implicit none
136139

137140
interface
138141
subroutine force_assumed_shape(a, count)
@@ -157,6 +160,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [
157160
complex, pointer, dimension(:,:) :: ptr
158161
target :: buffer3
159162
integer :: buffer4
163+
integer :: a
160164
ptr => buffer3
161165

162166
! Set some known values (somewhat irrelevant for this test, but just be
@@ -189,8 +193,23 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [
189193
call foo(a, count)
190194
end subroutine force_assumed_shape
191195

196+
module check_ignore_tkr
197+
interface
198+
subroutine foobar(buffer, count)
199+
$1 buffer
200+
$2, intent(in) :: buffer
201+
integer, intent(in) :: count
202+
end subroutine foobar
203+
end interface
204+
end module
205+
206+
subroutine bar(var)
207+
use check_ignore_tkr
208+
implicit none
209+
real, intent(inout) :: var(:, :, :)
210+
211+
call foobar(var(1,1,1), 1)
192212
! Autoconf puts "end" after the last line
193-
subroutine bogus
194213
]]),
195214
[msg=yes
196215
ompi_fortran_ignore_tkr_predecl="$1"

0 commit comments

Comments
 (0)