diff options
-rw-r--r-- | config/cmake/HDF5UseFortran.cmake | 41 | ||||
-rw-r--r-- | m4/aclocal_fc.m4 | 18 |
2 files changed, 50 insertions, 9 deletions
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 75bd17c..66e70b4 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -217,6 +217,17 @@ list(GET PROG_OUTPUT 0 pac_validIntKinds) list(GET PROG_OUTPUT 1 pac_validRealKinds) list(GET PROG_OUTPUT 2 H5_PAC_FC_MAX_REAL_PRECISION) +# If the lists are empty then something went wrong. +if( NOT pac_validIntKinds) + message (FATAL_ERROR "Failed to find available INTEGER KINDs for Fortran") +endif() +if( NOT pac_validRealKinds) + message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") +endif() +if( NOT H5_PAC_FC_MAX_REAL_PRECISION) + message (FATAL_ERROR "No output from Fortran decimal precision program") +endif() + set(PAC_FC_ALL_INTEGER_KINDS "\{${pac_validIntKinds}\}") set(PAC_FC_ALL_REAL_KINDS "\{${pac_validRealKinds}\}") @@ -257,6 +268,11 @@ foreach( KIND ${VAR} ) string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") set(pack_int_sizeof "${pack_int_sizeof} ${PROG_OUTPUT1},") endforeach(KIND) + +if (pack_int_sizeof STREQUAL "") + message (FATAL_ERROR "Failed to find available INTEGER KINDs for Fortran") +endif() + string(STRIP ${pack_int_sizeof} pack_int_sizeof) @@ -297,6 +313,11 @@ foreach( KIND ${VAR} ) string(REGEX REPLACE "\n" "" PROG_OUTPUT1 "${PROG_OUTPUT1}") set(pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") endforeach(KIND) + +if (pack_int_sizeof STREQUAL "") + message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") +endif() + string(STRIP ${pack_real_sizeof} pack_real_sizeof) #Remove trailing comma @@ -357,6 +378,26 @@ list(GET PROG_OUTPUT 3 PAC_FORTRAN_NATIVE_REAL_KIND) list(GET PROG_OUTPUT 4 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) list(GET PROG_OUTPUT 5 PAC_FORTRAN_NATIVE_DOUBLE_KIND) +if (NOT PAC_FORTRAN_NATIVE_INTEGER_SIZEOF) + message (FATAL_ERROR "Failed to find SIZEOF NATIVE INTEGER KINDs for Fortran") +endif() +if (NOT PAC_FORTRAN_NATIVE_REAL_SIZEOF) + message (FATAL_ERROR "Failed to find SIZEOF NATIVE REAL KINDs for Fortran") +endif() +if (NOT PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF) + message (FATAL_ERROR "Failed to find SIZEOF NATIVE DOUBLE KINDs for Fortran") +endif() +if (NOT PAC_FORTRAN_NATIVE_INTEGER_KIND) + message (FATAL_ERROR "Failed to find KIND of NATIVE INTEGER for Fortran") +endif() +if (NOT PAC_FORTRAN_NATIVE_REAL_KIND) + message (FATAL_ERROR "Failed to find KIND of NATIVE REAL for Fortran") +endif() +if (NOT PAC_FORTRAN_NATIVE_DOUBLE_KIND) + message (FATAL_ERROR "Failed to find KIND of NATIVE DOUBLE for Fortran") +endif() + + set(FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) #set(H5_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 0672e87..0b46505 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -419,12 +419,12 @@ AC_RUN_IFELSE([ AC_MSG_RESULT([$PAC_FC_MAX_REAL_PRECISION]) else AC_MSG_RESULT([Error]) - AC_MSG_WARN([No output from test program!]) + AC_MSG_ERROR([No output from Fortran test program!]) fi rm -f pac_fconftest.out ],[ AC_MSG_RESULT([Error]) - AC_MSG_WARN([Failed to run program to determine available KINDs]) + AC_MSG_ERROR([Failed to run Fortran program to determine available KINDs]) ],[]) AC_LANG_POP([Fortran]) @@ -454,11 +454,11 @@ for kind in `echo $pac_validIntKinds | sed -e 's/,/ /g'`; do sizes="`cat pac_fconftest.out`" pack_int_sizeof="$pack_int_sizeof $sizes," else - AC_MSG_WARN([No output from test program!]) + AC_MSG_ERROR([No output from Fortran test program!]) fi rm -f pac_fconftest.out ],[ - AC_MSG_WARN([Fortran program fails to build or run!]) + AC_MSG_ERROR([Fortran program fails to build or run!]) ],[ pack_int_sizeof="$2" ]) @@ -492,11 +492,11 @@ for kind in `echo $pac_validRealKinds | sed -e 's/,/ /g'`; do sizes="`cat pac_fconftest.out`" pack_real_sizeof="$pack_real_sizeof $sizes," else - AC_MSG_WARN([No output from test program!]) + AC_MSG_ERROR([No output from Fortran test program!]) fi rm -f pac_fconftest.out ],[ - AC_MSG_WARN([Fortran program fails to build or run!]) + AC_MSG_ERROR([Fortran program fails to build or run!]) ],[ pack_real_sizeof="$2" ]) @@ -540,11 +540,11 @@ rm -f pac_fconftest.out PAC_FORTRAN_NATIVE_DOUBLE_KIND="`sed -n '5p' pac_fconftest.out`" PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF="`sed -n '6p' pac_fconftest.out`" else - AC_MSG_WARN([No output from test program!]) + AC_MSG_ERROR([No output from Fortran test program!]) fi rm -f pac_fconftest.out ],[ - AC_MSG_WARN([Fortran program fails to build or run!]) + AC_MSG_ERROR([Fortran program fails to build or run!]) ],[ pack_int_sizeof="$2" ]) @@ -588,7 +588,7 @@ rm -f pac_Cconftest.out LDBL_DIG="`sed -n '1p' pac_Cconftest.out`" FLT128_DIG="`sed -n '2p' pac_Cconftest.out`" else - AC_MSG_WARN([No output from test program!]) + AC_MSG_ERROR([No output from Fortran decimal precision program!]) fi rm -f pac_Cconftest.out ],[ |