Fortran编译器 [英] Fortran Compiler

查看:197
本文介绍了Fortran编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac上开发一个Android应用程序。
有谁知道一个Fortran编译器的Android?
我打算从C例程中调用一些Fortran例程。然后用Java类包装C例程,并使用JNI来完成此操作。



但是,我无法编译Fortran代码。

解决方案

我自己并没有尝试过,但人们已经成功地为Android构建了gfortran。见例如 http://specificimpulses.blogspot.com/2012/08/something -borrowed-android-fortran.html http://danilogiulianelli.blogspot.com/2013/02/how-to-build-gcc-fortran-cross-compiler.html

如果您的C代码的唯一原因是包装Fortran代码,也许您可​​以使用ISO_C_BINDING(gfortran支持),并且直接使用JNI调用(使用ISO_C_BINDING,您可以在Fortran中使代码与ABI兼容与C)。

I am developing an android app on a Mac. Does anyone know of a fortran compiler for android??? I was going to call some fortran routines from a C routine. Then wrap the C routine with a java class and use the JNI to do this.

BUT, I can't get the fortran code compiled.

解决方案

Haven't tried it myself, but people have successfully built gfortran for Android. See e.g. http://specificimpulses.blogspot.com/2012/08/something-borrowed-android-fortran.html and http://danilogiulianelli.blogspot.com/2013/02/how-to-build-gcc-fortran-cross-compiler.html .

If the only reason for your C code is to wrap the Fortran code, maybe you could instead just use ISO_C_BINDING (which gfortran supports), and have JNI call that directly (with ISO_C_BINDING you can make code in Fortran that is ABI compatible with C).

这篇关于Fortran编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