[SciPy-user] install location of the newcore header files

Robert Kern rkern at ucsd.edu
Mon Oct 10 14:24:41 CDT 2005

Gerard Vermeulen wrote:
> I finally discovered where the header files get installed when reading CAPI.txt;
> on the scip-dev list it is argued that the Python include directory is not a
> standard place for headers.

No one is arguing that it's not standard. I'm arguing that it's a *bad*
place because frequently people can't install to it.

> This amazes me, because the first 100-150 lines of distutils/command/install.py
> spell out the default install directories for different type of files; and header
> files are supposed to be installed in the Python include directory.
> Deviating from the standard is a bad idea, because it means that the programmer
> who wants to read the headers has to remember that they are in a strange place
> (much more annoying than fixing a setup.py script or other installation tool).

In my experience, I usually go header-diving after something fails to
compile. The scipy include directory is always explicitly listed in the
compile command.

> I understand that some people cannot write to the Python include directory,
> but distutils can take care of that in principle, see
> http://python.org/doc/2.4.2/inst/search-path.html

Yes, that solves installing the headers to a new location. But people
then have to modify every setup.py script for modules that use scipy
headers to point to the new location.

> The same technique works (in principle) also for header files (admittedly, there
> are some quirks).  IMO, it is better to fix the quirks to improve distutils
> instead of breaking the distutils policies which are meant to facilitate life.

The policy to install headers to the main Python include directory was
created at a time when it wasn't easy to install data into the package
itself. That distutils quirk got fixed in Python 2.4 (and
scipy.distutils also does this easily for Python <2.4). I imagine that
if package data had been easy at the beginning of distutils's life, we
would have been using this solution all along. The install_headers
policy has been a thorn in our side ever since it was created. There's a
better way, now.

Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

More information about the SciPy-user mailing list