1 下载thrift源代码

git clone https://git-wip-us.apache.org/repos/asf/thrift.git thrift
git checkout 0.9.3

2 编译并安装

安装依赖

apt-get install automake
apt-get install libssl-dev
apt-get install byacc
apt-get install bison
apt-get install flex
apt-get install libevent-dev

生成编译文件

cd thrift
./bootstrap.sh
configure.ac:84: installing './compile'
configure.ac:88: installing './config.guess'
configure.ac:88: installing './config.sub'
configure.ac:27: installing './install-sh'
configure.ac:27: installing './missing'
compiler/cpp/Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'

编译前配置,禁用java和python, 安装目录设为/usr/lib,而不是默认的/usr/local/lib

./configure --libdir=/usr/lib --without-java --without-python
...
thrift 0.9.3 Building C++ Library ......... : yes
Building C (GLib) Library .... : no
Building Java Library ........ : no
Building C# Library .......... : no
Building Python Library ...... : no
Building Ruby Library ........ : no
Building Haxe Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : no
Building Erlang Library ...... : no
Building Go Library .......... : no
Building D Library ........... : no
Building NodeJS Library ...... : no
Building Lua Library ......... : no C++ Library:
Build TZlibTransport ...... : yes
Build TNonblockingServer .. : yes
Build TQTcpServer (Qt4) .... : no
Build TQTcpServer (Qt5) .... : no If something is missing that you think should be present,
please skim the output of configure to find the missing
component. Details are present in config.log.

编译

make

3 运行测试程序

测试

make check

注意,v0.9.3的make check有个bug, 这里是对应的jira issue, 报错信息是

An error message from getaddrinfo on the console is expected:
Thrift: Mon Dec 14 12:19:09 2015 TServerSocket::listen() BIND 9090

4 安装

sudo make install

注意:

  • $thrift-git-project 是thrift gi项目所在目录
  • 库文件安装在/usr/lib目录下
  • 头文件安装在/usr/local/include/thrift目录下
