From 62401ac7c61dc71ea5980e44e895ab757df15a01 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 9 Jun 2015 12:05:09 -0500 Subject: [svn-r27167] more DT fixes --- Makefile.in | 1 + c++/Makefile.in | 1 + c++/examples/Makefile.in | 1 + c++/src/Makefile.in | 1 + c++/test/Makefile.in | 1 + configure | 130 +++++++++++++++++++++++------------ configure.ac | 25 +++++-- examples/Makefile.in | 1 + fortran/Makefile.in | 1 + fortran/examples/Makefile.in | 1 + fortran/src/H5_f.c | 10 ++- fortran/src/H5_ff.F90 | 2 + fortran/src/H5config_f.inc.in | 3 + fortran/src/H5fort_type_defines.h.in | 3 +- fortran/src/H5match_types.c | 30 ++++---- fortran/src/Makefile.in | 1 + fortran/test/Makefile.in | 1 + fortran/testpar/Makefile.in | 1 + hl/Makefile.in | 1 + hl/c++/Makefile.in | 1 + hl/c++/examples/Makefile.in | 1 + hl/c++/src/Makefile.in | 1 + hl/c++/test/Makefile.in | 1 + hl/examples/Makefile.in | 1 + hl/fortran/Makefile.in | 1 + hl/fortran/examples/Makefile.in | 1 + hl/fortran/src/H5LTff.F90 | 21 +++--- hl/fortran/src/H5TBff.F90 | 20 +++--- hl/fortran/src/Makefile.in | 1 + hl/fortran/test/Makefile.in | 1 + hl/fortran/test/tstlite.F90 | 11 +-- hl/src/Makefile.in | 1 + hl/test/Makefile.in | 1 + hl/tools/Makefile.in | 1 + hl/tools/gif2h5/Makefile.in | 1 + m4/aclocal_fc.m4 | 26 +++++-- src/H5config.h.in | 3 + src/Makefile.in | 1 + test/Makefile.in | 1 + testpar/Makefile.in | 1 + tools/Makefile.in | 1 + tools/h5copy/Makefile.in | 1 + tools/h5diff/Makefile.in | 1 + tools/h5dump/Makefile.in | 1 + tools/h5import/Makefile.in | 1 + tools/h5jam/Makefile.in | 1 + tools/h5ls/Makefile.in | 1 + tools/h5repack/Makefile.in | 1 + tools/h5stat/Makefile.in | 1 + tools/lib/Makefile.in | 1 + tools/misc/Makefile.in | 1 + tools/perform/Makefile.in | 1 + 52 files changed, 225 insertions(+), 99 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6088c33..f50da2d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -294,6 +294,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/c++/Makefile.in b/c++/Makefile.in index c916f89..d41ddd6 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -454,6 +454,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index bebe35d..9c21416 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -402,6 +402,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 83d515a..34b2962 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -465,6 +465,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index bba5059..89e2acc 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -456,6 +456,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/configure b/configure index 554db12..0c9b346 100755 --- a/configure +++ b/configure @@ -719,8 +719,9 @@ am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS -PAC_C_MAX_REAL_PRECISION +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE FORTRAN_HAVE_C_LONG_DOUBLE +PAC_C_MAX_REAL_PRECISION HAVE_Fortran_INTEGER_SIZEOF_16 PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF PAC_FORTRAN_NATIVE_DOUBLE_KIND @@ -6989,50 +6990,6 @@ rm -f core conftest.err conftest.$ac_objext \ fi fi - - ## See if C_LONG_DOUBLE is available, and if it is different from C_DOUBLE - - FORTRAN_HAVE_C_LONG_DOUBLE="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran C_LONG_DOUBLE is valid" >&5 -$as_echo_n "checking if Fortran C_LONG_DOUBLE is valid... " >&6; } - - cat > conftest.$ac_ext <<_ACEOF - - MODULE type_mod - USE ISO_C_BINDING - INTERFACE h5t - MODULE PROCEDURE h5t_c_double - MODULE PROCEDURE h5t_c_long_double - END INTERFACE - CONTAINS - SUBROUTINE h5t_c_double(r) - REAL(KIND=C_DOUBLE) :: r - END SUBROUTINE h5t_c_double - SUBROUTINE h5t_c_long_double(d) - REAL(KIND=C_LONG_DOUBLE) :: d - END SUBROUTINE h5t_c_long_double - END MODULE type_mod - PROGRAM main - USE ISO_C_BINDING - USE type_mod - REAL(KIND=C_DOUBLE) :: r - REAL(KIND=C_LONG_DOUBLE) :: d - CALL h5t(r) - CALL h5t(d) - END PROGRAM main - -_ACEOF -if ac_fn_fc_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - FORTRAN_HAVE_C_LONG_DOUBLE="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - ## See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" HAVE_ISO_FORTRAN_ENV="no" @@ -7492,6 +7449,7 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu + ## Setting definition if there is a 16 byte fortran integer if `echo $PAC_FC_ALL_INTEGER_KINDS_SIZEOF | grep '16' >/dev/null`; then HAVE_Fortran_INTEGER_SIZEOF_16="1" @@ -7529,6 +7487,32 @@ $as_echo "#define FORTRAN_HAVE_C_SIZEOF 1" >>confdefs.h $as_echo "#define FORTRAN_HAVE_SIZEOF 1" >>confdefs.h fi + + ## See if C_LONG_DOUBLE is available + + HAVE_C_LONG_DOUBLE_FORTRAN="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler supports intrinsic C_LONG_DOUBLE" >&5 +$as_echo_n "checking if Fortran compiler supports intrinsic C_LONG_DOUBLE... " >&6; } + cat > conftest.$ac_ext <<_ACEOF + + PROGRAM main + USE ISO_C_BINDING + REAL(KIND=C_LONG_DOUBLE) :: d + END PROGRAM + +_ACEOF +if ac_fn_fc_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_C_LONG_DOUBLE_FORTRAN="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + FORTRAN_HAVE_C_LONG_DOUBLE="0" if test "X$HAVE_C_LONG_DOUBLE_FORTRAN" = "Xyes"; then FORTRAN_HAVE_C_LONG_DOUBLE="1" @@ -7537,8 +7521,64 @@ $as_echo "#define FORTRAN_HAVE_C_LONG_DOUBLE 1" >>confdefs.h fi + ## Is C_LONG_DOUBLE different from C_DOUBLE + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then + + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran C_LONG_DOUBLE is different from C_DOUBLE" >&5 +$as_echo_n "checking if Fortran C_LONG_DOUBLE is different from C_DOUBLE... " >&6; } + + cat > conftest.$ac_ext <<_ACEOF + + MODULE type_mod + USE ISO_C_BINDING + INTERFACE h5t + MODULE PROCEDURE h5t_c_double + MODULE PROCEDURE h5t_c_long_double + END INTERFACE + CONTAINS + SUBROUTINE h5t_c_double(r) + REAL(KIND=C_DOUBLE) :: r + END SUBROUTINE h5t_c_double + SUBROUTINE h5t_c_long_double(d) + REAL(KIND=C_LONG_DOUBLE) :: d + END SUBROUTINE h5t_c_long_double + END MODULE type_mod + PROGRAM main + USE ISO_C_BINDING + USE type_mod + REAL(KIND=C_DOUBLE) :: r + REAL(KIND=C_LONG_DOUBLE) :: d + CALL h5t(r) + CALL h5t(d) + END PROGRAM main + +_ACEOF +if ac_fn_fc_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test "X$FORTRAN_C_LONG_DOUBLE_IS_UNIQUE" = "Xyes"; then + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1" + +$as_echo "#define FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1" >>confdefs.h + + else + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + fi + fi + + $as_echo "#define FORTRAN_SIZEOF_LONG_DOUBLE SIZEOF_LONG_DOUBLE" >>confdefs.h + ## Change back to the C language ac_ext=c ac_cpp='$CPP $CPPFLAGS' diff --git a/configure.ac b/configure.ac index 90f7d67..2baa0a4 100644 --- a/configure.ac +++ b/configure.ac @@ -446,10 +446,6 @@ if test "X$HDF_FORTRAN" = "Xyes"; then fi fi - - ## See if C_LONG_DOUBLE is available, and if it is different from C_DOUBLE - PAC_PROG_FC_HAVE_C_LONG_DOUBLE - ## See if the fortran compiler supports the intrinsic module "ISO_FORTRAN_ENV" PAC_PROG_FC_ISO_FORTRAN_ENV @@ -471,8 +467,9 @@ if test "X$HDF_FORTRAN" = "Xyes"; then AC_SUBST([PAC_FORTRAN_NATIVE_DOUBLE_KIND]) AC_SUBST([PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF]) AC_SUBST([HAVE_Fortran_INTEGER_SIZEOF_16]) - AC_SUBST([FORTRAN_HAVE_C_LONG_DOUBLE]) AC_SUBST([PAC_C_MAX_REAL_PRECISION]) + AC_SUBST([FORTRAN_HAVE_C_LONG_DOUBLE]) + AC_SUBST([FORTRAN_C_LONG_DOUBLE_IS_UNIQUE]) ## Setting definition if there is a 16 byte fortran integer if `echo $PAC_FC_ALL_INTEGER_KINDS_SIZEOF | grep '16' >/dev/null`; then @@ -501,12 +498,30 @@ if test "X$HDF_FORTRAN" = "Xyes"; then if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then AC_DEFINE([FORTRAN_HAVE_SIZEOF], [1], [Define if we have Fortran intrinsic SIZEOF]) fi + + ## See if C_LONG_DOUBLE is available + PAC_PROG_FC_HAVE_C_LONG_DOUBLE + FORTRAN_HAVE_C_LONG_DOUBLE="0" if test "X$HAVE_C_LONG_DOUBLE_FORTRAN" = "Xyes"; then FORTRAN_HAVE_C_LONG_DOUBLE="1" AC_DEFINE([FORTRAN_HAVE_C_LONG_DOUBLE], [1], [Define if we have Fortran C_LONG_DOUBLE]) fi + + ## Is C_LONG_DOUBLE different from C_DOUBLE + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then + PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE + if test "X$FORTRAN_C_LONG_DOUBLE_IS_UNIQUE" = "Xyes"; then + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1" + AC_DEFINE([FORTRAN_C_LONG_DOUBLE_IS_UNIQUE], [1], [Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) + else + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0" + fi + fi + AC_DEFINE([FORTRAN_SIZEOF_LONG_DOUBLE], [SIZEOF_LONG_DOUBLE], [Determine the size of C long double]) + ## Change back to the C language AC_LANG_POP(Fortran) PAC_LDBL_DIG diff --git a/examples/Makefile.in b/examples/Makefile.in index 20b0183..dd80474 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -402,6 +402,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 6427d4c..c8a309d 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -458,6 +458,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index d0400c0..15e98ac 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -402,6 +402,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 241af79..cca36fb 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -221,21 +221,27 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes /* * FIND H5T_NATIVE_REAL_C_LONG_DOUBLE */ +#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(float)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(double)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; } /*end if */ -#if FORTRAN_HAVE_C_LONG_DOUBLE!=0 +# if FORTRAN_HAVE_C_LONG_DOUBLE!=0 else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(long double)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ -#else +# else else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(long double)) { if ((types[12] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value; if ( H5Tset_precision (types[12], 128) < 0) return ret_value; } /*end else */ +# endif + +#else + if ((types[12] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value; + if ( H5Tset_precision (types[12], 64) < 0) return ret_value; #endif /* * FIND H5T_NATIVE_B_8 diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 7939644..3ef6331 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -389,8 +389,10 @@ CONTAINS h5_type = H5T_NATIVE_REAL_C_FLOAT ELSE IF(kind.EQ.Fortran_REAL_C_DOUBLE)THEN h5_type = H5T_NATIVE_REAL_C_DOUBLE +#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 ELSE IF(kind.EQ.Fortran_REAL_C_LONG_DOUBLE)THEN h5_type = H5T_NATIVE_REAL_C_LONG_DOUBLE +#endif #if H5_PAC_FC_MAX_REAL_PRECISION > 28 #ifdef H5_HAVE_FLOAT128 ELSE IF(kind.EQ.Fortran_REAL_C_FLOAT128)THEN diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index dbbf43b..d6909ed 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -18,6 +18,9 @@ ! Define if the intrinsic function C_LONG_DOUBLE exists #undef FORTRAN_HAVE_C_LONG_DOUBLE +! Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE +#undef FORTRAN_C_LONG_DOUBLE_IS_UNIQUE + ! Define if the intrinsic module ISO_FORTRAN_ENV exists #undef HAVE_ISO_FORTRAN_ENV diff --git a/fortran/src/H5fort_type_defines.h.in b/fortran/src/H5fort_type_defines.h.in index 279deb9..5511742 100644 --- a/fortran/src/H5fort_type_defines.h.in +++ b/fortran/src/H5fort_type_defines.h.in @@ -13,4 +13,5 @@ #define H5_FORTRAN_REAL_KINDS_SIZEOF @PAC_FC_ALL_REAL_KINDS_SIZEOF@ #define H5_PAC_FC_MAX_REAL_PRECISION @PAC_FC_MAX_REAL_PRECISION@ #define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @HAVE_Fortran_INTEGER_SIZEOF_16@ -#define H5_HAVE_Fortran_INTRINSIC_C_LONG_DOUBLE @FORTRAN_HAVE_C_LONG_DOUBLE@ +#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @FORTRAN_HAVE_C_LONG_DOUBLE@ +#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index c22f423..27d314e 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -211,16 +211,16 @@ int main(void) if (sizeof(float) == RealKinds_SizeOf[i]) { writeTypedef("float", "float", RealKinds[i]); - strcpy(Real_C_TYPES[i], "C_FLOAT"); - } else if(sizeof(double) == RealKinds_SizeOf[i]) { + strcpy(Real_C_TYPES[i], "C_FLOAT"); } + else if(sizeof(double) == RealKinds_SizeOf[i]) { writeTypedef("float", "double", RealKinds[i]); - strcpy(Real_C_TYPES[i], "C_DOUBLE"); -/* may not have long double in fortran need check */ - } else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) { + strcpy(Real_C_TYPES[i], "C_DOUBLE"); } +#if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0 + else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) { writeTypedef("float", "long double", RealKinds[i]); strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); - found_long_double = 1; - } + found_long_double = 1; } +#endif #ifdef H5_HAVE_FLOAT128 /* Don't select a higher precision than Fortran can support */ else if(sizeof(__float128) == RealKinds_SizeOf[i] && found_long_double == 1 && H5_PAC_FC_MAX_REAL_PRECISION > 28) { @@ -240,15 +240,15 @@ int main(void) /* } else if(sizeof(long double) > RealKinds_SizeOf[H5_FORTRAN_NUM_REAL_KINDS-2]) { */ /* writeTypedef("float", "long double", RealKinds[i]); */ /* strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); } */ - else { - printf(" **** HDF5 WARNING ****\n"); - printf("Fortran REAL is %d bytes, but no corresponding C floating type exists\n",RealKinds_SizeOf[i]); - printf("Fortran Interface will create a custom datatype to store Fortran Real\n",RealKinds_SizeOf[i]); + else { + printf(" **** HDF5 WARNING ****\n"); + printf("Fortran REAL is %d bytes, but no corresponding C floating type exists\n",RealKinds_SizeOf[i]); + printf("Fortran Interface will create a custom datatype to store Fortran Real\n",RealKinds_SizeOf[i]); - writeTypedef("float", "long double", RealKinds[i]); - strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); } - } -/* } */ +/* writeTypedef("float", "long double", RealKinds[i]); */ +/* strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); } */ + } + } /* Now begin defining fortran types. */ fprintf(c_header, "\n"); diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 0abfb53..5c9de7c 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -503,6 +503,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 6478b50..bef4842 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -514,6 +514,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 79db2dc..e40dda7 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -454,6 +454,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/Makefile.in b/hl/Makefile.in index a178fc1..97edc1c 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -458,6 +458,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 08e1fff..b6f4f55 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -454,6 +454,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 3eb154a..69d548b 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -401,6 +401,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 88056fd..eb80bc2 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -457,6 +457,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index dc4e8a2..1abbb4f 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -454,6 +454,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 602cd7c..db82ec7 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -401,6 +401,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 08cf1d8..468101e 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -458,6 +458,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 72f00da..0a58477 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -401,6 +401,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index 3216b0a..8dc20f2 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -59,7 +59,7 @@ MODULE h5lt MODULE PROCEDURE h5ltmake_dataset_f_c_double5 MODULE PROCEDURE h5ltmake_dataset_f_c_double6 MODULE PROCEDURE h5ltmake_dataset_f_c_double7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5ltmake_dataset_f_c_long_double1 MODULE PROCEDURE h5ltmake_dataset_f_c_long_double2 MODULE PROCEDURE h5ltmake_dataset_f_c_long_double3 @@ -93,7 +93,7 @@ MODULE h5lt MODULE PROCEDURE h5ltread_dataset_f_c_double5 MODULE PROCEDURE h5ltread_dataset_f_c_double6 MODULE PROCEDURE h5ltread_dataset_f_c_double7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5ltread_dataset_f_c_long_double1 MODULE PROCEDURE h5ltread_dataset_f_c_long_double2 MODULE PROCEDURE h5ltread_dataset_f_c_long_double3 @@ -130,7 +130,7 @@ MODULE h5lt MODULE PROCEDURE h5ltmake_dataset_c_double_f_5 MODULE PROCEDURE h5ltmake_dataset_c_double_f_6 MODULE PROCEDURE h5ltmake_dataset_c_double_f_7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5ltmake_dataset_c_long_double_f_1 MODULE PROCEDURE h5ltmake_dataset_c_long_double_f_2 MODULE PROCEDURE h5ltmake_dataset_c_long_double_f_3 @@ -156,7 +156,7 @@ MODULE h5lt MODULE PROCEDURE h5ltmake_dataset_c_double_f_5 MODULE PROCEDURE h5ltmake_dataset_c_double_f_6 MODULE PROCEDURE h5ltmake_dataset_c_double_f_7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5ltmake_dataset_c_long_double_f_1 MODULE PROCEDURE h5ltmake_dataset_c_long_double_f_2 MODULE PROCEDURE h5ltmake_dataset_c_long_double_f_3 @@ -192,7 +192,7 @@ MODULE h5lt MODULE PROCEDURE h5ltread_dataset_c_double_f_5 MODULE PROCEDURE h5ltread_dataset_c_double_f_6 MODULE PROCEDURE h5ltread_dataset_c_double_f_7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5ltread_dataset_c_long_double_f_1 MODULE PROCEDURE h5ltread_dataset_c_long_double_f_2 MODULE PROCEDURE h5ltread_dataset_c_long_double_f_3 @@ -218,7 +218,7 @@ MODULE h5lt MODULE PROCEDURE h5ltread_dataset_c_double_f_5 MODULE PROCEDURE h5ltread_dataset_c_double_f_6 MODULE PROCEDURE h5ltread_dataset_c_double_f_7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5ltread_dataset_c_long_double_f_1 MODULE PROCEDURE h5ltread_dataset_c_long_double_f_2 MODULE PROCEDURE h5ltread_dataset_c_long_double_f_3 @@ -892,7 +892,7 @@ CONTAINS END SUBROUTINE h5ltmake_dataset_f_c_double7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 !------------------------------------------------------------------------- ! Function(s): h5ltmake_dataset_f_c_long_double(1-7) ! @@ -1684,8 +1684,7 @@ CONTAINS errcode = h5ltread_dataset_c(loc_id,namelen,dset_name,type_id,f_ptr) END SUBROUTINE h5ltread_dataset_f_c_double7 - -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 !------------------------------------------------------------------------- ! Function(s): h5ltread_dataset_f_c_long_double(1-7) ! @@ -2388,7 +2387,7 @@ CONTAINS END SUBROUTINE h5ltmake_dataset_c_double_f_7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 !------------------------------------------------------------------------- ! Function(s): h5ltmake_dataset_c_long_double_f_(1-7) ! @@ -3053,7 +3052,7 @@ CONTAINS END SUBROUTINE h5ltread_dataset_c_double_f_7 -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 !------------------------------------------------------------------------- ! Function9s): h5ltread_dataset_c_long_double_f_(1-7) ! diff --git a/hl/fortran/src/H5TBff.F90 b/hl/fortran/src/H5TBff.F90 index 9b40694..50eab2d 100644 --- a/hl/fortran/src/H5TBff.F90 +++ b/hl/fortran/src/H5TBff.F90 @@ -42,7 +42,7 @@ MODULE h5tb MODULE PROCEDURE h5tbwrite_field_name_f_int MODULE PROCEDURE h5tbwrite_field_name_f_c_float MODULE PROCEDURE h5tbwrite_field_name_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5tbwrite_field_name_f_c_long_double #endif MODULE PROCEDURE h5tbwrite_field_name_f_string @@ -52,7 +52,7 @@ MODULE h5tb MODULE PROCEDURE h5tbread_field_name_f_int MODULE PROCEDURE h5tbread_field_name_f_c_float MODULE PROCEDURE h5tbread_field_name_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5tbread_field_name_f_c_long_double #endif MODULE PROCEDURE h5tbread_field_name_f_string @@ -62,7 +62,7 @@ MODULE h5tb MODULE PROCEDURE h5tbwrite_field_index_f_int MODULE PROCEDURE h5tbwrite_field_index_f_c_float MODULE PROCEDURE h5tbwrite_field_index_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5tbwrite_field_index_f_c_long_double #endif MODULE PROCEDURE h5tbwrite_field_index_f_string @@ -72,7 +72,7 @@ MODULE h5tb MODULE PROCEDURE h5tbread_field_index_f_int MODULE PROCEDURE h5tbread_field_index_f_c_float MODULE PROCEDURE h5tbread_field_index_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5tbread_field_index_f_c_long_double #endif MODULE PROCEDURE h5tbread_field_index_f_string @@ -82,7 +82,7 @@ MODULE h5tb MODULE PROCEDURE h5tbinsert_field_f_int MODULE PROCEDURE h5tbinsert_field_f_c_float MODULE PROCEDURE h5tbinsert_field_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 MODULE PROCEDURE h5tbinsert_field_f_c_long_double #endif MODULE PROCEDURE h5tbinsert_field_f_string @@ -413,7 +413,7 @@ CONTAINS END SUBROUTINE h5tbwrite_field_name_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 SUBROUTINE h5tbwrite_field_name_f_c_long_double(loc_id,& dset_name,& field_name,& @@ -594,7 +594,7 @@ CONTAINS END SUBROUTINE h5tbread_field_name_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 SUBROUTINE h5tbread_field_name_f_c_long_double(loc_id,& dset_name,& field_name,& @@ -766,7 +766,7 @@ CONTAINS END SUBROUTINE h5tbwrite_field_index_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 SUBROUTINE h5tbwrite_field_index_f_c_long_double(loc_id,& dset_name,& field_index,& @@ -931,7 +931,7 @@ CONTAINS END SUBROUTINE h5tbread_field_index_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 SUBROUTINE h5tbread_field_index_f_c_long_double(loc_id,& dset_name,& field_index,& @@ -1093,7 +1093,7 @@ CONTAINS END SUBROUTINE h5tbinsert_field_f_c_double -#ifdef H5_FORTRAN_HAVE_C_LONG_DOUBLE +#if FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0 SUBROUTINE h5tbinsert_field_f_c_long_double(loc_id,& dset_name,& field_name,& diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 35886b6..66cf45d 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -478,6 +478,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 6389d6b..1b6ff38 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -469,6 +469,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/fortran/test/tstlite.F90 b/hl/fortran/test/tstlite.F90 index 26e9467..4c1ca14 100644 --- a/hl/fortran/test/tstlite.F90 +++ b/hl/fortran/test/tstlite.F90 @@ -1214,17 +1214,18 @@ SUBROUTINE test_datasets() ! ! write dataset. ! - f_ptr = C_LOC(buf4(1)) - CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) - !CALL h5ltmake_dataset_double_f(file_id, dsetname4, rank, dims, buf4, errcode) + !f_ptr = C_LOC(buf4(1)) + !CALL h5ltmake_dataset_f(file_id, dsetname4, rank, dims, H5T_NATIVE_DOUBLE, f_ptr, errcode) + CALL h5ltmake_dataset_double_f(file_id, dsetname4, rank, dims, buf4, errcode) ! ! read dataset. ! - !!!f_ptr = C_LOC(buf4(1)) MSB - !!!CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) MSB + !f_ptr = C_LOC(buf4(1)) + !CALL h5ltread_dataset_f(file_id, dsetname4, H5T_NATIVE_DOUBLE, f_ptr, errcode) CALL h5ltread_dataset_double_f(file_id, dsetname4, bufr4, dims, errcode) + ! ! compare read and write buffers. ! diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 2092562..9558e2c 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -456,6 +456,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 1bfce03..8f577a1 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -493,6 +493,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index b8babca..cf13ceb 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -455,6 +455,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 9928c00..55fe87c 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -469,6 +469,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index febd73c..5ff22a8 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -125,12 +125,27 @@ AC_DEFUN([PAC_PROG_FC_STORAGE_SIZE],[ ]) -dnl Check to see C_LONG_DOUBLE is available, and if it -dnl is different from C_DOUBLE +dnl Check to see C_LONG_DOUBLE is available AC_DEFUN([PAC_PROG_FC_HAVE_C_LONG_DOUBLE],[ - FORTRAN_HAVE_C_LONG_DOUBLE="no" - AC_MSG_CHECKING([if Fortran C_LONG_DOUBLE is valid]) + HAVE_C_LONG_DOUBLE_FORTRAN="no" + AC_MSG_CHECKING([if Fortran compiler supports intrinsic C_LONG_DOUBLE]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + PROGRAM main + USE ISO_C_BINDING + REAL(KIND=C_LONG_DOUBLE) :: d + END PROGRAM + ])], [AC_MSG_RESULT([yes]) + HAVE_C_LONG_DOUBLE_FORTRAN="yes"], + [AC_MSG_RESULT([no])]) +]) + +dnl Check if C_LONG_DOUBLE is different from C_DOUBLE + +if test "X$FORTRAN_HAVE_C_LONG_DOUBLE" = "Xyes"; then +AC_DEFUN([PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE],[ + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="no" + AC_MSG_CHECKING([if Fortran C_LONG_DOUBLE is different from C_DOUBLE]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([ MODULE type_mod @@ -156,9 +171,10 @@ AC_DEFUN([PAC_PROG_FC_HAVE_C_LONG_DOUBLE],[ CALL h5t(d) END PROGRAM main ])], [AC_MSG_RESULT([yes]) - FORTRAN_HAVE_C_LONG_DOUBLE="yes"], + FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="yes"], [AC_MSG_RESULT([no])]) ]) +fi dnl Checking if the compiler supports the required Fortran 2003 features and dnl disable Fortran 2003 if it does not. diff --git a/src/H5config.h.in b/src/H5config.h.in index 3f432d5..a174c6a 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -30,6 +30,9 @@ /* As FC_FUNC, but for C identifiers containing underscores. */ #undef FC_FUNC_ +/* Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE */ +#undef FORTRAN_C_LONG_DOUBLE_IS_UNIQUE + /* Define if we have Fortran C_LONG_DOUBLE */ #undef FORTRAN_HAVE_C_LONG_DOUBLE diff --git a/src/Makefile.in b/src/Makefile.in index de573f0..a3ded58 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -517,6 +517,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/test/Makefile.in b/test/Makefile.in index 38986f8..fe84ed2 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -861,6 +861,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 1e022e2..52c5c4f 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -484,6 +484,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/Makefile.in b/tools/Makefile.in index eb45a0d..77c99f6 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -455,6 +455,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index b20c389..91efac5 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -463,6 +463,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index d071705..944b68b 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -470,6 +470,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 36d32bb..e43f6c2 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -469,6 +469,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 091125e..baee94c 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -463,6 +463,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 4498f09..44f964e 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -475,6 +475,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index adb3b2f..0cb99d6 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -455,6 +455,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index ed58bd6..f90d071 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -487,6 +487,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index ff4e99a..23e4929 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -465,6 +465,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 9d62e57..351fa23 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -452,6 +452,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 8767a53..fc74c15 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -490,6 +490,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 0539283..58778aa 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -494,6 +494,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ +FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ -- cgit v0.12