Questions tagged [cffi]

CFFI, the Common Foreign Function Interface, for Common Lisp. For Python CFFI, see the [python-cffi] tag.

CFFI, the Common Foreign Function Interface, purports to be a portable foreign function interface for Common Lisp.

Check out Homepage

142 questions
4
votes
1 answer

Error version of cffi python package mismatch

I'm trying to install a python software (https://github.com/GuLinux/AstroPhoto-Plus) but in logs, i've got this error during execution just after installation: Exception: Version mismatch: this is the 'cffi' package version 1.14.6, located in…
Astro-Otter
  • 736
  • 1
  • 10
  • 22
4
votes
1 answer

Python CFFI: Build single module from multiple source files

My aim is to build a single module/extension from multiple C source files. What is the best practice to achieve this? What I tried: I know that theffi.set_source function has the optional sources and include_dir kwargs and that there should be a…
felixinho
  • 625
  • 7
  • 17
4
votes
2 answers

How to resolve Cairo and Pango version problems following pip WeasyPrint installation?

I want to run some Python code from the WeasyPrint library on a server running Debian GNU/Linux 8. The code actually appears to be working, except WeasyPrint gives a warning every time the code is…
Nelson Frew
  • 107
  • 1
  • 9
4
votes
0 answers

How to interact with cffi void pointers inside numba

I have a C library, which gets interfaced with CFFI as with the following definitions: import cffi ffi = cffi.FFI() ffi.cdef(""" typedef struct zkdtree zkdtree; typedef struct zkdtree_result zkdtree_result; zkdtree * zkdtree_load(const char *…
Zah
  • 6,394
  • 1
  • 22
  • 34
4
votes
1 answer

SWIG [C++ to Lisp(CFFI)] error when compiling wrapper

I'm a beginner with interface between C++ and Lisp with SWIG. I've follow the SWIG's documentation but I'm facing a problem. Here is the simple program I want to interface (It can easily be done in Lisp but it is to understand how to import C++ code…
4
votes
1 answer

CFFI Not Loading Dependent Libraries?

I am trying to use the BLAS/LAPACK libraries from SBCL (specifically trying to get the LLA package running). I was having a lot of troubles getting the BLAS shared library to load; eventually I discovered that it wasn't able to load its dependent…
Dr. Pain
  • 689
  • 1
  • 7
  • 16
4
votes
1 answer

How to set C compiler in defsystem?

I'm trying to loads cl-mpi system with quicklisp. This is the system definition: (asdf:defsystem cl-mpi :description "Common Lisp bindings for the Message Passing Interface (MPI)" :author "Alex Fukunaga" :version "0.1.0" :license…
user797257
3
votes
1 answer

Distributing a CFFI wrapper for a custom C lib

I've built a library that wraps custom C code and thinking about the best way to build the shared library as part of the ASDF load. The makefile is conditionalised for various OSs, so it could be as simple as uiop:run-program ..., but I thought I'd…
CL-USER
  • 715
  • 3
  • 9
3
votes
1 answer

How to use DEFCFUN with a pointer to a foreign C function?

I am using CFFI to interact with a library that uses GLib. The g_list_free_full() function in GLib has the signature: void g_list_free_full (GList *list, GDestroyNotify free_func); I will need to call this function from Lisp…
shadowtalker
  • 12,529
  • 3
  • 53
  • 96
3
votes
1 answer

Building Python-C Extension using CFFI, but Setuptools does not include custom header files in build

I'm trying to use the CFFI package in Python to create a Python interface for already existing C-code. I am able to compile a C library by following this blog post. Now I want to make it so that this python library is available without any fancy…
rafferino
  • 31
  • 1
3
votes
1 answer

cffi: How do i send the address of a character of a string to a C function?

i am actually writing a python program with cffi module to test my C/ASM library, and i managed to make it work. But i don't know how to access the address of a character in the middle of a string to pass it to my lib function. For exemple: def…
Stephane
  • 153
  • 1
  • 10
3
votes
1 answer

Text Zooming Effect Trembling

I created a text zooming animation with MoviePy and Gizeh. However the results turned out different when the code is run on different OS. The following two gifs are generated by the same python code. The effect looks pretty good on MacOS, but poor…
陈羽飞
  • 61
  • 5
3
votes
0 answers

Overriding Conda Package Installation with Pip

I'm trying to build the necessary dependencies to run some deep learning code and am running into issues with the c foreign function interface (cffi) installation. I need conda's accelerate package, however the package is built on top of an old…
3
votes
0 answers

Strange CFFI callback error with SBCL

I have this Common Lisp code which is a CFFI binding to PortAudio : https://github.com/thodg/cffi-portaudio First time I build with ASDF it gives no warning, but if I try to reload the system it tells me about these : STYLE-WARNING: Undefined alien:…
thodg
  • 1,773
  • 15
  • 24
3
votes
1 answer

Canonical way to free string passed back from a c function in cffi?

ffi = FFI() C = ffi.dlopen("mycffi.so") ffi.cdef(""" char* foo(T *t); void free_string(char *s); """) def get_foo(x): cdata = C.foo(x) s = ffi.string(cdata) ret = s[:] C.free_string(cdata) return ret If I pass a char * from c…
colinfang
  • 20,909
  • 19
  • 90
  • 173
1
2
3
9 10