如何构建Boost 1.45通用二进制文件? [英] How to build boost 1.45 universal binaries?
问题描述
如何构建Boost 1.45通用二进制文件?在豹子/雪豹上?
How to build boost 1.45 universal binaries? on leopard/ snow leopard ?
推荐答案
要在OSX 10.6上构建4路通用Boost静态二进制文件,请执行以下操作:
To build 4-way universal boost static binaries on OSX 10.6 I do the following:
-
从增强网站下载增强.
Download boost from the boost website.
将存档和cd
提取到boost_x_xx_x
文件夹中(其中x_xx_x
是您使用的Boost版本).
Extract the archive and cd
into the boost_x_xx_x
folder (where x_xx_x
is the version of boost you are using).
运行:
./bootstrap.sh
然后
# The name of the Boost.Jam program changed from "bjam" to "b2" in Boost 1.47.0
# Replace "b2" with "bjam" if you are compiling a version <= 1.46.1
./b2 macosx-version=10.6 macosx-version-min=10.4 architecture=combined threading=multi link=static address-model=32_64
这将编译Boost.MPI除外的所有内容(需要--with-mpi
选项).构建产品放入./stage
This will compile everything except for Boost.MPI (which requires the --with-mpi
option). The build products get put in ./stage
更新:如果已安装XCode 4,则必须执行一个额外的步骤. XCode 4不附带能够针对PowerPC的编译器或库.不幸的是,XCode 4附带的编译器成为Boost使用的默认编译器.要强制使用XCode 3附带的编译器,必须执行一个额外的步骤.请注意,如果系统未安装XCode 3,则必须安装.
UPDATE: If you have installed XCode 4, then there is an extra step that you must perform. XCode 4 does not come with compilers or libraries capable of targeting PowerPC. Unfortunately, the compilers that come with XCode 4 become the default compilers used by Boost. To force the use of the compilers that come with XCode 3, you must perform an extra step. Note that you must install XCode 3 if it is not on your system.
运行./bootstrap.sh
之后和运行b2
之前,打开:
After running ./bootstrap.sh
, and before running b2
, open:
./tools/build/v2/user-config.jam
将以下行添加到该文件.这指示boost使用XCode 3中的g ++-4.2:
Add following line to that file. This instructs boost to use the g++-4.2 from XCode 3:
using darwin : : /Developer-old/usr/bin/g++-4.2 ;
这篇关于如何构建Boost 1.45通用二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!