From 56593a4af7a7a98e14ffef2c037e4a48d65da1f2 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 9 Aug 2023 14:53:48 -0700 Subject: [PATCH] set H5_PAC_C_MAX_REAL_PRECISION default to 0 when cross compiling (#3365) with CMake to fix Fortran build failures. --- config/cmake/ConfigureChecks.cmake | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index e5192f54496..4da401a8174 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -858,21 +858,23 @@ if (HDF5_BUILD_FORTRAN) list (GET PROG_OUTPUT4 0 H5_LDBL_DIG) list (GET PROG_OUTPUT4 1 H5_FLT128_DIG) - endif () - if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL "0" OR FLT128_DIG EQUAL "0") - set (${HDF_PREFIX}_HAVE_FLOAT128 0) - set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) - set (_PAC_C_MAX_REAL_PRECISION ${H5_LDBL_DIG}) + if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL "0" OR FLT128_DIG EQUAL "0") + set (${HDF_PREFIX}_HAVE_FLOAT128 0) + set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) + set (_PAC_C_MAX_REAL_PRECISION ${H5_LDBL_DIG}) + else () + set (_PAC_C_MAX_REAL_PRECISION ${H5_FLT128_DIG}) + endif () + if (NOT ${_PAC_C_MAX_REAL_PRECISION}) + set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION 0) + else () + set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${_PAC_C_MAX_REAL_PRECISION}) + endif () + message (STATUS "maximum decimal precision for C var - ${${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION}") else () - set (_PAC_C_MAX_REAL_PRECISION ${H5_FLT128_DIG}) - endif () - if (NOT ${_PAC_C_MAX_REAL_PRECISION}) set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION 0) - else () - set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${_PAC_C_MAX_REAL_PRECISION}) endif () - message (STATUS "maximum decimal precision for C var - ${${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION}") endif()