[fpc-pascal] Translating scientific libraries

C Western mftq75 at dsl.pipex.com
Thu Jul 21 22:23:56 CEST 2005


Michael Van Canneyt wrote:

>On Thu, 21 Jul 2005, Agustin Barto wrote:
>
>  
>
>>I'd like to use some scientific/math librearies like LAPACK and
>>GNU/GSL with fpc. I already know about h2pas and external subroutines
>>and variables, but I wanted to know if these methods will be able to
>>deal with libraries as complex as LAPACK (clapack obviously) and GSL.
>>    
>>
>
>Yes, it should work. 
>  
>
I have used (parts of) lapack without problems. You just need lots of 
declarations like:

function dsytrd_(var uplo: Char; var n: Integer; var a: Double; var lda: 
Integer; var d__: Double; var e: Double; var tau: Double; var work: 
Double; var lwork: Integer; var info: Integer; uplo_len: Integer): 
Integer; cdecl; external;
(It is possible to generate these semi-automatically with f2c)

and a {$LINKLIB lapack}

It may also be appropriate to override a few support routines, like the 
error reporting routine.

Colin






More information about the fpc-pascal mailing list