[Numpy-discussion] compile error with python2.5

Achim Gaedke Achim.Gaedke at physik.tu-darmstadt.de
Sun Sep 17 15:00:07 CDT 2006


Hi!

I compiled numpy-1.0b5 with python2.5 on debian testing and raIn file
included from numpy/core/src/multiarraymodule.c:65:
numpy/core/src/arrayobject.c: In function 'PyArray_PyIntAsIntp':
numpy/core/src/arrayobject.c:564: error: 'op' undeclared (first use in
this function)
numpy/core/src/arrayobject.c:564: error: (Each undeclared identifier is
reported only once
numpy/core/src/arrayobject.c:564: error: for each function it appears in.)
numpy/core/src/arrayobject.c:565: warning: cast from pointer to integer
of different size
numpy/core/src/arrayobject.c: In function 'PyArray_PyIntAsInt':
numpy/core/src/arrayobject.c:654: warning: cast from pointer to integer
of different size
numpy/core/src/arrayobject.c: In function 'array_subscript':
numpy/core/src/arrayobject.c:2694: error: request for member 'ob_type'
in something not a structure or union
numpy/core/src/arrayobject.c:2694: error: request for member 'ob_type'
in something not a structure or union
numpy/core/src/arrayobject.c:2694: error: request for member 'ob_type'
in something not a structure or union
In file included from numpy/core/src/multiarraymodule.c:65:
numpy/core/src/arrayobject.c: In function 'PyArray_PyIntAsIntp':
numpy/core/src/arrayobject.c:564: error: 'op' undeclared (first use in
this function)
numpy/core/src/arrayobject.c:564: error: (Each undeclared identifier is
reported only once
numpy/core/src/arrayobject.c:564: error: for each function it appears in.)
numpy/core/src/arrayobject.c:565: warning: cast from pointer to integer
of different size
numpy/core/src/arrayobject.c: In function 'PyArray_PyIntAsInt':
numpy/core/src/arrayobject.c:654: warning: cast from pointer to integer
of different size
numpy/core/src/arrayobject.c: In function 'array_subscript':
numpy/core/src/arrayobject.c:2694: error: request for member 'ob_type'
in something not a structure or union
numpy/core/src/arrayobject.c:2694: error: request for member 'ob_type'
in something not a structure or union
numpy/core/src/arrayobject.c:2694: error: request for member 'ob_type'
in something not a structure or union
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -fPIC -Ibuild/src.linux-i686-2.5/numpy/core/src
-Inumpy/core/include -Ibuild/src.linux-i686-2.5/numpy/core
-Inumpy/core/src -Inumpy/core/include
-I/home/achim/local/include/python2.5 -c
numpy/core/src/multiarraymodule.c -o
build/temp.linux-i686-2.5/numpy/core/src/multiarraymodule.o" failed with
exit status 1
n into errors

I fixed it by guessing the correct arguments. The patch is attached.

I hope someone can revise this fix.

Achim
-------------- next part --------------
diff -ru numpy-1.0b5/numpy/core/src/arrayobject.c numpy-1.0b5_fixed/numpy/core/src/arrayobject.c
--- numpy-1.0b5/numpy/core/src/arrayobject.c	2006-09-05 00:41:47.000000000 +0200
+++ numpy-1.0b5_fixed/numpy/core/src/arrayobject.c	2006-09-17 21:41:49.000000000 +0200
@@ -561,8 +561,8 @@
                 return ret;
         }
 #if (PY_VERSION_HEX >= 0x02050000)
-	if (PyIndex_Check(op)) {
-		long_value = (longlong) PyNumber_Index(op);
+	if (PyIndex_Check(o)) {
+		long_value = (longlong) PyNumber_Index(o);
 		goto finish;
 	}
 #endif
@@ -2691,7 +2691,7 @@
         }
 
         if (PyInt_Check(op) || PyArray_IsScalar(op, Integer) ||
-            PyLong_Check(op) || PyIndex_Check(index)) {
+            PyLong_Check(op) || PyIndex_Check(op)) {
                 intp value;
                 value = PyArray_PyIntAsIntp(op);
                 if (!PyErr_Occurred()) {


More information about the Numpy-discussion mailing list