Skip to content

Commit

Permalink
configury: harden Fortran IGNORE_TKR check
Browse files Browse the repository at this point in the history
as reported in open-mpi#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>
  • Loading branch information
ggouaillardet committed May 2, 2024
1 parent 8ef1ef8 commit 8c601e1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion config/ompi_fortran_check_ignore_tkr.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2024 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
Expand Down Expand Up @@ -133,6 +135,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [
AC_MSG_CHECKING([for Fortran compiler support of $3])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[[!
! Autoconf puts "program main" at the top
implicit none

interface
subroutine force_assumed_shape(a, count)
Expand All @@ -157,6 +160,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [
complex, pointer, dimension(:,:) :: ptr
target :: buffer3
integer :: buffer4
integer :: a
ptr => buffer3

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

module check_ignore_tkr
interface
subroutine foobar(buffer, count)
$1 buffer
$2, intent(in) :: buffer
integer, intent(in) :: count
end subroutine foobar
end interface
end module

subroutine bar(var)
use check_ignore_tkr
implicit none
real, intent(inout) :: var(:, :, :)

call foobar(var(1,1,1), 1)
! Autoconf puts "end" after the last line
subroutine bogus
]]),
[msg=yes
ompi_fortran_ignore_tkr_predecl="$1"
Expand Down

0 comments on commit 8c601e1

Please sign in to comment.