views:

987

answers:

1

A friend of mine asked me if it would be possible to port the Octave project to the iPhone. I haven't compiled an external package for an iPhone project before, so I downloaded the source code, and then used some scripts found on a couple of different Web sites (one, two) to try and build the libraries. However, when I try either of these scripts (which are nearly identical), they eventually die during the configure phase with the following error output:

[...snip checks...]
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking how to get verbose linking output from ... configure: WARNING: compilation failed

checking for Fortran 77 libraries of ... rm: conftest.dSYM: is a directory

checking for dummy main to link with Fortran 77 libraries... rm: conftest.dSYM: is a directory
none
checking for Fortran 77 name-mangling scheme... configure: error: cannot compile a simple Fortran program
See `config.log' for more details.

Is the problem that the iPhone SDK/Xcode doesn't include a Fortran cross-compiler, or am I doing something wrong?

A: 

The iPhone SDK does not include a FORTRAN compiler. Apple's last FORTRAN product was for the Apple ][, although 3rd party and/or open source compilers have existed for most systems Apple has built.

You could configure and build gfortran, but it's going to be a PITA. You'll likely need to merge in changes from Apple's customized GCC 4.2 fork found under iPhone here with a recipe for building it for Darwin, such as this.

You might try f2c as the Octave project suggests.

ohmantics
Have you done this yourself? Just wondering if there are any specific steps/instructions/traps I should be aware of concerning f2c. I'll be giving it a try tomorrow morning.
Shaggy Frog
I know FORTRAN users exist, but for me, it's just another level in the "Tron" arcade game.
ohmantics
Did you get this working?
codecowboy