CentOS7 安装boost_1_52
最近想学习一下boost库,在CentOS7上安装。在CSDN上找了很多帖子,但是自己装时总是报错。之后在google上找到了一些解决办法,在此记录整个安装过程。
1、下载boost安装包:[boost下载地址] (https://www.boost.org/users/history/)
2、安装依赖包:
yum install gcc gcc-c++ bzip2 bzip2-devel bzip2-libs python-devel zlib-devel -y
3、初始化环境
[root@c_plus_clz boost_1_52_0]# ./bootstrap.sh
Building Boost.Build engine with toolset gcc... tools/build/v2/engine/bin.linuxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... not found.
Backing up existing Boost.Build configuration in project-config.jam.3
Generating Boost.Build configuration in project-config.jam...
Bootstrapping is done. To build, run:
./b2
To adjust configuration, edit 'project-config.jam'.
Further information:
- Command line help:
./b2 --help
- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html
- Boost.Build documentation:
http://www.boost.org/boost-build2/doc/html/index.html
4、编译
[root@c_plus_clz boost_1_52_0]# ./b2
Building the Boost C++ Libraries.
Performing configuration checks
- 32-bit : no
- 64-bit : yes
- x86 : yes
- has_icu builds : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
- iconv (libc) : yes
- icu : no
- icu (lib64) : no
- gcc visibility : yes
- long double support : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
Component configuration:
- chrono : building
- context : building
- date_time : building
- exception : building
- filesystem : building
- graph : building
- graph_parallel : building
- iostreams : building
- locale : building
- math : building
- mpi : building
- program_options : building
- python : building
- random : building
- regex : building
- serialization : building
- signals : building
- system : building
- test : building
- thread : building
- timer : building
- wave : building
...patience...
...patience...
...patience...
...patience...
...found 8773 targets...
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/boost_1_52_0
The following directory should be added to linker library paths:
/home/boost_1_52_0/stage/lib
5、安装
sudo ./b2 install --prefix=/usr/local
参考:https://blog.csdn.net/guanyijun123/article/details/45745999