From 2b4038e5e75dd488cd920e0b2f8e6382ac254bff Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 19 Aug 2015 08:40:27 -0500 Subject: [svn-r27524] Added test to not remove double precision from valid KINDS if it is the largest compatible REAL with C. Tested: h5committest. --- config/cmake/HDF5UseFortran.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index b3dec14..02f97f0 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -351,14 +351,18 @@ set(FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) # remove the invalid kind from the list if(NOT(${SIZEOF___FLOAT128} EQUAL 0)) - if(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof})) + if(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) + AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) + # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, + # so we don't want to remove the 8-byte fortran doubles. + AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) message(WARNING " Fortran REAL(KIND=${max_real_fortran_kind}) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size !!! Fortran interfaces will not be generated for REAL(KIND=${max_real_fortran_kind}) !!!") string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS ${PAC_FC_ALL_REAL_KINDS}) string(REGEX REPLACE ",[0-9]+}" "}" PAC_FC_ALL_REAL_KINDS_SIZEOF ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) MATH (EXPR NUM_RKIND "${NUM_RKIND} - 1") - endif(NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof})) + endif() endif(NOT(${SIZEOF___FLOAT128} EQUAL 0)) set(H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") -- cgit v0.12