如何制作在 Mac OS X 10.5 和 10.6 上运行的 fortran 可执行文件

发布于 2024-08-11 08:44:29 字数 180 浏览 3 评论 0原文

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

dyld:unknown required load command 0x80000022 跟踪/BPT 陷阱

I'd like to compile a fortran code with gfortran so that it will work on both Mac OS X 10.5 and 10.6. Is there a way to do this? I tried compiling on 10.6 and get this message when I run the executable on 10.5:

dyld: unknown required load command 0x80000022
Trace/BPT trap

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尐偏执 2024-08-18 08:44:29

该应用程序错误地在 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

The application was incorrectly built on OS X 10.6 machine for a 10.5 machine. The developer can fix this by considering three things:

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)

After this is fixed, one can check if the application was correctly built for OS X 10.5 by running 'otool':

otool -l binary

The correct binary should not contain any 'LC_DYLD_INFO_ONLY' load commands (only 'LC_DYLD_INFO' commands).

(also see my blog article http://grauonline.de/wordpress/?p=71 )

巨坚强 2024-08-18 08:44:29

你用的是什么版本的10.5?根据 this (0x22) 是在 10.5 中添加的动态加载函数.6.您可以尝试升级到>10.5.6,看看问题是否仍然存在。

另外你从哪里得到你的gfortran?在 numpy 社区中,强烈推荐来自 att.com 的版本,以及来自 hpc 通常是 避免

What version of 10.5 are you on? According to this (0x22) is a dynamic load function that got added at 10.5.6. You could try upgrading to >10.5.6 and see if the problem persists.

Also where did you get your gfortran from? In the numpy community the ones from att.com are highly recommended and the builds from hpc are generally to be avoided.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文