竹山一叶

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
编译环境
操作系统: Red Hat Enterprise Linux Server release 5.4 64-bit
编译工具: gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)

1.    下载boost
以boost_1_48_0.tar.gz包为例,将boost_1_48_0.tar.gz上传至/home目录下

2.     解压boost
$ cd /home
$ tar -zxvf boost_1_48_0.tar.gz
$ cd boost_1_48_0

3.    生成编译工具bjam
$ ./bootstrap.sh

4.    编译
生成boost库
$ sudo ./bjam -sTOOLS=gcc variant=release link=static threading=multi runtime-link=static --prefix=../boost/ --build-type=minimal --layout=system cxxflags=-fPIC linkflags=-fPIC --with-system --with-filesystem --with-thread install
清理编译时的中间文件
$ sudo ./bjam -sTOOLS=gcc clean

5.    使用
在boost_1_48_0目录的同级目录boost/lib中存放的生成的boost库,可以直接用来参与静态编译




posted on 2016-10-24 17:54  竹山一叶  阅读(353)  评论(0编辑  收藏  举报