This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: gsl 0.8 compile error
- To: Brian Gough <bjg at network-theory dot co dot uk>
- Subject: Re: gsl 0.8 compile error
- From: Toby White <tow at theor dot ch dot cam dot ac dot uk>
- Date: 26 Jun 2001 16:36:49 +0100
- Cc: gsl-discuss at sources dot redhat dot com
- References: <E15Eoib-0004ar-00@navy.csi.cam.ac.uk>
Jason Beegan <jtb@netbsd.org> writes:
> I don't know about OpenBSD, but:
>
> For some NetBSD platforms there are two math libraries, the portable C
> one, and an Assembly routine library.
>
> For i386 you have libm and libm387, and if /etc/ld.so.conf contains
>
> libm.so.0 machdep.fpu_present 1:libm387.so.0,libm.so.0
>
> then libm387 will be used in place of the C version.
>
> Perhaps you need to remove a similar line from your ld.so.conf to
> use the C version.
>
> The C version passes all GSL tests on i386, but GSL fails the same
> tests as on OpenBSD with the Assembly stuff. I only tested GSL with
> the portable C version, so only after this discussion have I noticed
> the problem.
>
> I'll report it as a NetBSD bug.
Interesting. Although the OpenBSD source has the same division; into
a portable C version and an i386 assembler version; it looks like
only the assembler version gets built for i386. Certainly that's the
only version I can find on this system.
So if you want GSL to work properly under OpenBSD at the moment, you have
to use gsl_log1p. A quick patch to configure.in is included below. I'll try
and come up with a better test that actually checks the output of log1p.
--- configure.in Mon Jun 25 21:21:32 2001
+++ configure.in.new Tue Jun 26 13:48:46 2001
@@ -61,7 +61,15 @@
dnl Checks for library functions.
AC_CHECK_LIB(m, main)
AC_CHECK_FUNCS(hypot)
-AC_CHECK_FUNCS(log1p)
+dnl OpenBSD has a broken implementation of log1p.
+case "$host" in
+ *-*-*openbsd*)
+ AC_MSG_RESULT([Broken system log1p - using gsl version])
+ ;;
+ *)
+ AC_CHECK_FUNCS(log1p)
+ ;;
+esac
AC_CHECK_FUNCS(expm1)
AC_CHECK_FUNCS(acosh)
AC_CHECK_FUNCS(asinh)
And on a separate note - there's a slight error in fp-openbsd.c
(and fp-netbsd.c) in CVS.
--- fp-openbsd.c.old Tue Jun 26 11:35:11 2001
+++ fp-openbsd.c Tue Jun 26 14:43:04 2001
@@ -74,7 +74,7 @@
mode = FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL;
#ifdef FP_X_DNML
- mode = mode | FP_X_DNML
+ mode = mode | FP_X_DNML;
#endif
if (exception_mask & GSL_IEEE_MASK_INVALID)
Toby
--
Toby White, University Chemical Lab., Lensfield Road, Cambridge. CB2 1EW. U.K.
Email: <tow@theor.ch.cam.ac.uk> GPG Key ID: 1DE9DE75
Web: <URL:http://ket.ch.cam.ac.uk/people/tow/index.html>
Tel: +44 1223 336423
Fax: +44 1223 336362