解压
tar zxvf thrift-0.12.0.tar.gz -C /usr/local/src
cd /usr/local/src/thrift-0.12.0
引导时报错,Ubuntu缺少libtool这个工具
# ./bootstrap.sh
Couldn't find libtoolize!
解决,由于系统是最小化安装默认缺少了很多编译工具,可以都安装上
sudo apt install libtool automake build-essential flex bison libboost-dev libssl-dev -y
编译过程中报下面的错误,缺少Qt相关包
# ./configure --prefix=/usr/local/thrift-0.12
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
......
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking whether ln -s works... yes
checking for gawk... (cached) mawk
checking for ranlib... (cached) ranlib
checking whether g++ supports C++11 features with -std=c++11... yes
./configure: line 18567: syntax error near unexpected token `QT,'
./configure: line 18567: ` PKG_CHECK_MODULES(QT, QtCore >= 4.3, QtNetwork >= 4.3, have_qt=yes, have_qt=no)'
解决
sudo apt install pkgconf
sudo autoreconf -I /usr/share/aclocal
重新编译成功类似这个样子的
thrift 0.12.0
Building C (GLib) Library .... : no
Building C# (Mono) Library ... : no
Building C++ Library ......... : no
Building Common Lisp Library.. : no
Building D Library ........... : no
Building Dart Library ........ : no
Building dotnetcore Library .. : no
Building Erlang Library ...... : no
Building Go Library .......... : no
Building Haskell Library ..... : no
Building Haxe Library ........ : no
Building Java Library ........ : no
Building Lua Library ......... : no
Building NodeJS Library ...... : no
Building Perl Library ........ : no
Building PHP Library ......... : no
Building Plugin Support ...... : no
Building Python Library ...... : yes
Building Py3 Library ......... : no
Building Ruby Library ........ : no
Building Rust Library ........ : no
Python Library:
Using Python .............. : /usr/bin/python3
Using Python version ...... : Python 3.5.2
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 -j4 && make install
做软链
ln -s thrift-0.12/ thrift
版本查看
# ./bin/thrift --version
Thrift version 0.12.0
版权声明:本文为xiaobao7865原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。