[cffi-devel] CFFI and FORTRAN CHARACTER*(*)

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sat Jun 5 14:12:58 UTC 2010


CHARACTERs in Fortran are just pointers of type char*, just like in C, and
just like any other fortran array. There is no terminating null and the
fortran functions get the length either from some argument or because they
assume a given size (for instance in Lapack it is a one-character string
what the function expects)

On Sat, Jun 5, 2010 at 12:45 PM, Tamas K Papp <tkpapp at gmail.com> wrote:

> Hi,
>
> I am trying to call the FORTRAN routine ILAENV in LAPACK [1] from CL,
> using CFFI.  It has CHARACTER*(*) arguments, and I am not sure how to
> handle these.  I found a lot of conflicting information on the web,
> including examples which used C-style zero-terminated strings [2], and
> others which mention string length as an extra argument to the
> function.
>
> Any kind of guidance on how to do this would be appreciated.
>
> Thanks,
>
> Tamas
>
> [1] http://www.netlib.org/lapack/util/ilaenv.f
> [2] http://www.ualberta.ca/AICT/RESEARCH/LinuxClusters/doc/acml350/
> ILAENV_002dILAENVSET.html
>
>
> _______________________________________________
> cffi-devel mailing list
> cffi-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
>



-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://tream.dreamhosters.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20100605/e619054c/attachment.html>


More information about the cffi-devel mailing list