1. Install Boost
Download the boost library from boost.org untar compile with
boost下载地址:http://www.boost.org/
./bootstrap.sh
sudo ./b2 threading=multi address-model=64 variant=release stage install
2. Install libevent
Download libevent, untar and compile with
libvevent下载地址:http://monkey.org/~provos/libevent
./configure --prefix=/usr/local
make
sudo make install
3. install thrift
从github 获得thrift-0.9.1.zip(官方提供的有些BUG,请使用开源社区的社区版本) 【下载地址】
https://github.com/apache/thrift/tree/0.9.1
步骤如下:
1、主要安装依赖包,可以通过brew安装一遍
2、在解压后的thrift目录(目录路径:/usr/local)中运行./bootstrap.sh
3、./configure LDFLAGS='-L/usr/local/opt/openssl/lib' CPPFLAGS='-I/usr/local/opt/openssl/include' --prefix=/usr/local/thrift-0.9.1 --with-boost=/usr/local --with-libevent=/usr/local --without-ruby --without-haskell --without-erlang --without-python --without-perl
4、sudo make
5、sudo make install
4.设置环境变量:
export THRIFT_HOME=/usr/local/thrift-0.9.1
export $PATH=$PATH:$THRIFT_HOME
source ~/.base_profile
5.测试
thrift --version
注意: 基线的素材库服务还需要安装id2json。自己开发的一个python包
错误信息
1 openssl/bio.h' file not found
原因是mac自带openssl 没有bio.h头信息
第一种
$ brew install openssl
$ brew link openssl --force
第二种 https://my.oschina.net/dongchao/blog/403447?utm_source=tuicool
安装完后
建立软连接
sudo ln -s /usr/local/openssl/bin/openssl /usr/bin/openss
错误:
ln: /usr/bin/openss: Operation not permitted
解决:
http://blog.csdn.net/pz0605/article/details/51954868
Mac OS X 下搭建thrift环境
猜你喜欢
转载自junege.iteye.com/blog/2368849
今日推荐
周排行