cffi

Common Lisp CFFI: pointer to the pointer

情到浓时终转凉″ 提交于 2019-12-10 14:24:39
问题 I am trying to write the CFFI wrapper for Sundials CVODE library. SWIG was choking on Sundials headers since they are quite interconnected and SWIG couldn't find the right headers, so I did it by hand: a bit laborious but I've managed. Now I'm trying to test if it works correctly. For now, just simply creating the "problem object" and deleting it. That is where the problem starts. So, the "problem object" is allocated via function SUNDIALS_EXPORT void *CVodeCreate(int lmm, int iter); For

Passing structs by value with cffi-libffi?

可紊 提交于 2019-12-10 09:26:29
问题 I'm under the impression that CFFI cant pass structs by value, but the CFFI documentation says: To pass or return a structure by value to a function, load the cffi-libffi system and specify the structure as (:struct structure-name) . To pass or return the pointer, you can use either :pointer or (:pointer (:struct structure-name)) . I'm re-wrapping the cl-opencv function get-size , which is a wrapper for this opencv function: CvSize cvGetSize(const CvArr* arr) and since I don't think CFFI had

Common Lisp 操作Mysql

末鹿安然 提交于 2019-12-05 21:06:02
Common Lisp 通过CFFI可以调用其它语言的接口,如此,Common Lisp可以快速开发各种应用程序,本文将讲述在ubuntu系统下的一个简单的Common Lisp与mysql交互的实例。 准备 安装CFFI sudo apt-get install cl-cffi 安装CL-MYSQL sudo apt-get install cl-sql-mysql 安装MYSQL sudo apt-get install mysql-server 安装quicklisp wget http://beta.quicklisp.org/quicklisp.lisp 开始 启动slime或sbcl(本例使用slime). 进入slime: M+x slime slime下加载quicklisp: CL-USER> (load "quicklisp.lisp") CL-USER> (quicklisp-quickstart:install) CL-USER> (ql:add-to-init-file) 加载cffi和cl-mysql: CL-USER> (ql:quickload "cffi") CL-USER> (ql:quickload "cl-mysl") 定义试验用的mysql操作包: (defpackage :com.casic.mysql-oper (:use

CFFI Not Loading Dependent Libraries?

依然范特西╮ 提交于 2019-12-05 19:50:28
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 libraries. Eventually I was able to load BLAS by loaded all of its dependencies manually: (setq cffi::*foreign-library-directories* '("C:/cygwin64/bin/" "C:/cygwin64/lib/lapack/")) (CFFI:LOAD-FOREIGN-LIBRARY "CYGWIN1.DLL") (CFFI:LOAD-FOREIGN-LIBRARY "CYGGCCC_S-SEH-1.DLL") [..etc..] (CFFI:LOAD-FOREIGN-LIBRARY "CYGBLAS-0.dll") As a workaround this isn't

Passing structs by value with cffi-libffi?

强颜欢笑 提交于 2019-12-05 19:34:39
I'm under the impression that CFFI cant pass structs by value, but the CFFI documentation says: To pass or return a structure by value to a function, load the cffi-libffi system and specify the structure as (:struct structure-name) . To pass or return the pointer, you can use either :pointer or (:pointer (:struct structure-name)) . I'm re-wrapping the cl-opencv function get-size , which is a wrapper for this opencv function: CvSize cvGetSize(const CvArr* arr) and since I don't think CFFI had the ability to pass structs by value with the cffi-libffi system when the author of cl-opencv wrote the