[Numpy-tickets] [NumPy] #523: Tiny bug causes compilation on Cygwin to fail

NumPy numpy-tickets@scipy....
Wed May 16 20:40:34 CDT 2007


#523: Tiny bug causes compilation on Cygwin to fail
----------------------------+-----------------------------------------------
 Reporter:  mdehoon         |       Owner:  somebody               
     Type:  defect          |      Status:  new                    
 Priority:  normal          |   Milestone:  1.0.3 Release          
Component:  numpy.numarray  |     Version:                         
 Severity:  normal          |    Keywords:  Cygwin compilation fenv
----------------------------+-----------------------------------------------
 In numpy/numarray/_capi.c, for a number of platforms fenv.h or fenv.c is
 #included twice.

 Lines 227-232 in current source:
 #if defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) ||
 defined(__MINGW32__)

 #if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__)

 #include <fenv.h>

 #elif defined(__CYGWIN__)

 #include "numpy/fenv/fenv.c"

 #endif

 and further down in lines 2940-2945:

 #elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) ||
 defined(__MINGW32__)

 #if defined(__GLIBC__) || defined(darwin) || defined(__MINGW32__)

 #include <fenv.h>

 #elif defined(__CYGWIN__)

 #include "numpy/fenv/fenv.h"

 #endif

 In numpy release 1.0.2, the second #include for __CYGWIN__ actually reads
 #include "numpy/fenv/fenv.c"
 so it includes fenv.c instead of fenv.h twice. This causes the somewhat
 cryptic error message:

 In file included from numpy/numarray/_capi.c:2945:
 numpy/core/include/numpy/fenv/fenv.c:32: error: redefinition of
 '__fe_dfl_env'
 numpy/core/include/numpy/fenv/fenv.c:32: error: previous definition of
 '__fe_dfl
 _env' was here

 In the latest revision of numpy/numarray/_capi.c, the second #include
 reads fenv.h instead of fenv.c. This appears to be a lucky typo, which
 actually allows the compilation to proceed. Nevertheless, the second set
 of #include's seem to be unnecessary.

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/523>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list