-
Notifications
You must be signed in to change notification settings - Fork 4
thrift相关
最简单的是用homebrew进行安装
安装homebrew 在终端输入ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
安装thrift brew install thrift
用brew安装的thrift版本是0.9的,but,我们项目中得thrift版本是0.8的,所以果断卸载掉。
brew uninstall thrift。转到下面第二种方法安装thrift
先安装依赖。
http://www.jattcode.com/installing-autoconf-automake-libtool-on-mac-osx-mountain-lion/
安装BOOST
命令:./bootstrap.sh,该命令用于生成bjam可执行文件,这个东西就是用来编译boost库
命令:sudo ./b2 threading=multi address-model=64 variant=release stage install
安装 libevent
命令:./configure --prefix=/usr/local
命令:make
命令:sudo make install
安装 Apache Thrift
编译命令:./configure --prefix=/usr/local/ --with-boost=/usr/local/lib --with-libevent=/usr/local/lib --without-ruby --without-python --without-perl --without-php
有一些不相关的code genorater可以不要了,不然又得会报错。。。
安装命令:sudo make install
thrift -version 可以查看安装是否成功和版本
./configure --prefix=/usr/local CPPFLAGS="-I/usr/local/Cellar/openssl/1.0.2j/include" LDFLAGS="-I/usr/local/Cellar/openssl/1.0.2j/lib"
然后再make
解决方案:mac中默认安装了bison 2.3版本,并配置了路径在path中。安装最新的版本3.0.4, 并将/usr/bin中的bison删除,将bison 3.0.4 复制到/usr/bin中
brew install bison
I added this to my bash profile:
export PATH=/usr/local/Cellar/bison/3.0.4/bin:$PATH
(by the time you read this, your version may be different from 3.0.4) And after I restarted the Terminal it picked up the new version of Bison when I did bison -V
参考url:http://stackoverflow.com/questions/10778905/why-not-gnu-bison-upgrade-to-2-5-on-macosx-10-7-3
./configure LDFLAGS='-L/usr/local/opt/openssl/lib' CPPFLAGS='-I/usr/local/opt/openssl/include'
Operation not permitted
搜索之后发现,是El Capitan 加入了Rootless机制,不再能够随心所欲的读写很多路径下了。设置 root 权限也不行。 于是尝试关闭 Rootless。重启按住 Command+R,进入恢复模式,打开Terminal。
csrutil disable
如果要恢复默认,那么
csrutil enable
thrift -gen java person.thrift