This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gsl 0.8 compile error


Brian Gough <bjg@network-theory.co.uk> writes:

> Thanks for reporting that problem.  At the configure stage the
> configure script defaults to using the ieee file for Freebsd for any
> unknown BSD system (we don't have a corresponding file for Openbsd).
> 
> If you could find out what functions Openbsd uses to control rounding
> mode and precision that could be added. 

I'd been meaning to do this for a while - this got me round to it. 
Anyway - the OpenBSD IEEE interface is identical to (indeed, 
originally lifted straight from) the NetBSD one (which is the same 
as FreeBSD, except without any precision control). 

(At least on i386-based openbsd - but from the openbsd source it 
looks the same for all other architectures)

The patches below fix it - however, make check throws up a couple
of errors - I've addressed these in a separate post. This has 
only been tested on OpenBSD 2.9, but should work for any version
after 2.0.

The following patch is the simplest way to fix it:

--- configure Wed May 23 10:37:27 2001
+++ configure.new       Mon Jun 25 17:27:53 2001
@@ -6562,7 +6562,11 @@
         cat >> confdefs.h <<\EOF
 #define HAVE_NETBSD_IEEE_INTERFACE 1
 EOF
-
+       ;;
+    *-*-openbsd*)
+       cat >> confdefs.h <<\EOF
+#define HAVE_NETBSD_IEEE_INTERFACE 1
+EOF
         echo "$ac_t""netbsd" 1>&6 
         ;;
     *-*-*bsd*)

But you probably actually want to have correct error messages; so
the following is better:

--- configure Wed May 23 10:37:27 2001
+++ configure.new       Mon Jun 25 17:27:53 2001
@@ -6562,7 +6562,11 @@
         cat >> confdefs.h <<\EOF
 #define HAVE_NETBSD_IEEE_INTERFACE 1
 EOF
-
+       ;;
+    *-*-openbsd*)
+       cat >> confdefs.h <<\EOF
+#define HAVE_OPENBSD_IEEE_INTERFACE 1
+EOF
         echo "$ac_t""openbsd" 1>&6 
         ;;
     *-*-*bsd*)


--- fp.c      Mon Jun 25 17:38:23 2001
+++ fp.c.new    Mon Jun 25 17:38:38 2001
@@ -28,6 +28,8 @@
 #include "fp-os2emx.c"
 #elif defined(HAVE_NETBSD_IEEE_INTERFACE)
 #include "fp-netbsd.c"
+#elif defined(HAVE_OPENBSD_IEEE_INTERFACE)
+#include "fp-openbsd.c"
 #elif defined(HAVE_DARWIN_IEEE_INTERFACE)
 #include "fp-darwin.c"
 #else

--- fp-netbsd.c Wed Apr 18 22:52:28 2001
+++ fp-openbsd.c        Mon Jun 25 17:33:45 2001
@@ -31,15 +31,15 @@
   switch (precision)
     {
     case GSL_IEEE_SINGLE_PRECISION:
-      GSL_ERROR ("NetBSD only supports default precision rounding",
+      GSL_ERROR ("OpenBSD only supports default precision rounding",
                 GSL_EUNSUP);
       break;
     case GSL_IEEE_DOUBLE_PRECISION:
-      GSL_ERROR ("NetBSD only supports default precision rounding",
+      GSL_ERROR ("OpenBSD only supports default precision rounding",
                 GSL_EUNSUP);
       break;
     case GSL_IEEE_EXTENDED_PRECISION:
-      GSL_ERROR ("NetBSD only supports default precision rounding",
+      GSL_ERROR ("OpenBSD only supports default precision rounding",
                 GSL_EUNSUP);
       break;
     }

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]