Skip to content

Commit cb3d275

Browse files
authored
Merge pull request #8116 from ggouaillardet/topic/fortran_real128
configury: enhance the check for ISO_FORTRAN_ENV module
2 parents 7a922c8 + d091809 commit cb3d275

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

config/ompi_fortran_check_iso_fortran_env.m4

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ dnl University of Stuttgart. All rights reserved.
1111
dnl Copyright (c) 2004-2005 The Regents of the University of California.
1212
dnl All rights reserved.
1313
dnl Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
14+
dnl Copyright (c) 2020 Research Organization for Information Science
15+
dnl and Technology (RIST). All rights reserved.
1416
dnl $COPYRIGHT$
1517
dnl
1618
dnl Additional copyrights may follow
@@ -24,19 +26,24 @@ dnl
2426
# ----------------------------------------------------
2527
AC_DEFUN([OMPI_FORTRAN_CHECK_ISO_FORTRAN_ENV],[
2628
AS_VAR_PUSHDEF([iso_fortran_env_var], [ompi_cv_fortran_have_iso_fortran_env])
29+
OPAL_VAR_SCOPE_PUSH([iso_fortran_env_kind])
2730

2831
AC_CACHE_CHECK([if Fortran compiler supports ISO_FORTRAN_ENV], iso_fortran_env_var,
29-
[AC_LANG_PUSH([Fortran])
32+
[AS_IF([test $OMPI_HAVE_FORTRAN_REAL16 -eq 1],
33+
[iso_fortran_env_kind=real128],
34+
[iso_fortran_env_kind=real32])
35+
AC_LANG_PUSH([Fortran])
3036
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program check_for_iso_fortran_env
3137
use, intrinsic :: iso_fortran_env
32-
real(real32) :: var
38+
real($iso_fortran_env_kind) :: var
3339
var = 12.34
3440
end program]])],
3541
[AS_VAR_SET(iso_fortran_env_var, yes)],
3642
[AS_VAR_SET(iso_fortran_env_var, no)])
3743
AC_LANG_POP([Fortran])
3844
])
3945

46+
OPAL_VAR_SCOPE_POP
4047
AS_VAR_IF(iso_fortran_env_var, [yes], [$1], [$2])
4148
AS_VAR_POPDEF([iso_fortran_env_var])
4249
])

0 commit comments

Comments
 (0)