cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | the secret reason for us trying to get PyPy users: to test the JIT well enough that we're somewhat confident about it
andirc508923 has quit [Read error: Connection reset by peer]
dddddd has joined #pypy
johncc3 has joined #pypy
johncc3 has quit [Client Quit]
johncc3 has joined #pypy
<johncc3>
Hi all. I'm doing first steps using cffi... I'm trying to wrap a library, and, in 'cffi.cdef' included definitions of some of the functions of the library. In the verify step, I included the name of the header file.
<johncc3>
On running, it reports that the function names are not declared, even though I notice that the #include of the library is actually in the generated .c file.
<johncc3>
Can anyone indicate what could be wrong? Or point me to a real-world example?
tx9 has joined #pypy
altendky has quit [Quit: Connection closed for inactivity]
tx9 has quit [Read error: Connection reset by peer]
forgottenone has joined #pypy
brand09 has joined #pypy
brand09 has quit [Remote host closed the connection]
<johncc3>
The question remains: How do I instruct CFFI to link with -lcomedi?
<arigato>
johncc3: as I said above, please try not to use ffi.verify(). it's a long-deprecated, almost undocumented way to use cffi
<johncc3>
arigato, yes, In understood that. But I find the examples somewhat confusing (maybe it's the formatting). There are examples of ABI in-line and out-of-line, but for API I found only find out-of-line
<arigato>
right. see the last paragraph of that page. you're supposed to use the out-of-line mode, because it avoids various troubles with anything but the simplest examples
<mattip>
what happens if you change lines 47-49 to become "ffi.set_source(text-of-comedi.h, libraries=["/usr/lib/libcomedi.so"])"
<mattip>
"ffi.compile(verbose=True)"
<mattip>
?
<johncc3>
Ok...
<johncc3>
NameError: name 'text' is not defined
forgottenone has quit [Ping timeout: 272 seconds]
<johncc3>
Isn't that the text included in the cdef above
Harzilein has joined #pypy
<johncc3>
mattis, after I moved the cdef text into the set_source, and a couple of minor changes, I have the .so generated.
Harzilein has quit [Remote host closed the connection]
<johncc3>
How do I get cffi to generate x86_64 code?
kenaan has joined #pypy
<kenaan>
arigo cffi/cffi 549cf1a22e97 /doc/source/overview.rst: Refactor again overview.rst, including all cases in the order that seems to make the most sense to me
<arigato>
johncc3: sorry, I don't understand the question. cffi generates C code, and then calls the compiler
<arigato>
maybe you want to give additional flags to the compiler, or call the compiler yourself?
<johncc3>
arigato, Just me being stupid. I'm doing all this remotely, and didn't remember that the remote machine is an i386 ;-)
<johncc3>
Seems everything compiles well. Will make a small test program to see if I can import the result.