diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2005-07-19 18:16:33 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2005-07-19 18:16:33 (GMT) |
commit | bd92e1e2a0ad218875243ef6a8476b8f9b81bd0c (patch) | |
tree | 214e99d2206352b5b4a219e15ccff3002c6879ca /configure.in | |
parent | f700613f562d26417d36686eefdb11e2c9ab72ab (diff) | |
download | hdf5-bd92e1e2a0ad218875243ef6a8476b8f9b81bd0c.zip hdf5-bd92e1e2a0ad218875243ef6a8476b8f9b81bd0c.tar.gz hdf5-bd92e1e2a0ad218875243ef6a8476b8f9b81bd0c.tar.bz2 |
[svn-r11087] Purpose: Bug fix.
Description: When converting floating-point numbers to integers and the values of
floating-point number are greater than the maximal value of integer, Cray X1 generates
floating exception.
Solution: Added a test in configure to detect Cray X1's exception. Set a flag to
indicate the machine that can handle overflow converting all floating-point to all
integer types. This flag should be set for all machines, except for Cray X1 where
floating exception is generated when the floating-point value is greater than the
maximal integer value.
Platforms tested: Cray X1 and h5committest.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 3349078..6b3e08c 100644 --- a/configure.in +++ b/configure.in @@ -2757,6 +2757,37 @@ else fi dnl ---------------------------------------------------------------------- +dnl Set the flag to indicate that the machine can handle overflow converting +dnl all floating-point to all integer types. +dnl (This flag should be set for all machines, except for Cray X1 where +dnl floating exception is generated when the floating-point value is greater +dnl than the maximal integer value). +dnl +AC_MSG_CHECKING([if overflows normally converting floating-point to integer values]) + +AC_CACHE_VAL([hdf5_cv_fp_to_integer_overflow_works], + [AC_TRY_RUN([ + int main(void) + { + float f = 2147483648.0f; + int i; + + i = (int)f; + +done: + exit(0); + } + ], [hdf5_cv_fp_to_integer_overflow_works=yes], [hdf5_cv_fp_to_integer_overflow_works=no],)]) + +if test ${hdf5_cv_fp_to_integer_overflow_works} = "yes"; then + AC_DEFINE([FP_TO_INTEGER_OVERFLOW_WORKS], [1], + [Define if your system can handle overflow converting floating-point to integer values.]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +dnl ---------------------------------------------------------------------- dnl Set some variables for general configuration information to be saved dnl and installed with the libraries. dnl |