thrift安装脚本

#! /bin/bash

# install libtool
tar xzvf libevent-1.4.13-stable.tar.gz

cd libevent-1.4.13-stable/

./configure

make

make install

cd ..

# install boost
tar xzvf boost_1_48_0.tar.gz

cd boost_1_48_0/

./bootstrap.sh

./b2 install

cd ..

# install openssl

tar xzvf openssl-1.0.1.tar.gz

cd openssl-1.0.1

./config --prefix=/usr/local shared threads   # must generate so lib

./make

make install

cd ..


# install thrift

tar xvzf thrift-0.8.0.tar.gz

cd thrift-0.8.0

./configure --with-java=no --with-python=no --with-perl=no   # not generate java tool

# make config.h is right
sed -i -e 's!#define HAVE_MALLOC 0!#define HAVE_MALLOC 1!'  config.h
sed -i -e 's!#define HAVE_REALLOC 0!#define HAVE_REALLOC 1!'  config.h
sed -i -e 's!#define malloc rpl_malloc!/*#define malloc rpl_malloc*/!'  config.h
sed -i -e 's!#define realloc rpl_realloc!/*#define realloc rpl_realloc*/!'  config.h

make

make install

thrift安装的注意事项:

1)libevent,boost, openssl需要先安装;

2) openssl默认安装路径非标准,且不生成动态库, 采用如下配置:./config --prefix=/usr/local shared threads;

3)请禁止thrift不需要的生成工具,如java;

4) 注意thrift生成的config.h是否重定义malloc和realloc。

注:

1)上述脚本只生成C++生成工具。

2)系统为linux,假定系统已安装g++,lex,yacc工具库。


作者:zhenjing.chen
出处:http://www.cnblogs.com/zhenjing/
未注明转载的文章,版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

原文地址:https://www.cnblogs.com/zhenjing/p/thrift_installl.html