Fortran compiler on ARM / Android

Is there a Fortran compiler for Android OS running. I found that there are some Fortran to C translators that will then compile to C, but I would like to know if there are compilers like gfortran for ARM / RISC machines or for Android OS.

+3


source to share


1 answer


Maybe your Fotran code is running on Android, with a big BUT! As far as I know, there is no explicit Android (and in particular) ARM targeting Fortran compiler that does everything I could imagine (but see PS below) ... and I haven't reviewed it for several years.

However, you can create your own Android / Fortran apk and it definitely works.

There are many approaches, but the most successful / least painful (as far as I know) is to create your own cross-compilation of the ARM / Fortran toolchain on Linux with GCC / gFortran (or even with "virtual" Linux running on Windows). You may need to get an older version of ADT (Android Development Tool) in conjunction with Eclipse Photran. I haven't tried it with newer versions, or with AndroidStudio, etc.

The task of creating such a chain of instruments is not a trivial task. You also need to learn how to program in Java for the "front end" and program Android JNI / NDK etc. to link (ARM Fortran binaries / libraries). My suggestion is that your first Apk is a pure Android / Java apk, before moving on to Fortran / C hardware, etc. JNI.

The best place to start, and the two people most looking for, if not all, credit (AFIK) are here

http://danilogiulianelli.blogspot.ca/2013/02/how-to-build-gcc-fortran-cross-compiler.html (Danilo Giulianelli)



and here

http://specificimpulses.blogspot.ca/2011/01/my-android-speaks-fortran-yours-can-too.html (Mike Long)

... they did the whole "hard climb".

I used their results and created various Fortran based apps / apk that run quickly on SmartPhone / Tablet. I've been comparing some obvious benchmarks like Fortran, C and Java versions based on LinPack benchmarks ... no wonder Fortran wins. C is a little slower. Though Java is the way to go in execution speed (as you would expect).

PS. I've seen advertisements for explicit Fortran compilers that need to run directly on Android (e.g. GooglePlay / Store), but I haven't tried this myself as my (preliminary) research has shown it won't be a starter for my needs. Maybe this might work for you. If they do, please post a comment.

+3


source







All Articles