2

I have an application written in Fortran 77 and need it to work in iPad.

Is it possible? I prefer not have to rewrite this code in objective C, since there's a lot of complex calculations and I'm afraid I'll have some precision problems. Also, I don't have time to rewrite it.

Marcela Rocha
  • 79
  • 2
  • 12

1 Answers1

2

Use a Fortran to C translater, then you can compile the C code with Xcode for the iPad.

progrmr
  • 75,956
  • 16
  • 112
  • 147
  • How is this not rewriting it? (along with the other reasons he gave) – Rook Aug 07 '11 at 00:51
  • She said she didn't have time to rewrite it, but this is automated rewriting. It may not be ideal solution but it's the only one I know, hopefully others will post other answers. – progrmr Aug 07 '11 at 14:36
  • I don't know whether anything has changed with f2c in the last few years, but during the days the last time we used it, anyone will agree that it is hardly automated rewriting (of course that depends on the meaning of "automated rewriting"). It produced so problematic code in some cases that the general opinion was (at the time) it is usually better to skip it altogether and rewrite it manually. If under "rewriting" you ment "retyping" then yes, it can save some – Rook Aug 07 '11 at 15:19
  • keystrokes, although retyping a program never presented a problem to anyone I knew, if it is straightforward. Problems also occur with different data representations between F and C. – Rook Aug 07 '11 at 15:19
  • What I'm interested most is, why does it *have* to work on IPad? – Rook Aug 07 '11 at 15:21
  • 2
    Unfortunately in order to use f2c in a program you have to link it with the f2c library, which I'm certain is not ported to the ipad. The best you can do is get it more readable and easier to rewrite (not that fortran is unreadable, but if you are like me you've never touched the stuff - even slightly obfuscated c-code is better than fortran code). – crasic Aug 07 '11 at 17:59
  • actually my first programming gig was rewriting fortran from one dialect to another, :-) but I'd rather deal with obfuscated C too. – progrmr Aug 08 '11 at 15:31