Tapan Naskar wrote:

Dear All
Is is there any software which take Fortan code as
input and gives C or C++ versoin of THAT code as
output.

Regards
Tapan


A well known program to do this is f2c, available at
http://www.llnl.gov/casc/Overture/henshaw/software/f2c.tar.gz
and possibly other sites.

The tar.gz file is 415 KB. In the days before g77 was available, the
standard way of compiling FORTRAN programs in C was to translate the
source into C and then compile that with gcc. In those (good old!
needlass to say) days, f2c came standard with all Linux distributions.
Alas! not any more.

A caveat about using f2c for translation: don't expect to get very
neat-looking or readable code. As I said, the chief purpose of f2c was
to act as a front end to gcc, and many calls to the f2c library appear
in the translation. In particular, FORTRAN I/O statements don't
translate into the kind of C i/o statements we expect, but appears in a
form expected by the f2c library. So, after f2c is done, some amount of
manual cleaning-up is needed. But its manageable work, I've done it with
a few (small) programs.

- Manas Laha



*****************************************
This Mail is Certified to be Virus Free.
CIC Network Security Group, IIT Kharagpur
*****************************************

--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/node.php?id=3

Reply via email to