Making install in compiler/cpp
make[1]: Entering directory '$thrift-git-project/compiler/cpp'
make install-am
make[2]: Entering directory '$thrift-git-project/compiler/cpp'
make[3]: Entering directory '$thrift-git-project/compiler/cpp'
/bin/mkdir -p '/usr/local/bin'
/bin/bash ../../libtool --mode=install /usr/bin/install -c thrift '/usr/local/bin'
libtool: install: /usr/bin/install -c thrift /usr/local/bin/thrift
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '$thrift-git-project/compiler/cpp'
make[2]: Leaving directory '$thrift-git-project/compiler/cpp'
make[1]: Leaving directory '$thrift-git-project/compiler/cpp'
Making install in lib
make[1]: Entering directory '$thrift-git-project/lib'
Making install in cpp
make[2]: Entering directory '$thrift-git-project/lib/cpp'
Making install in .
make[3]: Entering directory '$thrift-git-project/lib/cpp'
make[4]: Entering directory '$thrift-git-project/lib/cpp'
/bin/mkdir -p '/usr/lib'
/bin/bash ../../libtool --mode=install /usr/bin/install -c libthrift.la libthriftnb.la libthriftz.la '/usr/lib'
libtool: install: /usr/bin/install -c .libs/libthrift-0.9.3.so /usr/lib/libthrift-0.9.3.so
libtool: install: (cd /usr/lib && { ln -s -f libthrift-0.9.3.so libthrift.so || { rm -f libthrift.so && ln -s libthrift-0.9.3.so libthrift.so; }; })
libtool: install: /usr/bin/install -c .libs/libthrift.lai /usr/lib/libthrift.la
libtool: install: /usr/bin/install -c .libs/libthriftnb-0.9.3.so /usr/lib/libthriftnb-0.9.3.so
libtool: install: (cd /usr/lib && { ln -s -f libthriftnb-0.9.3.so libthriftnb.so || { rm -f libthriftnb.so && ln -s libthriftnb-0.9.3.so libthriftnb.so; }; })
libtool: install: /usr/bin/install -c .libs/libthriftnb.lai /usr/lib/libthriftnb.la
libtool: install: /usr/bin/install -c .libs/libthriftz-0.9.3.so /usr/lib/libthriftz-0.9.3.so
libtool: install: (cd /usr/lib && { ln -s -f libthriftz-0.9.3.so libthriftz.so || { rm -f libthriftz.so && ln -s libthriftz-0.9.3.so libthriftz.so; }; })
libtool: install: /usr/bin/install -c .libs/libthriftz.lai /usr/lib/libthriftz.la
libtool: install: /usr/bin/install -c .libs/libthrift.a /usr/lib/libthrift.a
libtool: install: chmod 644 /usr/lib/libthrift.a
libtool: install: ranlib /usr/lib/libthrift.a
libtool: install: /usr/bin/install -c .libs/libthriftnb.a /usr/lib/libthriftnb.a
libtool: install: chmod 644 /usr/lib/libthriftnb.a
libtool: install: ranlib /usr/lib/libthriftnb.a
libtool: install: /usr/bin/install -c .libs/libthriftz.a /usr/lib/libthriftz.a
libtool: install: chmod 644 /usr/lib/libthriftz.a
libtool: install: ranlib /usr/lib/libthriftz.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/include/thrift/async'
/usr/bin/install -c -m 644 src/thrift/async/TAsyncChannel.h src/thrift/async/TAsyncDispatchProcessor.h src/thrift/async/TAsyncProcessor.h src/thrift/async/TAsyncBufferProcessor.h src/thrift/async/TAsyncProtocolProcessor.h src/thrift/async/TConcurrentClientSyncInfo.h src/thrift/async/TEvhttpClientChannel.h src/thrift/async/TEvhttpServer.h '/usr/local/include/thrift/async'
/bin/mkdir -p '/usr/local/include/thrift/concurrency'
/usr/bin/install -c -m 644 src/thrift/concurrency/BoostThreadFactory.h src/thrift/concurrency/Exception.h src/thrift/concurrency/Mutex.h src/thrift/concurrency/Monitor.h src/thrift/concurrency/PlatformThreadFactory.h src/thrift/concurrency/PosixThreadFactory.h src/thrift/concurrency/StdMonitor.cpp src/thrift/concurrency/StdMutex.cpp src/thrift/concurrency/StdThreadFactory.cpp src/thrift/concurrency/StdThreadFactory.h src/thrift/concurrency/Thread.h src/thrift/concurrency/ThreadManager.h src/thrift/concurrency/TimerManager.h src/thrift/concurrency/FunctionRunner.h src/thrift/concurrency/Util.h '/usr/local/include/thrift/concurrency'
/bin/mkdir -p '/usr/local/include/thrift/processor'
/usr/bin/install -c -m 644 src/thrift/processor/PeekProcessor.h src/thrift/processor/StatsProcessor.h src/thrift/processor/TMultiplexedProcessor.h '/usr/local/include/thrift/processor'
/bin/mkdir -p '/usr/local/include/thrift/protocol'
/usr/bin/install -c -m 644 src/thrift/protocol/TBinaryProtocol.h src/thrift/protocol/TBinaryProtocol.tcc src/thrift/protocol/TCompactProtocol.h src/thrift/protocol/TCompactProtocol.tcc src/thrift/protocol/TDebugProtocol.h src/thrift/protocol/TBase64Utils.h src/thrift/protocol/TJSONProtocol.h src/thrift/protocol/TMultiplexedProtocol.h src/thrift/protocol/TProtocolDecorator.h src/thrift/protocol/TProtocolTap.h src/thrift/protocol/TProtocolException.h src/thrift/protocol/TVirtualProtocol.h src/thrift/protocol/TProtocol.h '/usr/local/include/thrift/protocol'
/bin/mkdir -p '/usr/local/include/thrift/qt'
/usr/bin/install -c -m 644 src/thrift/qt/TQIODeviceTransport.h src/thrift/qt/TQTcpServer.h '/usr/local/include/thrift/qt'
/bin/mkdir -p '/usr/local/include/thrift/server'
/usr/bin/install -c -m 644 src/thrift/server/TConnectedClient.h src/thrift/server/TServer.h src/thrift/server/TServerFramework.h src/thrift/server/TSimpleServer.h src/thrift/server/TThreadPoolServer.h src/thrift/server/TThreadedServer.h src/thrift/server/TNonblockingServer.h '/usr/local/include/thrift/server'
/bin/mkdir -p '/usr/local/include/thrift'
/usr/bin/install -c -m 644 ../../config.h src/thrift/thrift-config.h src/thrift/TDispatchProcessor.h src/thrift/Thrift.h src/thrift/TOutput.h src/thrift/TProcessor.h src/thrift/TApplicationException.h src/thrift/TLogging.h src/thrift/cxxfunctional.h src/thrift/TToString.h '/usr/local/include/thrift'
/bin/mkdir -p '/usr/local/include/thrift/transport'
/usr/bin/install -c -m 644 src/thrift/transport/PlatformSocket.h src/thrift/transport/TFDTransport.h src/thrift/transport/TFileTransport.h src/thrift/transport/TSimpleFileTransport.h src/thrift/transport/TServerSocket.h src/thrift/transport/TSSLServerSocket.h src/thrift/transport/TServerTransport.h src/thrift/transport/THttpTransport.h src/thrift/transport/THttpClient.h src/thrift/transport/THttpServer.h src/thrift/transport/TSocket.h src/thrift/transport/TPipe.h src/thrift/transport/TPipeServer.h src/thrift/transport/TSSLSocket.h src/thrift/transport/TSocketPool.h src/thrift/transport/TVirtualTransport.h src/thrift/transport/TTransport.h src/thrift/transport/TTransportException.h src/thrift/transport/TTransportUtils.h src/thrift/transport/TBufferTransports.h src/thrift/transport/TShortReadTransport.h src/thrift/transport/TZlibTransport.h '/usr/local/include/thrift/transport'
/bin/mkdir -p '/usr/lib/pkgconfig'
/usr/bin/install -c -m 644 thrift.pc thrift-nb.pc thrift-z.pc '/usr/lib/pkgconfig'
make[4]: Leaving directory '$thrift-git-project/lib/cpp'
make[3]: Leaving directory '$thrift-git-project/lib/cpp'
Making install in test
make[3]: Entering directory '$thrift-git-project/lib/cpp/test'
make install-am
make[4]: Entering directory '$thrift-git-project/lib/cpp/test'
make[5]: Entering directory '$thrift-git-project/lib/cpp/test'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Nothing to be done for 'install-data-am'.
make[5]: Leaving directory '$thrift-git-project/lib/cpp/test'
make[4]: Leaving directory '$thrift-git-project/lib/cpp/test'
make[3]: Leaving directory '$thrift-git-project/lib/cpp/test'
make[2]: Leaving directory '$thrift-git-project/lib/cpp'
make[2]: Entering directory '$thrift-git-project/lib'
make[3]: Entering directory '$thrift-git-project/lib'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '$thrift-git-project/lib'
make[2]: Leaving directory '$thrift-git-project/lib'
make[1]: Leaving directory '$thrift-git-project/lib'
Making install in test
make[1]: Entering directory '$thrift-git-project/test'
Making install in cpp
make[2]: Entering directory '$thrift-git-project/test/cpp'
make install-am
make[3]: Entering directory '$thrift-git-project/test/cpp'
make[4]: Entering directory '$thrift-git-project/test/cpp'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '$thrift-git-project/test/cpp'
make[3]: Leaving directory '$thrift-git-project/test/cpp'
make[2]: Leaving directory '$thrift-git-project/test/cpp'
make[2]: Entering directory '$thrift-git-project/test'
make[3]: Entering directory '$thrift-git-project/test'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '$thrift-git-project/test'
make[2]: Leaving directory '$thrift-git-project/test'
make[1]: Leaving directory '$thrift-git-project/test'
Making install in tutorial
make[1]: Entering directory '$thrift-git-project/tutorial'
Making install in cpp
make[2]: Entering directory '$thrift-git-project/tutorial/cpp'
make install-am
make[3]: Entering directory '$thrift-git-project/tutorial/cpp'
make[4]: Entering directory '$thrift-git-project/tutorial/cpp'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '$thrift-git-project/tutorial/cpp'
make[3]: Leaving directory '$thrift-git-project/tutorial/cpp'
make[2]: Leaving directory '$thrift-git-project/tutorial/cpp'
make[2]: Entering directory '$thrift-git-project/tutorial'
../compiler/cpp/thrift --gen html -r ../tutorial/tutorial.thrift
make[3]: Entering directory '$thrift-git-project/tutorial'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '$thrift-git-project/tutorial'
make[2]: Leaving directory '$thrift-git-project/tutorial'
make[1]: Leaving directory '$thrift-git-project/tutorial'
make[1]: Entering directory '$thrift-git-project'
make[2]: Entering directory '$thrift-git-project'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '$thrift-git-project'
make[1]: Leaving directory '$thrift-git-project'

