On 10/12/10 03:05 PM, Brian Gough wrote:
At Tue, 28 Sep 2010 02:27:10 +0100,
Dr. David Kirkby wrote:
That is enough to get the code to compile on AIX 5.3, but it is not building the
library properly - see below. I'm pretty new to AIX, so don't have a lot of
experience in knowing what these errors might be.

I'm happy to apply a patch for that if you have one. If it is mostly
in fp-aix.c it shouldn't affect anything else.

I was unable to download the latest copy of your source code from your respository, as you don't use one of hte tools I have (git, cvs, mecurial etc). As such, I have created this patch against your version 1.14


Given there is only a single line added to configure.ac, and the rest is in fp-aix.c, I doubt it will be hard to integrate.

I am still getting a linker error, but that is unrelated and probably more related to my setup, as I'm hitting a similar problem on other packages.

Personally I think this GSL/AIX issue is a gcc bug. One of the gcc developers asked me to submit it to the gcc bug tracker as a bug. But someone else has replied it is not a gcc bug.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46155

It would appear that the float.h header file used by GCC is the same on every single platform, so it completely ignores anything that might have been put there by IBM, Sun, HP or whoever else. That seems wrong to me, but that's the way it is.

Let me know if these patches look ok to you. If you can integrate them to the next GSL release, it would be good.

As I say, I personally think it's a gcc bug, but I doubt I'll convince the gcc developers to fix it.

Dave
--- fp-aix.c.orig	2010-03-10 10:57:13.000000000 +0000
+++ fp-aix.c	2010-10-26 21:47:12.593140821 +0100
@@ -23,6 +23,41 @@
 #include <gsl/gsl_ieee_utils.h>
 #include <gsl/gsl_errno.h>
 
+/* GCC uses a common float.h for all platforms, and ignores all vendor
+specific code in float.h. That causes problems with fprnd_t, 
+FP_RND_RZ, FP_RND_RN and FP_RND_RP on AIX. 
+
+Personally I consider that a bug, and was advised by a GCC developer to report
+this as a bug, which I did. 
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46155
+
+However, there is not universal agreement whether this is a gcc bug, so 
+the issue needs to be worked around on AIX.  
+
+David Kirkby, 26th October 2010. */
+
+#if !HAVE_DECL_FPRND_T          
+typedef unsigned short fprnd_t; 
+#endif                          
+
+#ifndef FP_RND_RZ   
+#define FP_RND_RZ       0
+#endif 
+
+#ifndef FP_RND_RN
+#define FP_RND_RN       1
+#endif
+
+
+#ifndef FP_RND_RP
+#define FP_RND_RP       2
+#endif
+
+#ifndef FP_RND_RM
+#define FP_RND_RM       3
+#endif
+
 int
 gsl_ieee_set_mode (int precision, int rounding, int exception_mask)
 {
--- configure.ac.orig	2010-03-10 10:57:12.000000000 +0000
+++ configure.ac	2010-10-26 17:57:47.000000000 +0100
@@ -197,6 +197,7 @@
 AC_CHECK_DECLS(atanh,,,[#include <math.h>])
 AC_CHECK_DECLS(ldexp,,,[#include <math.h>])
 AC_CHECK_DECLS(frexp,,,[#include <math.h>])
+AC_CHECK_DECLS([fprnd_t],[],[],[[#include <float.h>]]) 
 AC_CHECK_DECLS(isinf,,,[#include <math.h>])
 AC_CHECK_DECLS(isfinite,,,[#include <math.h>])
 AC_CHECK_DECLS(finite,,,[#include <math.h>
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to