[Python-Dev] Re: Possible bug (was Re: numpy, overflow, inf, ieee, and rich comparison)
Thomas Wouters
thomas@xs4all.net
Wed, 11 Oct 2000 16:32:45 +0200
On Wed, Oct 11, 2000 at 10:25:32AM -0500, Guido van Rossum wrote:
> 1.5.2 links with -lieee while 2.0 doesn't. Removing -lieee from the
> 1.5.2 link line makes is raise OverflowError too. Adding it to the
> 2.0 link line makes it return 0.0 for exp(-1000) and inf for
> exp(1000).
Ack, that's the one thing I didn't check: link libraries ;-P
> Next question: what changed in the configure script, and why?
Well, that's easy.
Old configure.in:
# Linux requires this for correct f.p. operations
AC_CHECK_LIB(ieee, __fpu_control)
New configure.in:
# Linux requires this for correct f.p. operations
AC_CHECK_FUNC(__fpu_control,
[],
[AC_CHECK_LIB(ieee, __fpu_control)
])
I remember the patch that did this, on SF. It was titled "don't link with
-lieee if it isn't necessary" or something. Not sure what it would break,
but mayhaps declaring -lieee necessary on glibc systems is the right fix ?
(For the non-autoconf readers among us: the first snippet writes a test
program to see if the function '__fpu_control' exists when linking with
-lieee in addition to $LIBS, and if so, adds -lieee to $LIBS. The second
snippet writes a test program to see if the function '__fpu_control' exists
with the current collection of $LIBS. If it doesn't, it tries it again with
-lieee, and adds -lieee to $LIBS if it finds it then.)
Pesonally, I think the patch should just be reversed... The comment above
the check certainly could be read as 'Linux requires -lieee for correct f.p.
operations', and perhaps that's how it was meant.
--
Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!