OSX Snow Leopard:针对 32 位和 64 位构建 boost 1.47.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我通过使用此构建使其正常工作:
./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
这对我有用。
This is what worked for me.
对我来说,在 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.
我尝试了所有许多选项,但没有一个能够生成具有 32 位和 64 位架构的通用二进制文件。最终对我有用的是这个:
这是 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:
This is with boost 1.51.0 on Mountain Lion.
您应该添加选项“架构”,例如:
You should add option "architecture", for example:
我在构建 32/64 组合版本时也遇到了问题,最终不得不分别构建两个版本(我必须将 cxx 标志“-arch i386”添加到 32 位构建中)并使用 lipo 来组合它们。例如:
鉴于在添加“-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:
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.