Fwd: [Numpy-discussion] Numpy does not compile with PY_ARRAY_TYPES_PREFIX

David M. Cooke cookedm at physics.mcmaster.ca
Fri Jan 27 16:43:03 EST 2006


Sasha <ndarray at mac.com> writes:

> On 1/27/06, David M. Cooke <cookedm at physics.mcmaster.ca> wrote:
>> You need to add #include "Python.h" as the first include (and add a
>> -I<python include directory> to your gcc line, of course).
>
> Still does not work
>
>> cat test.c
> #define PY_ARRAY_TYPES_PREFIX XYZ_
> #include <Python.h>
> #include <numpy/arrayobject.h>
>
>> gcc -I Python-2.4.1/include/python2.4 -I lib/python2.4/site-packages/numpy/core/include -c test.c
> In file included from
> lib/python2.4/site-packages/numpy/core/include/numpy/arrayobject.h:1346,
>                  from test.c:3:
> lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:
> In function `import_array':
> lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:765:
> parse error before ')' token
> lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:765:
> parse error before ')' token
> lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:
> At top level:
> lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:771:
> parse error before "return"

Hmm, the location of that error would seem to imply it's something to
do with NDARRAY_VERSION not being defined. Maybe for some reason
you've got an old arrayobject.h, but a newer __multiarray_api.h? I'd
try blowing away your lib/python2.4/site-packages/numpy directory, and
installing again.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the NumPy-Discussion mailing list