Author: dean

Created: 2015-12-14 一 22:46

Validate

来自: http://blog.csdn.net/csfreebird/article/details/50293715

ubuntu thrift 0.9.3编译安装的更多相关文章

  1. 在Ubuntu 16.04 LTS下编译安装OpenCV 4.1.1

    目录 一 安装前的准备 二 编译并安装OpenCV 4.1.1 注:原创不易,转载请务必注明原作者和出处,感谢支持! OpenCV目前(2019-8-1)的最新版本为4.1.1.本文将介绍如何在Ubu ...

  2. nginx-1.12.0版本(编译安装)-自定义安装路径

    nginx-1.12.0版本(编译安装)-自定义安装路径 安装路径:/application/nginx-1.12.0 1.前期准备 安装编译需要的gcc和gcc-c++ yum install -y ...

  3. ambari 2.5.0源码编译安装

    参考:https://www.ibm.com/developerworks/cn/opensource/os-cn-bigdata-ambari/index.html Ambari 是什么 Ambar ...

  4. [笔记] Ubuntu 18.04源码编译安装OpenCV 4.0流程

    标准常规安装方法安装的OpenCV版本比较低,想尝鲜使用4.0版本,只好源码安装. 安装环境 OS:Ubuntu 18.04 64 bit 显卡:NVidia GTX 1080 CUDA:10.0 c ...

  5. Ubuntu 16.04源码编译安装nginx 1.10.0

    一.下载相关的依赖库 pcre 下载地址 http://120.52.73.43/jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.t ...

  6. [环境配置]Ubuntu 16.04 源码编译安装OpenCV-3.2.0+OpenCV_contrib-3.2.0及产生的问题

    1.OpenCV-3.2.0+OpenCV_contrib-3.2.0编译安装过程 1)下载官方要求的依赖包 GCC 4.4.x or later CMake 2.6 or higher Git GT ...

  7. thrift在windows的编译/安装--c++版

    前言: thrift是出于Facebook的rpc网络编程框架, 其对跨平台和多语言的支持优于google protobuf, 但thrift在java/c#语言上应用比较多, 资料也丰富, 在win ...

  8. RPC与实践(thrift在windows的编译/安装--c++版)

    ------------------------------------------------------------------------ RPC 功能目标 RPC 的主要功能目标是让构建分布式 ...

  9. ubuntu下mysql源码编译安装

    建议:cpu4核以上,内存4G以上 1. 安装环境:Ubuntu Server 14.10MySQL-5.6.23.tar.gz 2. 安装必备的工具sudo apt-get install make ...

