@@ -17,7 +17,7 @@ dnl reserved.
1717dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
1818dnl Copyright (c) 2014-2021 Research Organization for Information Science
1919dnl and Technology (RIST). All rights reserved.
20- dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
20+ dnl Copyright (c) 2016-2022 IBM Corporation. All rights reserved.
2121dnl Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
2222dnl Copyright (c) 2022 Triad National Security, LLC. All rights
2323dnl reserved.
@@ -307,6 +307,38 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
307307 OMPI_FORTRAN_GET_KIND_VALUE([C_INT32_T], 9, [OMPI_FORTRAN_C_INT32_T_KIND])
308308 OMPI_FORTRAN_GET_KIND_VALUE([C_INT64_T], 18, [OMPI_FORTRAN_C_INT64_T_KIND])
309309
310+ #
311+ # See if "attributes deprecated" is supported
312+ # - False positives were seen with compilers like XL which will ignore
313+ # this option by default, but if the user specifies some options to
314+ # the wrapper compiler later it will fail to recognize the option.
315+ # - For now just limit this check to compilers that we know will work
316+ # This directive is only recognized, and works, for gfortran 11.0 and
317+ # later. As a result, this directive is generated only if the
318+ # Fortran compiler building Open MPI is gfortran 11.0 or later.
319+ OMPI_FORTRAN_HAVE_ATTR_DEPRECATED= 0
320+ AS_IF([test $ompi_fortran_happy -eq 1],
321+ [AC_MSG_CHECKING([if Fortran compiler supports the deprecated attribute])
322+ AS_IF([test " $opal_cv_c_compiler_vendor " = " gnu" ],
323+ [AC_LANG_PUSH([Fortran])
324+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program check_for_attr_deprecated
325+ ! GCC$ ATTRIBUTES DEPRECATED :: x
326+ real* 4 x
327+ x = 123.4
328+ print * ,x
329+ end program]])],
330+ [OMPI_FORTRAN_HAVE_ATTR_DEPRECATED= 1
331+ AC_MSG_RESULT([Yes])],
332+ [AC_MSG_RESULT([No])])
333+ AC_LANG_POP([Fortran])],
334+ [AC_MSG_RESULT([Unknown])])
335+ ])
336+ AC_SUBST(OMPI_FORTRAN_HAVE_ATTR_DEPRECATED)
337+ AC_DEFINE_UNQUOTED(OMPI_FORTRAN_HAVE_ATTR_DEPRECATED,
338+ $OMPI_FORTRAN_HAVE_ATTR_DEPRECATED ,
339+ [Whether the compiler supports Fortran ATTRIBUTES DEPRECATED or not])
340+
341+
310342 # --------------------------------------------------------
311343 # Fortran mpif.h MPI bindings
312344 # --------------------------------------------------------
0 commit comments