[Numpy-discussion] Installation of numpy header files

Sasha ndarray at mac.com
Fri Jan 6 22:05:31 CST 2006


Ok, I've found it:

http://www.scipy.org/documentation/mailman?fn=scipy-dev/2005-September/003238.html

Sorry for the extra traffic.

Let me paraphrase the solution here to hopefully make it more discoverable:

"""
Extension modules that need to compile against numpy should use
get_numpy_include function to locate the appropriate include directory.

Using distutils:

      import numpy
      Extension('extension_name', ...
                include_dirs=[numpy.get_numpy_include()])
"""

-- sasha


On 1/7/06, Sasha <ndarray at mac.com> wrote:
> On 1/7/06, Andrew Straw <strawman at astraw.com> wrote:
> > ... There was discussion about this a couple of months ago.
>
> Could you, please give me some keywords for this discussion? I
> searched the archives and the only relevant thread was from 2002
> (http://aspn.activestate.com/ASPN/Mail/Message/scipy-dev/1592700). I
> understand that at that time there was a solution involving
> sitecustomize.py, but that was replaced with site.cfg some time ago.
>
> The message that I cited above has a much better description of the
> problem that I am experiencing than what I wrote:
>
> >  (1) include directories.
> >  Distutils knows to include files from /usr/include/python2.2 (or
> >  wherever it is installed) whenever building extension modules.
> >  Numeric installs its header files inside this directory when installed
> >  as root.  However, when I install Numeric in /home/eric/linux, the
> >  header files are installed in /home/eric/linux/python2.2.  Distutils
> >  doesn't know to look in hear for headers.  To solve this, I'd have to
> >  hack all the setup.py files for modules that rely on Numeric to use my
> >  include_dirs.  This isn't so nice.
>
> Thanks.
>
> -- sasha
>




More information about the Numpy-discussion mailing list