随机推荐

  1. 【原创】MapReduce编程系列之二元排序

    普通排序实现 普通排序的实现利用了按姓名的排序,调用了默认的对key的HashPartition函数来实现数据的分组.partition操作之后写入磁盘时会对数据进行排序操作(对一个分区内的数据作排序 ...

  2. socket 粘包问题(转)

    https://www.v2ex.com/t/234785#reply3 1. 面向字节流的 IO 都有这个问题. socket 中 tcp 协议是面向流的协议,发送方发送和接收方的接收并不是一一对应 ...

  3. 第二百一十五、六天 how can I 坚持

    昨天刷机刷到很晚,博客都忘写了,刷了个flyme,用着没什么感觉,今天打电话试了下还有破音,有点小后悔.不行过两天再刷回来. 今天.mysql ifnull函数. 两条熊猫鱼都死了,这两天雾霾那么严重 ...

  4. 转】Mahout推荐算法API详解

    原博文出自于: http://blog.fens.me/mahout-recommendation-api/ 感谢! Posted: Oct 21, 2013 Tags: itemCFknnMahou ...

  5. Linux下安装protobuf并实现简单的客户端服务器端通信

    http://code.google.com/p/protobuf/downloads/list上可以下载Protobuf的源代码. 安装步骤如下所示: 1>tar -xzf protobuf- ...

  6. arrayObj.splice(start, deleteCount, [item1[, item2[, . . . [,itemN]]]])

    测试方法 function test(){ var arr = [0,1,2,3]; arr.splice(1,1,'a');//case console.dir(arr); } case1: arr ...

  7. MVC 小常识

    什么是MVC (模型 视图 控制器)? MVC是一个架构模式,它分离了表现与交互.它被分为三个核心部件:模型.视图.控制器.下面是每一个部件的分工: 视图是用户看到并与之交互的界面. 模型表示业务数据 ...

  8. Firefox常用插件

    一.Web浏览使用插件 1.Adblock Plus广告拦截插件:能够自动拦截很多弹出广告,同时支持右键拦截指定信息 2.惠惠购物助手支持各大购物网站商品实时价格比较,非常棒的网站购物利器,插件下载地 ...

  9. C# 绘制统计图(柱状图, 折线图, 扇形图)

    统计图形种类繁多, 有柱状图, 折线图, 扇形图等等, 而统计图形的绘制方法也有很多, 有Flash制作的统计图形, 有水晶报表生成统计图形, 有专门制图软件制作, 也有编程语言自己制作的:这里我们用 ...

  10. cocos2d-x 二进制文件的读写

    转自:http://blog.csdn.net/wolfking_2009/article/details/10616069 cocos2d-x里面的二进制文件读取的方法是有的,作者对方法封装了下,将 ...