1

我想用 gfortran 编译一个 fortran 代码,这样它就可以在 Mac OS X 10.5 和 10.6 上运行。有没有办法做到这一点?我尝试在 10.6 上编译并在 10.5 上运行可执行文件时收到此消息:

dyld:未知所需的加载命令 0x80000022 跟踪/BPT 陷阱

4

2 回答 2

0

你用的是哪个版本的 10.5?据此(0x22) 是10.5.6 中添加的动态加载功能。您可以尝试升级到 >10.5.6 并查看问题是否仍然存在。

你从哪里得到你的gfortran?在 numpy 社区中,强烈推荐来自att.com的那些,并且通常应避免使用来自hpc的构建。

于 2009-11-12T22:10:26.377 回答
0

该应用程序错误地在 OS X 10.6 机器上为 10.5 机器构建。开发人员可以通过考虑三件事来解决这个问题:

Using the correct compiler parameters:
gcc-4.2 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk ...

Using the correct linker settings (setting environment variable before link command). This is required, so that the OS X 10.6 linker will not use the loader command 'LC_DYLD_INFO_ONLY' (=0x80000022), because OS X 10.5 does not understand this command:

export MACOSX_DEPLOYMENT_TARGET=10.5
(or   setenv MACOSX_DEPLOYMENT_TARGET=10.5)

修复此问题后,可以通过运行“otool”检查应用程序是否为 OS X 10.5 正确构建:

otool -l 二进制

正确的二进制文件不应包含任何“LC_DYLD_INFO_ONLY”加载命令(仅“LC_DYLD_INFO”命令)。

(另见我的博客文章http://grauonline.de/wordpress/?p=71

于 2011-10-23T17:20:20.470 回答