[Numpy-discussion] Numpy does not compile with PY_ARRAY_TYPES_PREFIX

Andrew Straw strawman at astraw.com
Fri Jan 27 09:14:07 CST 2006


Sasha wrote:

>I have attempted to compile RPy (see http://rpy.sourceforge.net/) with
>numpy and found that both R and numpy headers define Int32:
>
>.../numpy/core/include/numpy/arrayobject.h:304: conflicting types for `Int32'
>.../lib/R/include/R_ext/Random.h:57: previous declaration of `Int32'
>
>I have tried to fix the problem by setting PY_ARRAY_TYPES_PREFIX as follows:
>
>$ CFLAGS=-DPY_ARRAY_TYPES_PREFIX=PyArray_NS_ python setup.py build
>
>This resulted in compile error in almost every Numpy source file.
>
>Am I using PY_ARRAY_TYPES_PREFIX correctly? If not, what is the
>recommended way to solve name conflicts involving Numpy typoes?
>  
>

David Cooke informed me some time ago that the #include
"numpy/arrayobject.h" line should go _after_ the other #includes. It's
worked for me well enough ever since, although it seems rather fragile.
Otherwise I'm not having the same issue with current svn. There was an
issue with release 0.9.4 for C++ code, anyway.

Cheers!
Andrew




More information about the Numpy-discussion mailing list