Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

seidju

macrumors newbie
Original poster
Jun 20, 2014
3
0
Hello everyone!

I have some Fortran application, and i want to compile it for iOS. 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!
 
How about trying a FORTRAN-to-C compiler? That would be better than nothing.

I tried f2c, but there's too much work to make this translated code work, it's better to create a static library fro, fortran code and use c functions to access it
 
You can only run C, Obj-C, C++, Obj-C++, and JS code on iOS. If you'd like to run your Fortran code, you're either going to have to port it to one of the supported languages (maybe you can find something that will automate that) or you'll have to write an interpreter or emulator for Fortran in one of the supported languages.

It may be possible to use other languages if you jailbreak your iPhone, but I don't think people here would be very experienced with that.

One more thing... iOS devices have ARM processors. Is there even a Fortran compiler that will compile to an ARM processor (just curious - not saying there is or isn't one).
 
You can only run C, Obj-C, C++, Obj-C++, and JS code on iOS. If you'd like to run your Fortran code, you're either going to have to port it to one of the supported languages (maybe you can find something that will automate that) or you'll have to write an interpreter or emulator for Fortran in one of the supported languages.

It may be possible to use other languages if you jailbreak your iPhone, but I don't think people here would be very experienced with that.

One more thing... iOS devices have ARM processors. Is there even a Fortran compiler that will compile to an ARM processor (just curious - not saying there is or isn't one).

Well, i found post on stackoverflow http://stackoverflow.com/questions/...all-to-fortran-code-to-a-project-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.
 
Well, i found post on stackoverflow http://stackoverflow.com/questions/...all-to-fortran-code-to-a-project-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.

Why would you ever go through all the described effort? In the end you still need to write a C/H file for each FORTRAN source file. Surely it's much easier to just rewrite your FORTRAN code in C.
 
OS X and the iOS abi no longer officially support gcc or gcc output. Instead, try using f2c to create C source code from Fortran, and then encapsulate the generated C source inside an Objective C wrapper if necessary.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.