Mac下安装Thrift |
您所在的位置:网站首页 › bison安装 › Mac下安装Thrift |
方法一: 1. 使用 brew 安装。 brew install thrift 如果没有 Homebrew,先安装Homebrew. 使用brew安装比较方便,他会把thrift需要的依赖都一块下载安装,省去一个个安装依赖包的时间。 brew 默认安装的是最新版本,thrift-0.11.0。如果服务器是低版本的thrift,可以手动降版本。 2. 检查依赖环境 使用 brew list查看之前安装程序,如果没有boost, libevent,openssl 通过brew安装依赖包: brew install boost brew install openssl brew install libevent 使用openssl version 可以查看openssl是否安装成功。 3.安装bison 2.5以上版本 bison链接:http://www.gnu.org/software/bison/ wget http://ftp.gnu.org/gnu/bison/bison-3.2.tar.gz tar -zxvf bison-3.2.tar.gz cd bison-3.2 ./configure make && make install 使用bison --version 查看是否安装成功。 注意: 这里如果显示还是低版本,说明默认使用了xcode自带的bison,将新版本的bison复制到Xcode路径下,覆盖原来的低版本bison。解决方法如下: sudo cp /usr/local/Cellar/bison/3.2/bin/bison /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ bison --version 查看是否安装最新版成功。 4. 安装thrift-0.9.3 thrift链接:http://archive.apache.org/dist/thrift/ wget http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz tar -zxvf thrift-0.9.3.tar.gz cd thrift-0.9.3 ./configure make make install 以上在执行 ./configure 时,可能会报错:configure: error: "Error: libcrypto required." 可以不用管,他不影响下面执行 make & make install,依然可以安装成功。 5.验证 thrift -version 输出如上信息,说明安装成功。 方法二:如果以上方法一没有成功,按以下试试 1.安装brew /usr/bin/ruby -e"$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)" 2.安装依赖库 brew install boost brew install openssl brew install bison 3.覆盖bison版本 mac系统自带bison,必须要用新安装的bison覆盖掉旧的bison,直接在控制台下输入 PATH="/usr/local/Cellar/bison/3.0.4_1/bin/:$PATH" 这样就暂时让bison覆盖了系统自带的bison 4.下载thrift的源码库,checkout版本,重新安装 git clonehttps://github.com/Homebrew/homebrew-core.git cd homebrew-core git checkout aee78328f82279d4de89c95fa1dc2e0731f281c0 brew install ./Formula/thrift.rb 如果报错 Error: thrift: Unsupported special dependency :python 修改thrift.rb文件,方法如下: open ./Formula/thrift.rb thrift.rb文件中 第50行 改成 depends_on"python"=> :optional; 然后 执行 brew install ./Formula/thrift.rb. 有帮到你吗? |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |