Xref: utzoo comp.lang.fortran:2338 comp.sources.wanted:8401 misc.wanted:5826 comp.lang.c:20542 Path: utzoo!censor!geac!jtsv16!uunet!tut.cis.ohio-state.edu!ucbvax!ucsfcgl!seibel From: seibel@cgl.ucsf.edu (George Seibel) Newsgroups: comp.lang.fortran,comp.sources.wanted,misc.wanted,comp.lang.c Subject: Re: Fortran to C translation Keywords: Fortran C translation Message-ID: <11742@cgl.ucsf.EDU> Date: 10 Aug 89 01:36:19 GMT References: <7990@spool.cs.wisc.edu> <108783@felix.UUCP> Reply-To: seibel@cgl.ucsf.edu (George Seibel) Distribution: usa Organization: Computer Graphics Lab, UCSF Lines: 23 In article <108783@felix.UUCP> art@felix.UUCP (Art Dederick) writes: >In article <7990@spool.cs.wisc.edu> g-wardal@rocky.CS.WISC.EDU (John F. Wardale) writes: >>We need to translate some Fortran programs into C. > >It seems this request is becomming more frequent so I will give my >$.02 on the subject. > >On most BSD systems there is a program called "struct" that takes >Fortran source and converts it to RATFOR source. I have found this to >be a good start on converting Fortran to C since RATFOR is like C in >many ways, at least enough to cut down on the manual manipulations >that make this conversion possible. I've attempted to use struct on several occasions, and was not very happy with the results. First of all, the 4BSD version of struct expects FORTRAN IV (or maybe f66?) as input. A number of f77 constructs will choke it. Struct is very ambitious in its attempts to untangle spaghetti, and seems to get in over its head quite frequently. In other words, the output code was wrong too often for my taste. If you have code that is pretty clean and simple to begin with, it might be ok. George Seibel, UCSF