Fixed GSL to compile under 32 bit IRIX

C M Murphy C.M.Murphy@bath.ac.uk
Fri Mar 31 10:20:00 GMT 2000


I've been working to get GSL 0.5 working under IRIX 6.3.  With the 64
bit compiler on later versions of IRIX, GSL compiles and installs
fine, but the compiler with 6.3 (and earlier) is extremely fussy.  In
particular, the "const" status of arguments in argument lists in
function prototypes have to match the argument list in function
definitions exactly, otherwise a compiler error is triggered.  For
instance in roots/gsl_roots.h, gsl_root_test_interval is declared as:

int
gsl_root_test_interval (gsl_interval x, double epsabs, double epsrel);

but in roots/convergence.c, it is defined as:

int
gsl_root_test_interval (const gsl_interval x, double epsabs, double epsrel)
{ ... }

The ommission of the const on the first argument in gsl_roots.h causes
a compile error which is fixed by inserting a const keyword to make
the prototype resemble the definition.

I have found around 660 such declarations which caused this problem
and have fixed them.  I can supply a patch to anyone who wants it.

Incidentally, there was one other minor problem with the IRIX
compiler.  When literals defined as negative numbers are themselves
negated, they aren't properly parsed.  In gsl_machine.h, there are
several literals like

#define GSL_LOG_DBL_EPSILON   -3.6043653389117154e+01

If this is used in an expression like

... -GSL_LOG_DBL_EPSILON ...

it fails, saying that the constant is an illegal l-value and hence
can't be decremented.  This is solved by redefining the literals as
follows:

#define GSL_LOG_DBL_EPSILON   (-3.6043653389117154e+01)

and similarly for the other four negative literals in gsl_machine.h.

If any of the maintainers want to discuss this, please don't hesitate
to get in touch with me.

Regards

--Chris Murphy

-- 
|     Chris Murphy: Department of Mechanical Engineering,     |
|     University of Bath, Claverton Down, Bath BA2 7AY, UK    |
|  TEL : +44 1225 826826 ext 5558      FAX : +44 1225 826928  |
|  MAIL: C.M.Murphy@bath.ac.uk   URL: http://www.bath.ac.uk/  |



More information about the Gsl-discuss mailing list