Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compile FORTRAN code for iOS

1,354 views
Skip to first unread message

shat...@gmail.com

unread,
Jun 20, 2014, 11:06:10 PM6/20/14
to
Hello everyone!

I have some Fortran application, and i want to compile it for iOS. I found this post on stackoverflow http://stackoverflow.com/questions/1...t-in-xcode-4-5

And i wanted to try to do the same way. But for now my main problem is create GCC Cross-compiler for ARM (iOS) that supports Fortran. I read a tons of information, but still i cannot understand what i should put in --target parameter, when i configure GCC.

As i understand correctly i need to configure GCC (from gcc.gnu.org) as cross-compiler, with --target=arm-apple-darwin and --enable-languages=c,c++, fortran.

With --target=arm-elf, --target=arm-apple-darwin i got error, that it's not supported.

With --target=arm-none-eabi i got cannot compute suffix of object files: cannot compile Maybe is that because i'm setting wrong configure parameters.

My question is : what is correct ./confgiure parameters to create gcc cross compiler for iOS platform, which supports FORTRAN.

Is this the only (right?) way to build cross-compiler for iOS platform, or i could use existing LLVM-GCC? Thanks!

willia...@gmail.com

unread,
Jun 21, 2014, 12:09:58 AM6/21/14
to
If the application is in fortran-77, you can use f2c http://en.wikipedia.org/wiki/F2c

shat...@gmail.com

unread,
Jun 21, 2014, 12:18:51 AM6/21/14
to
I tried F2c, but it makes very rough code, and i want to stick with static library as desribed in link above

FX

unread,
Jun 21, 2014, 4:53:12 PM6/21/14
to
> And i wanted to try to do the same way. But for now my main problem is
> create GCC Cross-compiler for ARM (iOS) that supports Fortran.

As far as I am aware, this is not simply not possible.

The official GCC (from gcc.gnu.org) does not support iOS. Multiple
projects, over time, have relied on Apple's GCC branch (based on GCC 4.2)
to provide iOS compilers, but they do not support the Fortran front-end
and library (and can be hard to get working, even for C). Moreover,
gfortran has made large progress since version 4.2, so you probably don't
want that in any case.

> I read a tons of information, but still i cannot understand what i
> should put in --target parameter, when i configure GCC.

The proper target would be arm-apple-darwin13, where the darwin version
(here 13) would be adjusted to match your SDK (13 is for iOS 6).

--
FX

Wolfgang Kilian

unread,
Jun 23, 2014, 2:38:12 AM6/23/14
to
So the current status is: no Fortran for iOS or Android?

For some applications it would actually make sense to run on those
devices, if somebody writes an adapter to the graphical front-end.
(Assuming, that one can just install and run one's own software without
caring about app-stores etc. -- which is how computers used to be in the
old times ...)

-- Wolfgang

--
E-mail: firstnameini...@domain.de
Domain: yahoo

FX

unread,
Jun 23, 2014, 5:55:16 AM6/23/14
to
> So the current status is: no Fortran for iOS

As far as I am aware, that is correct.

> or Android?

The situation here is very different: GCC support for Android is pretty
well maintained, and gfortran support too. You can find plenty of
documentation on how to build either a native or a cross gfortran
compiler for Android with Google.

--
FX

work...@gmail.com

unread,
Nov 21, 2014, 1:23:02 PM11/21/14
to
This is possible now using Dragonegg which combines the GCC frontend with the LLVM backend. What makes this feasible is that LLVM 3.5 can now target Apple iOS and even more important arm64. I roughly documented the steps here:

http://apple.stackexchange.com/questions/40471/is-there-a-fortran-compiler-emulator-for-ios
0 new messages