bugGNU Scientific Library - Bugs: bug #21832, gsl infnan.c configure/build bug...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #21832: gsl infnan.c configure/build bug on solaris

Submitted by:  -Deleted Account- <bjg>
Submitted on:  Tue 18 Dec 2007 05:44:20 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Operating System: solarisStatus: Fixed
Assigned to: -Deleted Account- <bjg>Open/Closed: Closed
Release: 1.9

Tue 18 Dec 2007 05:44:20 PM UTC, original submission:

From: Richard Smith <Richard.Smith@Sun.COM>
To: -unavailable-
Subject: [Bug-gsl] gsl infnan.c configure/build bug
Date: Tue, 24 Jul 2007 10:24:22 +1000

infnan.c currently fails to compile on Solaris with Sun Studio 12 compilers
when using default compiler options as generated by running configure with
no options. Here is an extract of the output when running make:

/bin/bash ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I.
-I../../sys
-I.. -I.. -g -c -o infnan.lo ../../sys/infnan.c
cc -DHAVE_CONFIG_H -I. -I../../sys -I.. -I.. -g -c ../../sys/infnan.c
-KPIC -D
PIC -o .libs/infnan.o
"/usr/include/ieeefp.h", line 74: syntax error before or at:
__builtin_isfinite
cc: acomp failed for ../../sys/infnan.c

The problem seems to occur as a result of the following combination of
things:
1. "finite" function is used in various source files
2. configure.ac checks for <ieeefp.h> and finds it
3. On Solaris, "finite" is defined in <ieeefp.h>
4. configure.ac only checks <math.h> for "finite", and doesn't find it.
5. Since its a c99 environment, "isfinite" is found.
6. config.h ends up containing amongst other things the following lines:
#define HAVE_DECL_FINITE 0
#define HAVE_DECL_ISFINITE 1
#if !HAVE_DECL_FINITE
#if HAVE_DECL_ISFINITE
#define finite isfinite
#else
#define finite gsl_finite
#endif
#endif
This means that "finite" macro has the value "isfinite"
7. "isfinite" is a macro, ultimately defined in <iso/math_c99.h>:
#define isfinite(x) __builtin_isfinite(x)
8. <ieeefp.h> declares "finite" function:
extern int finite(double);
9. After macro expansion the compiler sees
extern int __builtin_isfinite ( double ) ;
and complains with an error.

There's probably multiple ways of overcoming the problem. A workaround is
to force the compiler not to use a C99 environment e.g. -xc99=%none. However
since it would be desirable to have configure work well by default, maybe
the test in configure.ac for "finite" should be something like:
AC_CHECK_DECLS(finite,,,[#include <math.h>
#if HAVE_IEEEFP_H
# include <ieeefp.h>
#endif])

Alternatively all uses of "finite" could be changed to use "isfinite", and
the configuration/build be based around assuming a C99 environment, with
substitute functions and macros being provided where the necessary C99
facilities are missing. On Linux, the BSD floating point classification
functions are documented as being obsolete, so their use should probably
be avoided.

--
============================================================================
,-_|\ Richard Smith - Technical Specialist
/ \ Sun Microsystems Australia Phone : +61 3 9869 6200
-unavailable- Direct : +61 3 9869 6224
\_,-._/ 476 St Kilda Road Fax : +61 3 9869 6290
v Melbourne Vic 3004 Australia
===========================================================================

_____________________________________________
Bug-gsl mailing list
-unavailable-
http://lists.gnu.org/mailman/listinfo/bug-gsl

-Deleted Account- <bjg>In charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Wed 19 Mar 2008 12:42:09 PM UTCbjgOpen/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1