Workspace of LionHeart

Focus on Spark/TensorFlow and other BigData and ML platforms

Mac安装Thrift方法

导航[-]

新版mac使用brew默认安装的是最新版本的thrift 0.10.1

但现有项目主要依赖0.9.x,因此需要在mac上手动安装thrift。

本文介绍如何在新版本Mac上安装thrift 0.9.3.

安装依赖

确保安装了如下依赖:

  • openssl
  • libevent
  • bison 版本> 2.5

注意:

mac高版本安装openssl之后可能提示openssl为keg-only的版本

需要记下其安装目录,默认为/usr/local/opt/openssl.

下载thrift

以0.9.3为例:

1
$wget http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz

下载后解压:

1
$tar zxvf thrift-0.9.3.tar.gz

编译安装thrift

运行configure进行配置,注意这里指定了前面记下的openssl的路径:

1
$./configure --with-openssl=/usr/local/opt/openssl --without-perl --without-php

编译:

1
$./make

安装:

1
$./make install

安装后运行:

1
$thrift --version

输出:Thrift version 0.9.3

表明安装成功