On 22 February 2010 22:10, David Cournapeau <[email protected]> wrote:
> On Tue, Feb 23, 2010 at 8:42 AM, T J <[email protected]> wrote:
>> Hi,
>>
>> I have numpy installed system-wide, but I also have my own (svn)
>> version in ~/.local.  When I compile cython modules which make use of
>> the NumPy array access, it needs to reference the NumPy include files.
>>  These are located here:
>>
>>   ~/.local/lib/python2.6/site-packages/numpy/core/include/numpy/
>>
>> The "problem" I am having is that when I compile the cython extension,
>> it is using libraries located here:
>>
>>  /usr/include/python2.6/numpy
>
> In addition to what Robert said, note that the above is a downstream
> modification. By putting headers in /usr/include instead of
> $site-packages/numpy, the system-wide numpy headers are included
> whenever the Python.h is, which is often before the numpy headers (the
> ones we want).
>

Indeed. For some reason, packagers think that developers are idiot,
naive, laizy, whatever and freely make ANY modification they feel it
makes sense, without ever dropping you a single mail commenting on the
changes... Then you start receiving mails about issues with your
code... For example, Cython users could take advantage of
__init__.[pyx|pxd] to signal packages.. but be carefull, perhaps you
should at least add a single comment line in the file, never let it be
pass empty to downstream, as a packager could remove empty files
(because rpmlint complains about that)

> This problem is aggravated by the fact that there is no easy way to
> control header path inclusion in distutils: paths are added through
> add_include_dirs (which *append* paths), but the default should
> actually be prepending. Maybe we should change this internally in
> numpy.distutils, but I am a bit worried about the consequences,
>

IIRC, the same applies to library paths... So you could have a hard
time using a custom, shared-lib enabled Python build with version
matching the system Python (and BTW, "/usr/lib" should NEVER be
added)... Someone should definitely bug distutils about this... But
you know, one has to be brave and patient enough to fight in the bug
tracker or python-dev :-)


-- 
Lisandro Dalcin
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to