[comp.lang.fortran] FORTRAN -> c

prove@batcomputer.tn.cornell.edu (Roger Ove) (09/21/87)

    I'm looking for a fortran to C translator, and would like to hear
from someone that has used one.  A few of the desired facilities are:
	1) Ability to replace nasty computed goto's, arithmetic goto's,
	   etc into something reasonable.  Some of the source is extremely
	   poorly written, and it would be nice is the translator could
	   at least make a start at untangling it.
	2) Ratfor, f77, and f66 input (some source is old).
	3) Ability to handle source spread out over many files.
	4) Site license available (for a bunch of Suns).

I have some information on C77 (Intrinsic) and fortrix, but the examples
they give are so trivial that its hard to make a judgement.  If there
are any others out there (preferably a little cheaper than $5k) that might
meet some of these requirements, I'd like to hear about them as well.
Please respond to me directly, I'll summarize if anything turns up.

Roger Ove
ove@newton.ncsa.uiuc.edu
14004@ncsavmsa.bitnet

chris@mimsy.UUCP (Chris Torek) (09/22/87)

In article <2413@batcomputer.tn.cornell.edu> prove@batcomputer.tn.cornell.edu
(Roger Ove) writes:
>... A few of the desired facilities are:
>1) Ability to replace nasty computed goto's, arithmetic goto's,
>   etc into something reasonable.  Some of the source is extremely
>   poorly written, and it would be nice is the translator could
>   at least make a start at untangling it.
>2) Ratfor, f77, and f66 input (some source is old).

If you find a translator that can read Ratfor source, you might
try using `struct' to translate the old ugly Fortran code into
Ratfor.  Struct is included with 4BSD; it was written at Bell Labs
by Brenda Baker.  (Where the documentation has gone I cannot guess;
there is a reference to a Bell Labs internal memorandum in the
Ratfor documentation.  Perhaps this was never published elsewhere,
although I find that hard to believe.)  Struct is not perfect---in
particular, the 4BSD version needs a thorough cleaning to make it
type-correct---but it really does improve those old dusty decks.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

carroll@bcsaic.UUCP (Jeff Carroll) (02/13/90)

	Seems like I saw this posted just a few days ago, but it's gone
from our local news directory, so...

	Is there a PD (or cheap) FORTRAN->c translator? Where and how
does one get it?  
  	
	Jeff Carroll
	carroll@atc.boeing.com

mskucherawy@dahlia.waterloo.edu (Murray S. Kucherawy) (02/17/90)

In article <20243@bcsaic.UUCP> carroll@bcsaic.UUCP (Jeff Carroll) writes:
>
>	Seems like I saw this posted just a few days ago, but it's gone
>from our local news directory, so...
>
>	Is there a PD (or cheap) FORTRAN->c translator? Where and how
>does one get it?  
>  	
>	Jeff Carroll
>	carroll@atc.boeing.com

Send the following message to netlib@research.att.com:

	send index from f2c


====================== Murray S. Kucherawy (WATBURR) =======================
E-Mail:    mskucherawy@{ watmath | dahlia | crocus | trillium }.waterloo.edu
Faculty of Mathematics (Comp Sci), University of Waterloo, Waterloo, Ontario
Gamesmaster/Postmaster, UW Computer Science Club (mkuch@watcsc.waterloo.edu)
System Manager, VAX/VMS Network, Board of Education, London, Ontario

CMH117@psuvm.psu.edu (Charles Hannum) (02/22/90)

Okay.  This is a definitive answer (as of posting).

Send the command "help" in a note to netlib@research.att.com.  Among other
things, this has a FORTRAN 77 --> C converter on it.  Saying "send all from
f2c/src" will send you the entire source code for the translator (in about
27 parts, which you'll probably want to piece together with the netchop
program that's sent first.)  You put them together into one big file, sh
it, make it, and if everything goes well, you'll have a program called f2c.

You may also need some special libraries to use program translated with
this.  "send libi77 libf77 from f2c" should get you these.


Virtually,
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117@psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h@psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."