Mac 安装thrift

一、安装依赖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即可

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容