OSX Snow Leopard:针对 32 位和 64 位构建 boost 1.47.0

发布于 2024-11-27 12:31:38 字数 291 浏览 6 评论 0原文

我快要疯了...我目前正在尝试在 osx 雪豹上将我的项目从 1.44.0 升级到 1.47.0。-我想用以下命令构建它:

./b2 macosx-version=10.6 link=static address-model=32_64 threading=multi stage

我期望它给我的地方支持 i386 以及 x86_64 的静态胖版本。不管怎样,它显然不是,因为如果我查询生成的库的 lipo -info ,它们都是 x86_64。- 我能做什么来解决这个问题?会不会是构建脚本损坏了?

I am going crazy...I am currently trying to upgrade boost for my project from 1.44.0 to 1.47.0 on osx snow leopard.- I want to build it with the following command:

./b2 macosx-version=10.6 link=static address-model=32_64 threading=multi stage

where i'd expect that it gives me a static fat build that supports i386 aswell as x86_64 . Anyways, it obviously does not, since if i query lipo -info of the resulting libs, they are all x86_64.- What can I do to solve this? Could it be that the build script is broken?

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

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

发布评论

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

评论(6

亽野灬性zι浪 2024-12-04 12:31:38

我通过使用此构建使其正常工作:

./b2 link=static threading=multi toolset=darwin cxxflags="-arch i386 -arch x86_64" macosx-version=10.6 stage

I got it to work by using this build:

./b2 link=static threading=multi toolset=darwin cxxflags="-arch i386 -arch x86_64" macosx-version=10.6 stage

青衫负雪 2024-12-04 12:31:38

这对我有用。

./b2 link=static threading=multi toolset=darwin cxxflags="-arch i386 -arch x86_64" target-os=darwin address-model=32_64 stage

This is what worked for me.

./b2 link=static threading=multi toolset=darwin cxxflags="-arch i386 -arch x86_64" target-os=darwin address-model=32_64 stage
婴鹅 2024-12-04 12:31:38

对我来说,在 MacOSX 10.6 上构建 Boost 1.49 的胖二进制文件的唯一方法是使用参数 Architecture=x86 和 address-model=32_64。

The only way for me to get fat binaries building Boost 1.49 on MacOSX 10.6 was to use both the parameters architecture=x86 and address-model=32_64.

烟雨凡馨 2024-12-04 12:31:38

我尝试了所有许多选项,但没有一个能够生成具有 32 位和 64 位架构的通用二进制文件。最终对我有用的是这个:

./b2 threading=multi toolset=darwin architecture=x86 target-os=darwin address-model=32_64 stage

这是 Mountain Lion 上的 boost 1.51.0。

I have tried all many options and none of them produced a universal binary with both 32 and 64-bit architectures. The one that finally worked for me was this one:

./b2 threading=multi toolset=darwin architecture=x86 target-os=darwin address-model=32_64 stage

This is with boost 1.51.0 on Mountain Lion.

み零 2024-12-04 12:31:38

您应该添加选项“架构”,例如:

./b2 macosx-version=10.6 link=static address-model=32_64 architecture=combined threading=multi stage

You should add option "architecture", for example:

./b2 macosx-version=10.6 link=static address-model=32_64 architecture=combined threading=multi stage
梦罢 2024-12-04 12:31:38

我在构建 32/64 组合版本时也遇到了问题,最终不得不分别构建两个版本(我必须将 cxx 标志“-arch i386”添加到 32 位构建中)并使用 lipo 来组合它们。例如:

./bjam link=static release install address-model=32 --prefix=$prefix_dir-x86" --python-buildid=2.7 python=2.7 --with-python cxxflags="-fPIC -Wfatal-errors -arch i386" -s NO_BZIP2=1 -s NO_ZLIB=1
./bjam link=static release install address-model=64 --prefix=$prefix_dir-x64" --python-buildid=2.7 python=2.7 --with-python cxxflags="-fPIC -Wfatal-errors" -s NO_BZIP2=1 -s NO_ZLIB=1
lipo $prefix_dir-x86/lib/libboost_python-2_7.a $prefix_dir-x64/lib/libboost_python-2_7.a -output $prefix_dir-universal/libboost_python-2_7.a -create

鉴于在添加“-arch i386”之前我仍然获得了 64 位二进制文​​件(当我请求 32 位时),我怀疑 bjam/b2 在 Macos 上针对 32 位二进制文​​件的构建脚本存在问题。

I'm having problems building 32/64 combined versions too, and ultimately resorted to building the two separately (I had to add the cxx flag "-arch i386" to the 32 bit build) and using lipo to combine them. Eg:

./bjam link=static release install address-model=32 --prefix=$prefix_dir-x86" --python-buildid=2.7 python=2.7 --with-python cxxflags="-fPIC -Wfatal-errors -arch i386" -s NO_BZIP2=1 -s NO_ZLIB=1
./bjam link=static release install address-model=64 --prefix=$prefix_dir-x64" --python-buildid=2.7 python=2.7 --with-python cxxflags="-fPIC -Wfatal-errors" -s NO_BZIP2=1 -s NO_ZLIB=1
lipo $prefix_dir-x86/lib/libboost_python-2_7.a $prefix_dir-x64/lib/libboost_python-2_7.a -output $prefix_dir-universal/libboost_python-2_7.a -create

Given that I still got 64 bit binaries (when I requested 32 bit) before I added "-arch i386", I suspect that there's an issue with bjam/b2's build script for 32 bit binaries on macos.

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