简体   繁体   English

为iPhone编译外部C ++库(Octave)(缺少Fortran编译器?)

[英]Compiling external C++ library (Octave) for iPhone (Fortran compiler missing?)

A friend of mine asked me if it would be possible to port the Octave project to the iPhone. 我的一个朋友问我是否可以将Octave项目移植到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. 我以前没有为iPhone项目编译外部软件包,所以我下载了源代码,然后使用了在两个不同网站( 一个两个 )上找到的一些脚本来尝试构建这些库。 However, when I try either of these scripts (which are nearly identical), they eventually die during the configure phase with the following error output: 但是,当我尝试使用这两个脚本(几乎相同)时,它们最终会在configure阶段消失,并显示以下错误:

[...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? 是iPhone SDK / Xcode不包含Fortran交叉编译器,还是我做错了什么?

The iPhone SDK does not include a FORTRAN compiler. iPhone SDK不包括FORTRAN编译器。 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. 苹果公司最新的FORTRAN产品是为苹果公司提供的[],尽管苹果公司制造的大多数系统都存在第三方和/或开源编译器。

You could configure and build gfortran , but it's going to be a PITA. 您可以配置和构建gfortran ,但这将是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 . 你可能需要在iPhone下找到从苹果的定制GCC 4.2叉更改合并这里有一个配方构建它的达尔文,比如这个

You might try f2c as the Octave project suggests. 您可以按照Octave项目的建议尝试f2c

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM