[NumPy-Tickets] [NumPy] #1625: Numpy is ignoring the fact "isfinite" is undefined

NumPy Trac numpy-tickets@scipy....
Tue Oct 5 16:52:56 CDT 2010


#1625: Numpy is ignoring the fact "isfinite" is undefined
----------------------+-----------------------------------------------------
 Reporter:  drkirkby  |       Owner:  somebody
     Type:  defect    |      Status:  new     
 Priority:  normal    |   Milestone:  2.0.0   
Component:  Other     |     Version:  1.5.0   
 Keywords:            |  
----------------------+-----------------------------------------------------

Comment(by drkirkby):

 Replying to [comment:1 charris]:
 > The STSI folks haven't reported this on SPARC, so this may be a
 hardware/version/compiler specific problem. Can you provide some details
 about those? And what python version are you using?

 Sorry, I should have been more specific. This problem is seen with gcc
 4.5.1, using Python 2.6.4. It's seen on three systems. These include both
 SPARC and x86.

  * Sun Blade 2500 SPARC running Solaris 10 update 1 (Jan 2006 edition)
  * Dell server, Xeon CPUs, Solaris 10 update 5 (May 2005 release)
  * Sun Ultra 27, quad core Xeon running !OpenSolaris 06/09 (June 2009
 release)

 > On my system that the relevant lines are in pyconfig.h
 >
 > {{{
 > /* Define to 1 if you have the declaration of `isfinite', and to 0 if
 you
 >    don't. */
 > #define HAVE_DECL_ISFINITE 1
 > }}}
 >
 > And HAVE_DECL_ISFINITE is what Numpy looks for. Where does
 ac_cv_have_decl_isfinite come from?

 {{{ac_cv_have_decl_isfinite}}} is in Python's config.log. Python's header
 file {{{pyconfig.h}}} has in it:

 {{{
 /* Define to 1 if you have the declaration of `isfinite', and to 0 if you
    don't. */
 #define HAVE_DECL_ISFINITE 0
 }}}

 when Numpy 1.5.0 is built, there are some compiler warnings, one of which
 is:

 {{{
 /src.solaris-2.11-i86pc-2.6/numpy/core/include/numpy/
 buildconfig.h:101:0: warning: "HAVE_DECL_ISFINITE" redefined
 /export/home/drkirkby/sage-4.6.alpha2/local/include/python2.6/pyconfig.h:121:0:
 note: this is the location of the previous definition
 }}}

 Numpy's file {{{config.h}}} has in it:

 {{{
 #define HAVE_DECL_ISINF
 #define HAVE_DECL_ISFINITE
 #define HAVE_COMPLEX_H
 }}}

 Of course, it is true that {{{HAVE_DECL_ISFINITE}}} was defined in
 Python's {{{pyconfig.h}}}, but it was defined to a value of {{{0}}}
 indicating the system did '''not''' have {{{isfinite}}}.

 > Note that it is not a bug to provide more than a standard requires.

 I take your point, but it does cause problems when people write code and
 assume that they can use things like {{{isfinite}}} as they are declared
 in {{{math.h}}}, when in fact they are not standard. This seems to be the
 case in point here.

 Dave

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1625#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list