Skip to content

Instantly share code, notes, and snippets.

@zarch
Created April 8, 2013 11:06
Show Gist options
  • Save zarch/5335968 to your computer and use it in GitHub Desktop.
Save zarch/5335968 to your computer and use it in GitHub Desktop.
Error compiling with Cython.
$ python2 setup.py build_ext -i
running build_ext
cythoning raster.pyx to raster.c
Error compiling Cython file:
------------------------------------------------------------
...
ctypedef stat STRUCT_STAT
cdef struct DateTime:
int mode
int from
^
------------------------------------------------------------
crast.pxd:415:12: Empty declarator
Error compiling Cython file:
------------------------------------------------------------
...
ctypedef stat STRUCT_STAT
cdef struct DateTime:
int mode
int from
^
------------------------------------------------------------
crast.pxd:415:12: Syntax error in C variable declaration
Error compiling Cython file:
------------------------------------------------------------
...
python2 setup.py build_ext -i
"""
cimport crast
cdef char *gtype2mtype(crast.RASTER_MAP_TYPE gtype):
^
------------------------------------------------------------
raster.pyx:9:23: 'RASTER_MAP_TYPE' is not a type identifier
Error compiling Cython file:
------------------------------------------------------------
...
return 'DCELL'
else:
print 'Error: gtype not valid.'
return ''
cdef crast.RASTER_MAP_TYPE mtype2gtype(char *mtype):
^
------------------------------------------------------------
raster.pyx:31:5: 'RASTER_MAP_TYPE' is not a type identifier
building 'raster' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC -I/home/pietro/docdat/src/gis/grass/grass_trunk/dist.x86_64-unknown-linux-gnu/include -I/usr/include/python2.7 -c raster.c -o build/temp.linux-x86_64-2.7/raster.o
raster.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^
error: command 'gcc' failed with exit status 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment