On Tue, May 5, 2009 at 12:08 AM, Brett Calcott <[email protected]> wrote:
> Hi all,
> I'm using pyimport and writing some extensions to work numpy. To get things
> to happen magically the compiler needs to be able to find the header files.

That's a very valid use case...

> I've got it working on my mac, by adding a line to my .bashrc
> export C_INCLUDE_PATH=/Library/Python/2.5/site-packages/numpy/core/include
> I'd like to get it working on windows.

Though it works on your Mac, it is not clear if this works on other
POSIX systems...

> I've added the equivalent path in my
> windows env (set INCLUDE=...), but I'm getting an error telling me it cannot
> find the "include/arrayobject.h". I've tried setting the right directory in
> the GUI too, but to no avail.

On Windows, distutils hardly inspect the environment, so playing with
it is not a general solution.

> Can anyone tell me the easy/right way to add include paths for pyximport on
> windows. Is there a better and portable way to do this?


AFAIK, pyximport does not support this at all... However, it would be
really easy to enhance it. I would add a 'options' or 'config' (or
whatever name) at the end of "pyximport.install()" (or perhaps provide
a new call for this task) accepting a dictionary. That dictionary
should contain stuff to pass as kwargs to the distutils Extension, the
more important ones would be

include_dirs
define_macros
undef_macros
library_dirs
libraries
runtime_library_dirs

That stuff should be (after checking and perhaps sanitizing the dict
contents) passed to Extension() in
"pyximport.get_distutils_extension()".

Unfortunately, I'm really busy to implement something like that for review.

-- 
Lisandro Dalcín
---------------
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