wwaites / py4s Goto Github PK
View Code? Open in Web Editor NEWPython bindings via C for 4store
Home Page: http://pypi.python.org/pypi/py4s
License: GNU General Public License v3.0
Python bindings via C for 4store
Home Page: http://pypi.python.org/pypi/py4s
License: GNU General Public License v3.0
Hi, I have some problems in building py4s on Ubuntu Lucid Lynx LTS.
This is what I've done:
The building process fails and return this error:
cythoning _py4s.pyx to _py4s.c Error converting Pyrex file to C: ------------------------------------------------------------ ... cdef class _Cursor: cdef py4s.fsp_link *_link cdef py4s.fs_query_state *_qs cdef py4s.fs_query *_qr cdef char *_query cdef bool _transaction ^ ------------------------------------------------------------ 'bool' is not a type identifier
Could you help me out?
No funciona la última versión
Here is what I get when trying to compile py4s :
cgueret@eculture2:~/software/py4s$ python setup.py build
running build
running build_py
running build_ext
cythoning _py4s.pyx to _py4s.c
...
fs_row *fs_query_fetch_header_row(fs_query *q)
fs_row *fs_query_fetch_row(fs_query *q)
cdef extern from "frontend/import.h":
int fs_import_stream_start(fsp_link *link, char *model_uri, char *mimetype, int has_o_index, int *count)
int fs_import_stream_data(fsp_link *link, unsigned char *data, size_t count)
/home/cgueret/software/py4s/_py4s.pxd:113:71: Expected ')'
...
cdef class _Cursor:
cdef py4s.fsp_link *_link
cdef py4s.fs_query_state *_qs
cdef py4s.fs_query *_qr
cdef char *_query
cdef bool _transaction
/home/cgueret/software/py4s/_py4s.pyx:72:11: Syntax error in C variable declaration
building '_py4s' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_LAQRS=1 -DHAVE_RASQAL_WORLD=1 -DUSE_AVAHI=1 -Isrc -I/home/cgueret/local/include/glib-2.0 -I/home/cgueret/local/lib/glib-2.0/include -I/home/cgueret/local/include -I/home/cgueret/local/include/rasqal -I/usr/include/python2.5 -c _py4s.c -o build/temp.linux-x86_64-2.5/_py4s.o -std=gnu99
gcc: _py4s.c: No such file or directory
gcc: no input files
error: command 'gcc' failed with exit status 1
running build
running build_py
running build_ext
cythoning _py4s.pyx to _py4s.c
...
cdef class _Cursor:
cdef py4s.fsp_link *_link
cdef py4s.fs_query_state *_qs
cdef py4s.fs_query *_qr
cdef char *_query
cdef bool _transaction
_py4s.pyx:107:9: 'bool' is not a type identifier
building '_py4s' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LAQRS=1 -DHAVE_RASQAL_WORLD=1 -Isrc -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/rasqal -I/usr/local/include/raptor2 -I/usr/local/include/python2.7 -c _py4s.c -o build/temp.linux-ia64-2.7/_py4s.o -std=gnu99
_py4s.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
Need adding a line "from cpython cimport bool" in _py4s.pyx.
See http://wiki.cython.org/FAQ#HowdoIdeclareanobjectoftypebool.3F
First had size_t issue mentioned here: http://www.rufuspollock.org/2010/02/08/howto-install-4store/
But then had:
running build
running build_py
running build_ext
cythoning _py4s.pyx to _py4s.c
...
RASQAL_LITERAL_UDT,
)
cdef _rnode(dict bindings, fs_row *row, rasqal_literal *l):
if l.type == RASQAL_LITERAL_URI:
return URIRef(py4s.raptor_uri_as_string(l.value.uri))
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/rnode.pyx:16:41: Cannot convert 'unsigned char *' to Python object
...
cdef _rnode(dict bindings, fs_row *row, rasqal_literal *l):
if l.type == RASQAL_LITERAL_URI:
return URIRef(py4s.raptor_uri_as_string(l.value.uri))
if l.type == RASQAL_LITERAL_VARIABLE:
return _node(row[bindings[l.value.variable.name]])
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/rnode.pyx:18:44: Cannot convert 'unsigned char *' to Python object
...
if l.type in LITERALS:
kw = {}
if l.language:
kw["lang"] = l.language.lower()
if l.datatype:
kw["datatype"] = URIRef(py4s.raptor_uri_as_string(l.datatype))
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/rnode.pyx:24:52: Cannot convert 'unsigned char *' to Python object
...
if l.type in (RASQAL_LITERAL_INTEGER, RASQAL_LITERAL_BOOLEAN):
val = l.value.integer
elif l.type == (RASQAL_LITERAL_FLOAT, RASQAL_LITERAL_DOUBLE):
val = l.value.floating
else:
val = l.string
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/rnode.pyx:30:10: Cannot convert 'unsigned char *' to Python object
...
val = l.value.floating
else:
val = l.string
return Literal(val, **kw)
if l.type == RASQAL_LITERAL_BLANK:
return BNode(l.string) # ???
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/rnode.pyx:33:16: Cannot convert 'unsigned char *' to Python object
...
# silly hoop for unicode data
py_uquery = query.encode("utf-8")
self._query = py_uquery
cdef py4s.raptor_uri *bu = py4s.raptor_new_uri(context)
^
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/_py4s.pyx:110:56: Cannot convert Python object to 'unsigned char *'
...
self.transaction(context)
transaction = True
else:
transaction = False
data = (n + u" .").encode("utf-8")
udata = data
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/_py4s.pyx:154:15: Cannot convert Python object to 'unsigned char *'
...
transaction = True
else:
transaction = False
data = (n + u" .").encode("utf-8")
udata = data
py4s.fs_import_stream_data(self._link, udata, len(udata))
/home/rgrp/hgroot/pyenv-openbiblio/src/py4s/_py4s.pyx:155:58: Cannot convert 'unsigned char *' to Python object
Error converting Pyrex file to C:
building '_py4s' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_LAQRS=1 -DHAVE_RASQAL_WORLD=1 -Isrc -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/rasqal -I/usr/include/python2.6 -c _py4s.c -o build/temp.linux-i686-2.6/_py4s.o -std=gnu99
_py4s.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
It seems like some of the includes have been renamed (4s-datatypes.h, 4s-hash.h) and a couple of method signatures changed.
running build
running build_py
running build_ext
building '_py4s' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_LAQRS=1 -DHAVE_RASQAL_WORLD=1 -DUSE_AVAHI=1 -Isrc -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/rasqal -I/usr/include/raptor2 -I/usr/include/python2.6 -c _py4s.c -o build/temp.linux-i686-2.6/_py4s.o -std=gnu99
_py4s.c:158:30: error: common/datatypes.h: No such file or directory
_py4s.c:160:25: error: common/hash.h: No such file or directory
In file included from _py4s.c:163:
src/frontend/import.h:19: warning: function declaration isn't a prototype
_py4s.c: In function 'pyx_pf_5_py4s_7_Cursor___cinit':
_py4s.c:2730: error: too few arguments to function 'fs_query_init'
_py4s.c: In function '__pyx_pf_5_py4s_7_Cursor_execute':
_py4s.c:3259: warning: passing argument 1 of 'raptor_new_uri' from incompatible pointer type
/usr/include/raptor2/raptor.h:1148: note: expected 'struct raptor_world *' but argument is of type 'unsigned char *'
_py4s.c:3259: error: too few arguments to function 'raptor_new_uri'
_py4s.c:3268: error: too few arguments to function 'fs_query_execute'
_py4s.c: In function '__pyx_pf_5_py4s_7_Cursor_update':
_py4s.c:4124: warning: passing argument 1 of 'fs_update' from incompatible pointer type
src/frontend/update.h:13: note: expected 'struct fs_query_state *' but argument is of type 'struct fsp_link *'
error: command 'gcc' failed with exit status 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.