[Numpy-discussion] how to include numpy headers when building an extension?

Travis E. Oliphant oliphant@enthought....
Tue Sep 11 01:35:49 CDT 2007


Christopher Barker wrote:
>
> I know this has been discussed, but why doesn't numpy put its includes 
> somewhere that distutils would know where to find it?
>   
I think one answer is because distutils doesn't have defaults that play 
well with eggs.   NumPy provides very nice extensions to distutils which 
will correctly add the include directories you need.

Look at any of the setup.py files for scipy for examples of how to use 
numpy.distutils.   Once you convert your setup.py files to use 
numpy.distutils there really isn't any problem anymore about where numpy 
puts its include files and the benefit gained by being able to use 
versioned eggs is worth it.

Yes, the transition is a little messy (especially if the build is not 
using distutils at all).    But, numpy.get_include() really helps 
mitigate that pain.
 
Thanks for the comments,

-Travis

>
>   



More information about the Numpy-discussion mailing list