|
From: Alexander B. <ale...@gm...> - 2006-01-17 18:26:33
|
On 1/17/06, Andrew Straw <str...@as...> wrote: > ... > Also, as for as I know, the only packages that install things into > /usr/include/python2.x/packagename are Numeric and numarray, so I would > argue it's not "standard", (although it may have lots of history). I don't know what would qualify as "standard", but Numeric's header location is specifically mentioned in the distutils manual: """ If you need to include header files from some other Python extension, you can take advantage of the fact that header files are installed in a consistent way by the Distutils install_header command. For example, the Numerical Python header files are installed (on a standard Unix installation) to /usr/local/include/python1.5/Numerical. (The exact location will differ according to your platform and Python installation.) Since the Python include directory--/usr/local/include/python1.5 in this case--is always included in the search path when building Python extensions, the best approach is to write C code like #include <Numerical/arrayobject.h> """ (see http://docs.python.org/dist/describing-extensions.html#SECTION00232000= 0000000000000) The same section also criticises the idea of specifying include path explicitely: """ If you must put the Numerical include directory right into your header search path, though, you can find that directory using the Distutils distutils.sysconfig module: from distutils.sysconfig import get_python_inc incdir =3D os.path.join(get_python_inc(plat_specific=3D1), 'Numerical') setup(..., Extension(..., include_dirs=3D[incdir]), ) Even though this is quite portable--it will work on any Python installation, regardless of platform--it's probably easier to just write your C code in the sensible way. """ -- sasha |