一、安装依赖boost
wget -c https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
tar -zxvf boost_1_72_0.tar.gz
cd boost_1_72_0
//运行脚本文件,--prefix指定安装路径。
./bootstrap.sh --prefix=/usr/local
//安装boost,也就是将头文件和生成的库,放到指定的路径(--prefix)下
sudo ./b2 install --prefix=/usr/local
二、安装thrift
wget -c https://mirrors.bfsu.edu.cn/apache/thrift/0.12.0/thrift-0.12.0.tar.gz
tar -zxvf thrift-0.12.0.tar.gz
cd thrift-0.12.0
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local --without-ruby --without-php
make
sudo make install
错误信息:
error: could not create '/usr/lib/python2.7/site-packages': Operation not permitted
解决办法:修改thrift-0.12.0/lib/py/Makefile
将PY_PREFIX=/usr
改为PY_PREFIX = /Users/amy/python (自定义文件夹)
然后sudo make install即可