Translating scientific libraries

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Translating scientific libraries

Agustin Barto
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.

I'm porting my graduate thesis project to fpc. It was developed
entirely on Delphi 7, but fpc compiles it with just a few warnings.
Awesome.

This program uses my own algebraic library based on the Jedi_Math work
(which was too slow for my purposes) and I want to replace it with
something faster.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Translating scientific libraries

Michael Van Canneyt


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.

>From what I remember (c)LAPACK is quite a simple library in terms
of headers.  If you need help with translating, I'm quite willing
to help, and I'd definitely consider distributing the translated
headers with FPC.

I don't know about GSL, so I can't help you there.

> I'm porting my graduate thesis project to fpc. It was developed
> entirely on Delphi 7, but fpc compiles it with just a few warnings.
> Awesome.

We like to think so too ;-)

>
> This program uses my own algebraic library based on the Jedi_Math work
> (which was too slow for my purposes) and I want to replace it with
> something faster.

If you need help, let me know.

Michael.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Translating scientific libraries

C Western
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



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal