By pointer - off course.
That led me into the minefield of setting up pointers, which I avoided by looking by the cl-blapack library since it has a set-up to define fortran types and necessary pointers on top of cffi.
I managed to compile blapack and foreign-numeric-vector libraries (I had to ignore some things, and delete others, but I will report that on the lisp-matrix group where that library was discussed).
I then adapted some of the calls in blapack for my library (amos library on netlib.org for calculating bessel functions of complex arguments), and initial tests are passing.
Thanks for the cffi library :-)
Mirko
On Wed, Sep 2, 2009 at 12:40 AM, Mark Hoemmen mark.hoemmen@gmail.comwrote:
On Tue, Sep 1, 2009 at 14:28, Mirko Vukovicmirko.vukovic@gmail.com wrote:
;; I got the trailing underscore by using `nm' on the library. (defcfun "test_link_" test-link (a :float)) ; (b :float) (i :int))
Fortran passes by pointer ("by reference" is the proper way to call it, unless you're a C programmer) unless the Fortran subroutine / function specifically tags the variable as a "value" type. You're not, so a, b, and i should all be pointers in the above defcfun.
mfh
cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel