1. 下载boost:http://www.boost.org/
2. 解压
3. 添加一个BOOST_ROOT环境环境变量:
vi ~/.bash_profile
export BOOST_ROOT=$HOME/boost_1_58_0
4. 安装
cd $HOME/boost_1_58_0
./bootstrap.sh --prefix=$HOME/
./b2 install -j30
5. 配置库和头文件的环境变量
vi ~/.bash_profile
export PATH=$PATH:$HOME/bin
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/include
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$HOME/include
export LIBRARY_PATH=$LIBRARY_PATH:$HOME/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
原文:http://www.cnblogs.com/liyulong1982/p/7113266.html