[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

970917: DEC Alpha, Linux, and netCDF-3.3.1 - floating point exception



Scott,

>Date: Wed, 17 Sep 1997 12:09:05 -0600 
>From: "Scott R. Wilson" <address@hidden>
>Organization: Bio-Rad Semiconductor Division, CD Systems
>To: address@hidden,
>To: address@hidden
>Subject: Re: 970917: DEC Alpha, Linux, and netCDF-3.3.1 - compile failure 
>Keywords: 199709162327.RAA11816 

In the above message, you wrote:

> Thank you for getting back to me on the compile problem.
> 
> The file /usr/include/limits.h contains the following:
> 
> /* Minimum and maximum values a `signed long int' can hold.  */
> #  ifdef __alpha__
> #   define LONG_MAX     9223372036854775807L
> #  else
> #   define LONG_MAX     2147483647L
> #  endif
> #  define LONG_MIN      (- LONG_MAX - 1L)
> 
> BUT!!! I found the following in
> /usr/lib/gcc-lib/alpha-unknown-linux/2.7.2.3.f.1/include:
> 
> /* Minimum and maximum values a `signed long int' can hold.
>    (Same as `int').  */
> #ifndef __LONG_MAX__
> # ifndef __alpha__
> #  define __LONG_MAX__ 2147483647L
> # else
> #  define __LONG_MAX__ 9223372036854775807LL
> # endif /* __alpha__ */
> #endif
> #undef LONG_MIN
> #define LONG_MIN (-LONG_MAX-1)
> #undef LONG_MAX
> #define LONG_MAX __LONG_MAX__
> 
> *There* is the LL! It appears that gcc uses it's own limits.h instead of the
> one in /usr/include.
> 
> If I change the LL to just L then the compile completes with no errors.
> "make test", however, fails as follows (listing below). Should I worry or
> push ahead?
> 
> Thanks again Steve,
> Scott Wilson
> address@hidden
> 
> make[1]: Entering directory `/usr/home/swilson/netcdf-3.3.1/src'
> 
> Making `test' in directory /usr/home/swilson/netcdf-3.3.1/src/libsrc
> 
> make[2]: Entering directory `/usr/home/swilson/netcdf-3.3.1/src/libsrc'
> ar cru   libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o 
> putget.o s
> tring.o v1hpg.o v2i.o var.o
> ranlib libnetcdf.a
> cc -o t_nc -O  t_nc.o -L. -lnetcdf 
> ./t_nc
> trying again
> dimrename: IXX
> nc_close ret = 0
> 
> reopen id = 6 for filename test.nc
> NC done
> GATTR VAR VATTR
> VATTR
> VATTR
> VATTR
> VATTR
> VATTR
> fill_seq indices         1 2 3  75.000000 != 2.718282
> Done
> got val = 3.250000
> got val = 0.000000
> got val = 2.718282
> got val = 82555
> got val = 97
> got NC_CHAR val = A (0x41) 
> got NC_CHAR val = B (0x42) 
> got NC_CHAR val = "The red death had long devastated the country."
> got val = A (0x41) 
> got val = B (0x42) 
> got val = "The red death had long devastated the country."
> got vals = 0.000000 ... 447.000000
> re nc_close ret = 0
> cmp test.nc test_nc.sav
> *** Success ***
> make[2]: Leaving directory `/usr/home/swilson/netcdf-3.3.1/src/libsrc'
> 
> Returning to directory /usr/home/swilson/netcdf-3.3.1/src
> 
> make[1]: Leaving directory `/usr/home/swilson/netcdf-3.3.1/src'
> make[1]: Entering directory `/usr/home/swilson/netcdf-3.3.1/src'
> Making `test' in directory /usr/home/swilson/netcdf-3.3.1/src/nctest
> 
> make[2]: Entering directory `/usr/home/swilson/netcdf-3.3.1/src/nctest'
> cc -o nctest -O  varget.o vargetg.o varput.o varputg.o vardef.o vartests.o 
> vputg
> et.o vputgetg.o driver.o cdftests.o dimtests.o rec.o atttests.o misctest.o 
> add.o
>  error.o emalloc.o val.o slabs.o -L../libsrc -lnetcdf  
> ./nctest
> *** Testing nccreate ...        ok ***
> *** Testing ncopen ...          ok ***
> *** Testing ncredef ...         ok ***
> *** Testing ncendef ...         ok ***
> *** Testing ncclose ...         ok ***
> *** Testing ncinquire ...       ok ***
> *** Testing ncsync ...          ok ***
> *** Testing ncabort ...         ok ***
> *** Testing ncdimdef ...        ok ***
> *** Testing ncdimid ...         ok ***
> *** Testing ncdiminq ...        ok ***
> *** Testing ncdimrename ...     ok ***
> *** Testing ncvardef ...        ok ***
> *** Testing ncvarid ...         ok ***
> *** Testing ncvarinq ...        ok ***
> *** Testing ncvarput1 ...       ok ***
> *** Testing ncvarget1 ...       ok ***
> *** Testing ncvarput ...        ok ***
> *** Testing ncvarget ...        ok ***
> *** Testing ncvarputg ...       ok ***
> *** Testing ncvargetg ...       ok ***
> *** Testing ncrecinq ...        ok ***
> *** Testing ncrecput ...        ok ***
> *** Testing ncrecget ...        ok ***
> *** Testing ncvarrename ...     ok ***
> *** Testing ncattput ...        ok ***
> *** Testing ncattinq ...        ok ***
> *** Testing ncattget ...        ok ***
> *** Testing ncattcopy ...       ok ***
> *** Testing ncattname ...       ok ***
> *** Testing ncattrename ...     ok ***
> *** Testing ncattdel ...        ok ***
> *** Testing nctypelen ...       ok ***
> cmp testfile.nc testfile_nc.sav
> make[2]: Leaving directory `/usr/home/swilson/netcdf-3.3.1/src/nctest'
> 
> Returning to directory /usr/home/swilson/netcdf-3.3.1/src
> 
> make[1]: Leaving directory `/usr/home/swilson/netcdf-3.3.1/src'
> make[1]: Entering directory `/usr/home/swilson/netcdf-3.3.1/src'
> 
> Making `test' in directory /usr/home/swilson/netcdf-3.3.1/src/nc_test
> 
> make[2]: Entering directory `/usr/home/swilson/netcdf-3.3.1/src/nc_test'
> cc -o nc_test -O  nc_test.o error.o test_get.o test_put.o test_read.o 
> test_write
> .o util.o -L../libsrc -lnetcdf -lm 
> ./nc_test -c
> make[2]: *** [test.nc] Floating point exception
> make[2]: *** Deleting file `test.nc'
> make[2]: Leaving directory `/usr/home/swilson/netcdf-3.3.1/src/nc_test'
> make[1]: *** [subdir_target] Error 1
> make[1]: Leaving directory `/usr/home/swilson/netcdf-3.3.1/src'
> make: *** [nc_test/test] Error 2

On a properly behaving system, the above error should not occur.  One of
the first things that the file "nc_test/nc_test.c" does is to cause
floating point exceptions to be ignored.  The appearance of this error
would seem to indicate a problem with the Linux signal-handling
mechanism.

If you have the time, I suggest that you investigate the problem.
Discover where, exactly, the floating-point exception is being raised.
If this is after the call to signal() in "nc_test/nc_test.c", then your
system has problems.

To build the system for debugging, do the following:

    1.  Go to the top-level source directory.

    2.  Ensure that the environment variable CFLAGS contains the option
        "-g".

    3.  Execute the configure script.

    4.  Execute the command "make clean".

    5.  Execute the command "make".

    6.  Execute the command "make test".

You can then use the debugger to check out the core file in the "nc_test"
subdirectory.

Please let me know what you find.

--------
Steve Emmerson   <http://www.unidata.ucar.edu>