help-octave
[Top][All Lists]
Advanced

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

2.0.5 NaN and inf


From: John W. Eaton
Subject: 2.0.5 NaN and inf
Date: Thu, 15 May 1997 11:25:27 -0500

On 15-May-1997, Ted Harding <address@hidden> wrote:

| I'm posting this for a friend of mine who ain't on the lists yet.
| 
| He pulled and compiled octave-2.0.5 on a Red Hat 4.1 Linux system.
| This has gcc-2.7.2.1, and there is no libieee.
| 
| He followed the instructions to modify the gcc specs file as in
| readme.linux.
| 
| Now he observes that (for instance)
| 
| x=NaN -> x=0
| 
| NaN -> NaN=0
| 
| NaN=1 -> NaN=1
| 
| 1/0 -> lots of messages and finally "inf"
| 
| -1/0 crashes octave ("memory exhausted")
| 
| inf can also be redefined (e.g. inf=1 -> inf-1).
| 
| Clearly the IEEE stuff for NaN and inf is not being compiled in, NaN and
| inf are redefinable, and apparently have dfefault values of 0 when octave
| is started up.
| 
| Can anyone offer advice? Sorry if the info is scrappy or inadequate to
| define the problem: this is based on a telephone conversation.

I suspect that Octave's configure script was run before fixing the
problem with libieee, and then not run again after fixing the
problem (and deleting the old config.cache file).  I think Inf and NaN
should work properly if you follow the directions in the README.Linux
file:

  The linker can't find -lieee
  ----------------------------

  This can happen because your libraries don't match your version of
  gcc.  Some recent Linux distributions don't include a libieee.a file
  because IEEE support is now the default and the library is no longer
  needed, but the gcc specs file still adds -lieee to the linker command
  if gcc is invoked with the -mieeefp flag.  I believe that you should
  be able to fix this by editing the gcc specs file.  In it, you should
  find something like this:

    %{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
    %{!ggdb:-lc} %{ggdb:-lg}}

  changing it to

    %{!shared: %{p:-lgmon} %{pg:-lgmon} %{!ggdb:-lc} %{ggdb:-lg}}

  should keep gcc from adding -lieee to the link command.  You can find
  the location of the specs file by running the command gcc -v.

  If you can't edit the gcc specs file for some reason, another solution
  that should work is to create an empty libieee.a file in the Octave
  src directory using the command:

    ar cq libieee.a

  NOTE: you should fix this problem (either by editing the specs file or
  by creating the library) *before* running configure and compiling
  Octave.  Otherwise, configure may incorrectly determine that your
  system doesn't have support for some IEEE math functions.


Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]