summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2009-08-20 18:40:50 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2009-08-20 18:40:50 (GMT)
commit0b3b4351e7841f00cdcda837fc2960a37a923d69 (patch)
treeb2b34f09112d63444133446152742e321e895beb /configure.in
parentf8c63dd9dcb4459dd8d57a2b2543e2e99f6d4a35 (diff)
downloadhdf5-0b3b4351e7841f00cdcda837fc2960a37a923d69.zip
hdf5-0b3b4351e7841f00cdcda837fc2960a37a923d69.tar.gz
hdf5-0b3b4351e7841f00cdcda837fc2960a37a923d69.tar.bz2
[svn-r17392] I added a detection for the correctness of converting from unsigned long to float in the
configure.in. The Pathscale compiler on Sandia's Linux machine misinterprets the values of unsigned long as negative during the conversion to float, when the first bit of unsigned long is on. Tested on jam. Need to test it on Sandia's machine.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in50
1 files changed, 50 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 881051b..2442794 100644
--- a/configure.in
+++ b/configure.in
@@ -3053,6 +3053,56 @@ fi
dnl ----------------------------------------------------------------------
dnl Set the flag to indicate that the machine can accurately convert
+dnl 'unsigned long' to 'float' values.
+dnl (This flag should be set for all machines, except for Pathscale compiler
+dnl on Sandia's Linux machine where the compiler interprets 'unsigned long'
+dnl values as negative when the first bit of 'unsigned long' is on during
+dnl the conversion to float.)
+dnl
+AC_MSG_CHECKING([if accurately converting unsigned long to float values])
+
+AC_CACHE_VAL([hdf5_ulong_to_float_accurate],
+ [AC_TRY_RUN([
+ int main(void)
+ {
+ int ret = 0;
+ unsigned long l1;
+ unsigned long l2;
+ unsigned long l3;
+ float f1;
+ float f2;
+ float f3;
+
+
+ if(sizeof(unsigned long)==8) {
+ l1 = 0xffffffffffffffffUL;
+ l2 = 0xffffffffffff0000UL;
+ l3 = 0xf000000000000000UL;
+
+ f1 = (float)l1;
+ f2 = (float)l2;
+ f3 = (float)l3;
+
+ if((f1 < 0) || (f2 < 0) || (f3 < 0))
+ ret = 1;
+ }
+
+done:
+ exit(ret);
+ }
+ ], [hdf5_ulong_to_float_accurate=yes], [hdf5_ulong_to_float_accurate=no],)])
+
+if test ${hdf5_ulong_to_float_accurate} = "yes"; then
+ AC_DEFINE([ULONG_TO_FLOAT_ACCURATE], [1],
+ [Define if your system accurately converting unsigned long to float values.])
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+
+dnl ----------------------------------------------------------------------
+dnl Set the flag to indicate that the machine can accurately convert
dnl 'unsigned (long) long' values to 'float' and 'double' values.
dnl (This flag should be set for all machines, except for the SGIs, where
dnl the cache value is set in the config/irix6.x config file) and Solaris