Skip to content

Commit 58960cc

Browse files
committed
configury: test Fortran complex(real16)
Recent NVHPC compilers now support the REAL16 intrinsic from the ISO_FORTRAN_ENV module. Though they do support real(REAL16), they do not support complex(REAL16), causing a compilation error in the MPI_Sizeof() Fortran subroutine. This patch does test complex(REAL16) on top of real(REAL16), and issue a warning and disable ISO_FORTRAN_ENV:REAL16 support if the former is not supported but the latter is. Thanks Jorge Cabrera for reporting this. Refs #13190 Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 176278f commit 58960cc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

config/ompi_fortran_check_iso_fortran_env_real16.m4

+16
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@ end program]])],
2828
[AS_VAR_SET(iso_fortran_env_var_real16, no)])
2929
AC_LANG_POP([Fortran])
3030
])
31+
AS_VAR_IF(iso_fortran_env_var_real16, [yes],
32+
[AC_MSG_CHECKING([if Fortran compiler supports complex(ISO_FORTRAN_ENV:REAL16)])
33+
AC_LANG_PUSH([Fortran])
34+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program check_for_iso_fortran_env_real16
35+
use, intrinsic :: iso_fortran_env
36+
complex(REAL16) :: var
37+
var = 12.34
38+
end program]])],
39+
[AC_MSG_RESULT([yes])],
40+
[AC_MSG_RESULT([no])
41+
AC_MSG_WARN([*** Fortran compiler supports real(REAL16) but])
42+
AC_MSG_WARN([*** does *not* support complex(REAL16)])
43+
AC_MSG_WARN([*** Disabling support for ISO_FORTRAN_ENV:REAL16])
44+
AS_VAR_SET(iso_fortran_env_var_real16, no)])
45+
AC_LANG_POP([Fortran])],
46+
[])
3147

3248
AS_VAR_IF(iso_fortran_env_var_real16, [yes], [$1], [$2])
3349
AS_VAR_POPDEF([iso_fortran_env_var_real16])

0 commit comments

Comments
 (0)