Hi,
On 26 November 2014 at 19:37, Israel Brewster <
macav...@gmail.com> wrote:
> 1) Currently, I am manually compiling the C library, and placing it in a
> subfolder of the module.
That might work, but the CFFI installation instructions generally
assume that you're in one of two cases:
- either you are interfacing with a separate library that is installed
normally into the system (not distributed together with CFFI);
- or you are compiling everything with distutils in "ffi.verify()".
So in your case, try to see if it's possible to have the complete C
library compiled together with the rest of the interfacing code in the
call to ffi.verify(). Something like
ffi.verify("#include <stuff.h>", sources=["lib4d_sql/foo.c",
"lib4d_sql/bar.c"])
...which brings me to your second question: the problem with CFFI
recompiling things after installation is because you specify absolute
paths. You must call ffi.verify() with exactly the same arguments all
the time. It's a bit annoying. One way is to give relative paths
like I did above, and make sure you're running with the correct
current working directory *when not installed*. The point is that
after installation, it should not actually need the .c files any more,
because the compiler should (really this time) not be called any more.
> Finally, let me ask you guys this: is distributing this as a CFFI module
> even the right approach? Or should I be looking at something else entirely?
I think it is absolutely the right approach, yes, but in this list
you're likely to get a slightly biased answer :-)
A bientôt,
Armin.