[Pyrex] Problems Building Pyrex Demos On Ubuntu

Juha S. sj.m at iloinen.net
Wed Feb 13 08:33:41 CET 2008


|Hi,

I'm just starting out with Pyrex and I ran into this kind of problem 
with building the demos that come with Pyrex 0.9.6.4. I'm on Ubuntu 7.10 
with Python 2.5, and I get the following output from the terminal for 
trying to build the demos:

:~/Files/Pyrex/Demos$ sudo python Setup.py build_ext --inplace

running build_ext
building 'primes' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall 
-Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c primes.c -o 
build/temp.linux-i686-2.5/primes.o
primes.c:4:20: error: Python.h: No such file or directory
primes.c:5:26: error: structmember.h: No such file or directory
primes.c:29:18: error: math.h: No such file or directory
primes.c:32: error: expected specifier-qualifier-list before ‘PyObject’
primes.c:33: error: expected specifier-qualifier-list before ‘PyObject’
primes.c:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘*’ token
primes.c:36: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘*’ token
primes.c:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘*’ token
primes.c:53: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘*’ token
primes.c:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘*’ token
primes.c:155: error: ‘__pyx_n_append’ undeclared here (not in a function)
primes.c:155: warning: excess elements in struct initializer
primes.c:155: warning: (near initialization for ‘__pyx_intern_tab[0]’)
primes.c:155: warning: excess elements in struct initializer
primes.c:155: warning: (near initialization for ‘__pyx_intern_tab[0]’)
primes.c:156: warning: excess elements in struct initializer
primes.c:156: warning: (near initialization for ‘__pyx_intern_tab[1]’)
primes.c:156: warning: excess elements in struct initializer
primes.c:156: warning: (near initialization for ‘__pyx_intern_tab[1]’)
primes.c:159: error: array type has incomplete element type
primes.c:160: error: ‘PyCFunction’ undeclared here (not in a function)
primes.c:160: error: expected ‘}’ before ‘__pyx_f_6primes_primes’
primes.c:166: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘initprimes’
primes.c:167: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ 
before ‘initprimes’
primes.c: In function ‘__Pyx_InternStrings’:
primes.c:192: error: ‘__Pyx_InternTabEntry’ has no member named ‘p’
primes.c:193: error: ‘__Pyx_InternTabEntry’ has no member named ‘p’
primes.c:193: warning: implicit declaration of function 
‘PyString_InternFromString’
primes.c:193: error: ‘__Pyx_InternTabEntry’ has no member named ‘s’
primes.c:194: error: ‘__Pyx_InternTabEntry’ has no member named ‘p’
primes.c:201:21: error: compile.h: No such file or directory
primes.c:202:25: error: frameobject.h: No such file or directory
primes.c:203:23: error: traceback.h: No such file or directory
primes.c: In function ‘__Pyx_AddTraceback’:
primes.c:206: error: ‘PyObject’ undeclared (first use in this function)
primes.c:206: error: (Each undeclared identifier is reported only once
primes.c:206: error: for each function it appears in.)
primes.c:206: error: ‘py_srcfile’ undeclared (first use in this function)
primes.c:207: error: ‘py_funcname’ undeclared (first use in this function)
primes.c:208: error: ‘py_globals’ undeclared (first use in this function)
primes.c:209: error: ‘empty_tuple’ undeclared (first use in this function)
primes.c:210: error: ‘empty_string’ undeclared (first use in this function)
primes.c:211: error: ‘PyCodeObject’ undeclared (first use in this function)
primes.c:211: error: ‘py_code’ undeclared (first use in this function)
primes.c:212: error: ‘PyFrameObject’ undeclared (first use in this function)
primes.c:212: error: ‘py_frame’ undeclared (first use in this function)
primes.c:214: warning: implicit declaration of function 
‘PyString_FromString’
primes.c:218: warning: implicit declaration of function ‘PyModule_GetDict’
primes.c:218: error: ‘__pyx_m’ undeclared (first use in this function)
primes.c:220: warning: implicit declaration of function ‘PyTuple_New’
primes.c:224: warning: implicit declaration of function ‘PyCode_New’
primes.c:241: warning: implicit declaration of function ‘PyFrame_New’
primes.c:242: warning: implicit declaration of function ‘PyThreadState_Get’
primes.c:249: warning: implicit declaration of function ‘PyTraceBack_Here’
primes.c:251: warning: implicit declaration of function ‘Py_XDECREF’
error: command 'gcc' failed with exit status 1


I think I got a similar output with the gcc build method:
"|bash$ gcc -c -fPIC -I/ /usr/include/python2.5// mymodule.c"

I used "python setup.py install" to install Pyrex, and commands like 
"pyrexc filename.pyx" seem to work correctly.



More information about the Pyrex mailing list