【问题标题】:py2app ends with error related to libgfortran.3.dylibpy2app 以与 libgfortran.3.dylib 相关的错误结束
【发布时间】:2011-03-12 16:52:09
【问题描述】:

py2app 以以下错误结束:

/usr/bin/strip: the __LINKEDIT segment does not cover the end of the file 
(can't be processed) in: test.app/Contents/Frameworks/libgfortran.3.dylib
stripping saved 1222348 bytes (88617336 / 89839684)

控制台输出的最后一行:

../Frameworks/libgfortran.3.dylib: mach-o, but wrong architecture

我该如何解决这个问题?

我正在使用 雪豹 (x86_64)
Python 2.6.6(r266:84292,2011 年 2 月 4 日,20:12:20)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] 在 darwin 上

【问题讨论】:

    标签: python py2app


    【解决方案1】:

    首先确定您计划构建的架构和操作系统版本。

    然后确保为这些架构编译libgfortran 和您的其他依赖项。 (您可以使用 lipo -info 或 file 打印 Mach-O 二进制文件中包含的架构)。

    最后,如果架构是您正在使用的 Python 版本所构建的架构的子集,请编译/使用仅为这些架构构建的 Python 版本,或者破解 distutils 以删除 @987654325 @标志(如果需要,可以添加-isysroot),如this script。

    【讨论】:

    • @nicholas-riley:好吧,我有点迷路了。我正在使用 MacPorts 的 py26-py2app-devel(0.5.3)。它是通用的。我也有来自 macports 的 gcc44,虽然它不是默认的 gcc。 gcc44 也是 +universal 构建的,但不知何故 libgfortran.3.dylib 只有 i386。我如何理解 py2app 使用了哪个 gcc?最后,我实际上并不需要 64 位,这还不是最终用户软件,我目前只是在我自己的机器上进行测试。什么是最简单的离开方式?
    • distutils(这是您与 py2app 一起使用的)尝试使用编译 it 的编译标志调用编译器。因此,如果您使用 MacPorts 中的 Python,它将使用该版本的 Python。我认为 MacPorts 默认只有 64 位,所以你最好的选择可能是从 python.org 安装一个 32 位 Python 并改用它;可能比尝试修复 gfortran 的构建过程更容易。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-10
    • 2015-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-08
    相关资源
    最近更新 更多