jayhawk@cbnewsh.ATT.COM (R.Moats) (12/05/89)
I am posting this request for a friend who has not caught up with where news access is now located. Anyway, I digress... Is there, was there, will there be a tool to convert fortran code to C code. We are talking here mainly F66 or F77, but he will take anything. The tool needs to operate under either MSDOS or UNIX (preferrably Sys V but again, he's flexible [read desperate ... ;-)]) Price: "...the cheaper the better, free is the best". Anyway, help would be greatly appreciated. I don't read these newsgroup regularly (like once every decade), so please email to me at either ...!att!cygni!jayhawk or rdmi@homxb.att.com Thanks, Ryan Moats AT&T Bell Laboratories Holmdel, NJ
keffer@blake.acs.washington.edu (Thomas Keffer) (12/05/89)
In article <6258@cbnewsh.ATT.COM> jayhawk@cbnewsh.ATT.COM (R.Moats) writes: > >I am posting this request for a friend who has not caught up >with where news access is now located. Anyway, I digress... > >Is there, was there, will there be a tool to convert fortran >code to C code. We are talking here mainly F66 or F77, but he >will take anything. The tool needs to operate under either >MSDOS or UNIX (preferrably Sys V but again, he's flexible [read >desperate ... ;-)]) > >Price: "...the cheaper the better, free is the best". We bought a $40 cheapie from Austin CodeWorks. Don't bother. It's worth about what paid: not much (this is no reflection on ACW, which generally supplies Good Stuff). It can handle the most simple stuff, but something as straightforward as an indexed array caused it to freeze up. A more expensive alternative is offered by Cobalt Blue ("For_C"). About $700. (408) 723-0474. Tom Keffer Rogue Wave P.O. Box 85341 Seattle, WA 98145-1341 (206) 523-5831 keffer@ocean.washington.edu
andrew@alice.UUCP (Andrew Hume) (12/07/89)
there is a good f77 -> c conversion facility available. i am not sure of the details; i believe you mail source to a magic mailbox and back comes c source. ask dmg@research.att.com for details. (or uunet!research!dmg)
DVL@PSUVM.BITNET (Roger Christman) (12/08/89)
My Masters thesis here at Penn State U is to write a Fortran/C translator. I'm doing it mostly off the top of my head. It is a bit more complex (and therefore better) than simple line-by-line translation. It is designed to accept any Fortran 66 program and translate it into an equivalent C source. Program flow structure is analyzed so that even the messiest GOTO arrangements should find themselves better approximating such things as loops and switches. The program is not yet completed -- I am in the middle of handling subroutine parameters. It will determine which parameters are more appropriate as call by value, instead of Fortran's default to call by reference. The upshot of all this is that the resulting program will be more intuitively structured, as well as more efficient than the original. As an example of current benchmarks, using the F77 and CC compilers on a Sun Workstation Unix machine, my program is doing quite well. The time required to translate into C and compile there is less than the original Fortran compilation time. Also, the object code in C executes faster than the original Fortran. If you would like to find out more later on, when I approach the end of the project, please send me mail at this address. I must warn you that this project is for academic reasons alone, and is not designed with production-scale error-checking. If your program will not compile in Fortran 66, don't expect this translator to give you very meaningful results. To quote from my finger plan: Plan: Make sense of the most inscrutable Fortran code. To translate such code into a C source which will ru ^^}}---^^^^ggggggggg````` Segmentation fault (core dumped) Roger Christman No Sig