Thrift介绍

Thrift是一个软件框架,用来进行可扩展且跨语言的服务的开发。它结合了功能强大的软件堆栈和代码生成引擎,以构建在 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, and OCaml 这些编程语言间无缝结合的、高效的服务。

安装开发工具集

sudo yum -y groupinstall "Development Tools"

安装autoconf

 
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr
make
sudo make install
cd ..
 

安装automake

 
wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
tar xvf automake-1.14.tar.gz
cd automake-1.14
./configure --prefix=/usr
make
sudo make install
cd ..
 

安装bison

 
wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
tar xvf bison-2.5.1.tar.gz
cd bison-2.5.1
./configure --prefix=/usr
make
sudo make install
cd ..
 

安装C++依赖库

sudo yum -y install libevent-devel zlib-devel openssl-devel

安装boost

wget http://iweb.dl.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.gz
./bootstrap.sh --prefix=/usr
./b2 install
cd ..

安装libevent

wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
./configure --prefix=/usr
make
sudo make install
cd ..

安装Thrift

git clone https://git-wip-us.apache.org/repos/asf/thrift.git
cd thrift
./configure --prefix=/usr --with-libevent=/usr --with-boost=/usr
sudo make
sudo make install

安装过程中容易碰到的问题:

1.下面这个错误可能是因为DOS(Windows)和Unix文件格式问题:
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... no
configure: No compiler with C++11 support was found
./configure: line 16746: syntax error near unexpected token `fi'
./configure: line 16746: `fi'
解决方法是设置好git:
[core]
autocrlf = false
safecrlf = true
eol = lf
对应的命令为:
git config --global core.autocrlf false
git config --global core.safecrlf true
git config --global core.eol lf

完成后,删除再重新从git上clone出来。

2..ibtoolize: AC_CONFIG_MACRO_DIR([./aclocal]) conflicts with aclocal_AMFLAGS=-I ./aclocal 执行libtoolize遇到上面提示的错误时,可能是因为configure.ac和Makefile.am文件是dos格式导致的。这个问题跟上面那个解决方案一致,或者直接修改文件格式见:http://www.cnblogs.com/573583868wuy/p/4009546.html(不太建议这样干,单个文件可以这样,文件多了就比较坑了)。

3.

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report

具体步骤请参见 <http://bugzilla.redhat.com/bugzilla>。
make[3]: *** [src/thrift/generate/thrift-t_c_glib_generator.o] 错误 1
make[3]: Leaving directory `/home/will/thrift-0.10.0/compiler/cpp'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/will/thrift-0.10.0/compiler/cpp'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/will/thrift-0.10.0'
make: *** [all] 错误 2

主要原因大体上是因为内存不足,可以 临时使用交换分区来解决,最好是添加物理内存

sudo dd if=/dev/zero of=/swapfile bs=64M count=16 
sudo mkswap /swapfile 
sudo swapon /swapfile

centos 安装thrift的更多相关文章

  1. CentOS安装thrift

    下载thrift依赖的东西  yum -y install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-dev ...

  2. Thrift CentOS安装和使用

    Thrift是Apache的一个开源的跨语言服务开发框架,它提供了一个代码生成引擎来构建服务,支持C++,Java,Python,PHP,Ruby,Erlang,Perl,Haskell,C#,Coc ...

  3. thrift C++ Centos 安装

    1.在官方下载thrift http://thrift.apache.org/download 这里下载thrift-0.11.0.tar.gz版本 2.如果想支持安装Cpp版本就需要先安装boost ...

  4. CentOS 6安装thrift支持erlang开发

    早前,在我的博文thrift多平台安装介绍了如何在debian/ubuntu下面安装thrift,并支持erlang开发的.而在CentOS平台下,并没有成功安装.经过不断摸索,终于成功了,这篇博文就 ...

  5. 安装thrift

    要求 thrift至少需要支持三种语言: Java PHP Go 预安装 基本教程: http://thrift.apache.org/docs/install/centos 使用最新的thrift, ...

  6. 安装thrift全过程

    为了研究基于thrift的RPC框架,其实,是想自己基于thrift写一个微服务的platform.首先就是安装Thrift,便于IDL架构生成java的接口文件.多的不说了,开始install的过程 ...

  7. linux安装thrift

    安装配置Thrift Thrift的编译器使用C++编写的,在安装编译器之前,首先应该保证操作系统基本环境支持C++的编译,安装相关依赖的软件包,如下所示 sudo yum install autom ...

  8. CentOS安装gitlab,gerrit,jenkins并配置ci流程

    CentOS安装gitlab,gerrit,jenkins并配置ci流程 By Wenbin juandx@163.com 2016/4/9 这是我参考了网上很多的文档,配置了这三个软件在一个机器上, ...

  9. 【推荐】CentOS安装Subversion-1.8.11+HTTP协议支持配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. 我们需要搭建一个自己的SVN服务器. 此外,搭建好的SVN服务器除了需要支持svn协议外,最好还需要支持HTTP协议和HTTPS协 ...

随机推荐

  1. CRM BP SEARCH 优化

    出于方便的目的,这边将BU_GROUP,SALE_ORG加到了BP搜索里面,因为CRM项目推广了很多国家,每个国家一个SALE ORG,而标准的BP HEADER ADV SEARCH里竟然没有BU_ ...

  2. 推荐系统评测指标—准确率(Precision)、召回率(Recall)、F值(F-Measure)

    下面简单列举几种常用的推荐系统评测指标: 1.准确率与召回率(Precision & Recall) 准确率和召回率是广泛用于信息检索和统计学分类领域的两个度量值,用来评价结果的质量.其中精度 ...

  3. Python---字典常用方法总结

    字典是一种key-value的数据类型,字典里必须写Key和value,字典的优点是取数方便和速度快.字典的特性: 1.字典是无序的,因为它没有下标,用key来当索引,所以是无序的 2.字典的key必 ...

  4. js 奇淫技巧

    js没有用来统计字符串中含有多少个字母的方法 let value='aaa&bbb&aad123&333' 那么value共含有 value.length-value.repl ...

  5. Generative Model 与 Discriminative Model

      [摘要]    - 生成模型(Generative Model) :无穷样本==>概率密度模型 = 产生模型==>预测    - 判别模型(Discriminative Model): ...

  6. 输出前n大的数(分治)

    描述:给定一个数组包含n个元素,统计前m大的数并且把这m个数从大到小输 出. 输入: 第一行包含一个整数n,表示数组的大小.n < 100000.第二行包含n个整数,表示数组的元素,整数之间以一 ...

  7. bzoj1238

    题解: 傻逼模拟题 果断的复制了题解(还没有c++题解?) 代码: program p2509; type arr=array[..] of boolean; var tot:longint; s:a ...

  8. linux-安装jdk以及tomcat

    1.安装jdk   下载地址:www.oracle.com/technetwork/cn/java/javase/downloads/jdk7-downloads-1880260.html 将jdk下 ...

  9. SpringCloud调用服务示例

    SpringCloud調用服務示例. SpringCloud简介: Spring Cloud是一系列框架的有序集合.它利用Spring Boot的开发便利性巧妙地简化了分布式系统基础设施的开发,如服务 ...

  10. .net core 在扩展中使用接口实例之IServiceProvider

    在.net core 2.0中,我们使用的对象实例大多数都是通过构造函数依赖注入进来的,但那是在一般的类中使用. 如果需要在静态/扩展类中使用某些服务类的对象实例,可以使用如下方式: 1.新建一个Se ...