Thrift 0.9.2 官方文檔中對於Mac OS X上的安裝描述比較簡陋,不少問題都不能解決。 php
Homebrew macport html
通過實驗,安裝步驟以下:
(安裝步驟中若是出現缺乏目錄的提示,就手動建立目錄)java
一、安裝 autoconf2.65 automake 1.11.6,採用默認安裝方式python
brew install autoconfc++
bew install automakegit
二、設置java環境變量 JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Homegithub
安裝 Boost,此步驟能夠按照官方文檔進行apache
安裝 libevent,此步驟能夠按照官方文檔進行bootstrap
brew install libeventruby
三、從github 得到thrift-0.9.2.zip(不要使用官方提供的安裝包不然會遇到n多坑),https://github.com/apache/thrift/releases/tag/0.9.2
四、在解壓後的thrift目錄中運行./bootstrap.sh
五、執行 export CXXFLAGS="-std=c++11"
六、編譯