Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-07

Re: Translating scientific libraries

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Agustin Barto: I'd like to use some scientific/math librearies like LAPACK and GNU/GSL with fpc. I…
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.

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.

C Western
to Michael Van Canneyt: Yes, it should work. of headers. If you need help with translating, I'm quite willing to…
Michael Van Canneyt wrote 14 lines
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