[cffi-devel] Linking to fortran

Mirko Vukovic mirko.vukovic at gmail.com
Wed Sep 2 17:16:51 UTC 2009


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 at gmail.com>wrote:

> On Tue, Sep 1, 2009 at 14:28, Mirko Vukovic<mirko.vukovic at 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 at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20090902/ca894d30/attachment.html>


More information about the cffi-devel mailing list