mac下安装thrift
来源:互联网 发布:java 依赖打包 编辑:程序博客网 时间:2024/06/05 18:05
使用brew安装
使用brew install thrift会安装最新版本的thrift,目前是0.9。
手动安装
安装基本组件
1、安装BOOST
下载:http://www.boost.org/
./bootstrap.shsudo ./b2 threading=multi address-model=64 variant=release stage install
2、安装 libevent
下载:http://libevent.org/
./configure --prefix=/usr/local makesudo make install
3、针对不同语言,需要安装不同的组件
比如java库,需要安装java、ant,否则在安装thrift时,将不会安装该语言的代码生成器。
包括BOOST和libevent,均可以使用brew进行安装。
4、安装 Apache Thrift
下载:http://thrift.apache.org/
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local有些不需要的lib不用编译,避免报错。
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local --without-erlang --without-ruby --without-php上面剔除了erlang、ruby、php等语言。
makesudo make install
thrift -version 可以查看安装是否成功和版本。
安装8的时候会遇到如下问题,并按如下解决:
Osx 10.9 是比较新的系统, 从这个版本开始, 系统默认编译器从GCC 改为 Clang(GCC -v 一下, 给的是clang 的提示).
Thrift 0.8 代码相对又比较老, 在新的编译器上遇到了下列一些问题.
问题1 :
多个源码文件报错 # include <tr1/functional>, file not found, 改为 # include <boost/tr1/functional.hpp> 解决.
需要修改以下文件:
- lib/cpp/src/concurrency/ThreadManager.h line:24
- lib/cpp/src/async/TAsyncChannel.h line:23
- lib/cpp/src/async/TAsyncChannel.cpp line:21
- lib/cpp/src/async/TAsyncProcessor.h line:23
- lib/cpp/src/async/TAsyncBufferProcessor.h line:23
原因: 在我试验的环境下, 此头文件有后缀名/usr/local/include/boost/ tr1/functional.hpp
问题2:
cpp 测试代码 test/Benchmark.cpp 编译失败, shared_ptr ambigous , 用 boost::shared_ptr 替换 shared_ptr,
错误消失.
原因: Clang 支持 C++ 11, 其 标准库自带 shared_ptr(std::shared_ptr, 参考 http://zh.cppreference.com/w/cpp/memory/shared_ptr)
故需显式指定名字空间.
- MAC下thrift安装
- Mac下安装Thrift
- mac下安装thrift
- MAC/linux 下Thrift安装
- IOS/MAC环境下thrift的安装
- Mac下安装降级版thrift
- Mac上安装Thrift
- mac os 安装thrift
- mac os 安装 thrift
- mac os 安装thrift
- 【Thrift】Mac 安装
- Mac 10.9.2 安装thrift
- Mac安装thrift-0.10.0
- mac安装thrift-0.9.1
- ubuntu下安装thrift
- fedora下安装thrift
- ubuntu下安装thrift
- ubuntu下安装thrift
- 004_Http之response响应头-02定时刷新(定时重定向)
- spring mvc 实现远程服务调用的几种方式
- *p++ *++p *(p++) *(++p)
- 史上最详细的LXR安装介绍
- JSP学习笔记四之out和session对象
- mac下安装thrift
- DCOS之kubernetes集群搭建
- listview的onmeasure方法
- CSS实现渐变
- poj 1177 区间树求矩形周长并
- select count(*)和select count(1)的区别
- 面向对象三大基本特性,五大基本原则
- 152. Maximum Product Subarray
- VS2010无法捕获try catch的问题 解决