C Extension intp problem
Dear all, I had a working C extension, but after upgrading to a recent numpy from SVN, I can no longer compile it. I've fixed the deprecation warnings, but can't get past this: frgetvect.c:51: error: 'intp' undeclared (first use in this function) Now, I'm quite confused since I thought that intp should be a global thing, not numpy related, and I believe I'm using the shipped Apple gcc version. Version info: nvf@whitedwarf:~/temp/v6r20/pyfrgetvect$ python -V Python 2.4.1 nvf@whitedwarf:~/temp/v6r20/pyfrgetvect$ python -c "import numpy; print numpy.__version__" 1.1.2881 nvf@whitedwarf:~/temp/v6r20/pyfrgetvect$ gcc --version powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 20041026 (Apple Computer, Inc. build 4061) Can anyone help me? Thanks, Nick Full build output: nvf@whitedwarf:~/temp/v6r20/pyfrgetvect$ python setup.py build running build running build_ext building 'frgetvect' extension C compiler: gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict- prototypes creating build creating build/temp.darwin-8.7.0-Power_Macintosh-2.4 compile options: '-DMAJOR_VERSION=0 -DMINOR_VERSION=2 -I../src -I/ Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include -I/Library/Frameworks/Python.framework/ Versions/2.4/include/python2.4 -c' extra options: '-w' gcc: frgetvect.c frgetvect.c: In function 'frgetvect': frgetvect.c:51: error: 'intp' undeclared (first use in this function) frgetvect.c:51: error: (Each undeclared identifier is reported only once frgetvect.c:51: error: for each function it appears in.) frgetvect.c:51: error: parse error before "shape" frgetvect.c:138: error: 'shape' undeclared (first use in this function) frgetvect.c:138: error: parse error before "nData" frgetvect.c: In function 'frgetvect': frgetvect.c:51: error: 'intp' undeclared (first use in this function) frgetvect.c:51: error: (Each undeclared identifier is reported only once frgetvect.c:51: error: for each function it appears in.) frgetvect.c:51: error: parse error before "shape" frgetvect.c:138: error: 'shape' undeclared (first use in this function) frgetvect.c:138: error: parse error before "nData" error: Command "gcc -fno-strict-aliasing -Wno-long-double -no-cpp- precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall - Wstrict-prototypes -DMAJOR_VERSION=0 -DMINOR_VERSION=2 -I../src -I/ Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include -I/Library/Frameworks/Python.framework/ Versions/2.4/include/python2.4 -c frgetvect.c -o build/ temp.darwin-8.7.0-Power_Macintosh-2.4/frgetvect.o -w" failed with exit status 1
On Fri, 28 Jul 2006 16:25:00 -0400 Nick Fotopoulos <nvf@MIT.EDU> wrote:
Dear all,
I had a working C extension, but after upgrading to a recent numpy from SVN, I can no longer compile it. I've fixed the deprecation warnings, but can't get past this:
frgetvect.c:51: error: 'intp' undeclared (first use in this function)
Now, I'm quite confused since I thought that intp should be a global thing, not numpy related, and I believe I'm using the shipped Apple gcc version.
To avoid namespace clashes with other libraries, we've switched to adding a unique prefix 'npy_' to types (and NPY_ to #defines). You can either change your code to use 'npy_intp', or add #include "numpy/noprefix.h" to the top. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca
On Jul 28, 2006, at 4:47 PM, David M. Cooke wrote:
On Fri, 28 Jul 2006 16:25:00 -0400 Nick Fotopoulos <nvf@MIT.EDU> wrote:
Dear all,
I had a working C extension, but after upgrading to a recent numpy from SVN, I can no longer compile it. I've fixed the deprecation warnings, but can't get past this:
frgetvect.c:51: error: 'intp' undeclared (first use in this function)
Now, I'm quite confused since I thought that intp should be a global thing, not numpy related, and I believe I'm using the shipped Apple gcc version.
To avoid namespace clashes with other libraries, we've switched to adding a unique prefix 'npy_' to types (and NPY_ to #defines). You can either change your code to use 'npy_intp', or add
#include "numpy/noprefix.h"
to the top.
Aha! I was under the impression that intp was a native C thing. Thanks for clarifying. Take care, Nick
participants (2)
-
David M. Cooke
-
Nick Fotopoulos