From 903055ce8a40711a86f32b63954b29480d7c181b Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 24 Jul 2024 13:11:30 +0900 Subject: [PATCH] configury: harden IGNORE_TKR check NVIDIA HPC Compiler (e.g. nvfortran) incorrectly selected the GCC style pragmas to support IGNORE_TKR. Harden the test by mimicking exactly the mpi f08 bindings in order to fix that false positive. Thanks Chris Parrot for the report. Refs. open-mpi/ompi#11582 Signed-off-by: Gilles Gouaillardet bot:notacherrypick (back-ported from commit 600df6aa57a473f17041e34a0a583db4acefe213) --- config/ompi_fortran_check_ignore_tkr.m4 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/config/ompi_fortran_check_ignore_tkr.m4 b/config/ompi_fortran_check_ignore_tkr.m4 index d9965376098..f319f8cc576 100644 --- a/config/ompi_fortran_check_ignore_tkr.m4 +++ b/config/ompi_fortran_check_ignore_tkr.m4 @@ -189,8 +189,23 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [ call foo(a, count) end subroutine force_assumed_shape + module check_ignore_tkr + interface foobar + subroutine foobar_x(buffer, count) + $1 buffer + $2, intent(in) :: buffer + integer, intent(in) :: count + end subroutine foobar_x + 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" @@ -198,6 +213,7 @@ AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [ $4], [msg=no $5]) + rm -f *.mod AC_MSG_RESULT($msg) AC_LANG_POP([Fortran]) OPAL_VAR_SCOPE_POP