mac上安装 Thrift 0.9.2


 

Thrift 0.9.2 官方文档中对于Mac OS X上的安装描述比较简陋,很多问题都不能解决。 

Homebrew  macport 

经过实验,安装步骤如下:
(安装步骤中如果出现缺少目录的提示,就手动创建目录)

1、安装 autoconf2.65 automake 1.11.6,采用默认安装方式

brew install autoconf

bew install automake

2、设置java环境变量 JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Home

安装 Boost,此步骤可以按照官方文档进行

安装 libevent,此步骤可以按照官方文档进行

brew install libevent

3、从github 获得thrift-0.9.2.zip(不要使用官方提供的安装包否则会遇到n多坑),https://github.com/apache/thrift/releases/tag/0.9.2

4、在解压后的thrift目录中运行./bootstrap.sh

5、执行 export CXXFLAGS="-std=c++11"

6、编译

./configure --prefix=/usr/local/thrift-0.9.2 --disable-static --with-boost=/usr/local --with-libevent=/usr/local --without-python --without-csharp --without-ruby --without-perl --without-php --without-haskell --without-erlang LDFLAGS='-L/usr/local/opt/openssl/lib' CPPFLAGS='-I/usr/local/opt/openssl/include' CXXFLAGS="-std=c++11"

(参数根据需要进行设定)

7、make

8、sudo make install

安装完成

 

 
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM