[Lazarus] Converting Fortran to FPC?

waldo kitty wkitty42 at windstream.net
Thu Oct 7 02:35:03 CEST 2010


On 10/6/2010 17:34, Bo Berglund wrote:
> I have a question that might be OT here, but I will try nevertheless:

i don't see anything OT about it but then again, i'm just a lowly user like you :P

> We have a Windows application written in Delphi for data analysis and
> display.
> It uses GLScene as the data rendering engine and it uses 3 Fortran
> DLL:s to do the number crunching.

ok...

> I want to port the whole thing to Lazarus/FPC and I have seen that
> GLScene is available for Lazarus (see separate thread).
> So far it looks promising, but I also need to handle the three Fortran
> DLL:s.

ok... so... if the routines and actual work are known and understood, they 
should be easy enough to convert rather than attempting to maintain old 
unsupported code...

in reality, you're only possibly looking at converting the FORTRAN code to 
PASCAL code... it is doubtful that you'll need any object type stuff if it is 
just straight forward "old style" procedural code...

> They were made using an Intel Fortran compiler plugged into Visual
> Studio several years back. The developer is no longer with us, but the
> sources (and the Windows compiler are).

that's at least one GoodThing<tm> ;)

> So my question now is if there is any experience of either porting
> Fortran code to FPC or of compiling Fortran code for a Windows DLL
> into the corresponding function in Linux?

not sure about this but if the code is there and someone can understand it, it 
certainly should be easy enough to re-write it in PASCAL... or C or C++ or php 
or <insert your favorite modern language here> ;)

> (By te way, is there such a thing as a DLL in Linux?)

i can definitely answer this last question! :lol;

yes... there certainly is... they are the libraries... in many cases they are 
named like foo.so or foo.1.2.3.4.so...

FWIW: there is probably a FORTRAN compiler for *nix... whether or not it can 
take your existing FORTRAN code and compile it to a library for *nix is another 
question... and, as noted above, there may not be any real need to keep those 
routines in FORTRAN... it may be pretty easy to convert them to PASCAL (or any 
other of today's languages)... it really depends on the code and, in the case of 
math functions, the precision needed...

HTH in some small way...




More information about the Lazarus mailing list