`
gushuizerotoone
  • 浏览: 172305 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

安装thrift

阅读更多
小白装个小东西总是要搞n久 T_T

下载thrift依赖的东西
sudo apt-get install python-dev

sudo apt-get install libboost-dev automake libtool flex bison pkg-config g++



下载最新版本thrift
wget http://apache.freelamp.com/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz

tar -zxvf thrift-0.2.0-incubating.tar.gz


移到默认安装目录
cp -r thrift-0.2.0 /usr/local/   (默认安装目录?否则可能影响到生成的thrift bin文件虽然有生成,但是找不到,安装在这里的话可以生成的thrift就在/usr/local/bin里了,这时终端输入thrift就有了,否则command not found.当然/usr/local/bin原先应该设置在$PATH里)

cd /usr/local/thrift-0.2.0

./bootstrap.sh (有You should add the contents of `./aclocal/libtool.m4' to `aclocal.m4'. glibtoolize: You should add the contents of `./aclocal/ltoptions.m4' to `aclocal.m4'. glibtoolize ...关于libtoolize,不管,继续下面的命令)

./configure --with-boost=/usr/include/ 因为boost安装在/usr/include里?
非常重要:可能这里有一个关于libtool的错误Version mismatch error. This is libtool 2.2.4, but the libtool: definition of this LT_INIT comes from libtool 2.2.6. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.4 libtool: and run autoconf again.

这是由于libtool版本不一致引起的,终端输入libtool --version可以看出我们的版本是libtool 2.2.4(在/usr/bin里)。但是/usr/local/thrift-0.2.0里的libtool是2.2.6的,所以用/usr/bin的libtool复制到/usr/local/thrift-0.2.0中,覆盖原来的版本。再执行上面的./configure --with-boost=/usr/include/  命令,ok~~


sudo make

sudo make install


在终端输入thrift,有下面的东东,ok,install thrift success.
thrift bin文件在/usr/local/bin里
Usage: thrift [options] file
Options:
  -version    Print the compiler version
  -o dir      Set the output directory for gen-* packages
               (default: current directory)
  -I dir      Add a directory to the list of directories
                searched for include directives
  -nowarn     Suppress all compiler warnings (BAD!)
分享到:
评论
2 楼 yuchao86 2013-12-16  
src/ext/thrift_protocol/modules/thrift_protocol.so] Error 2

我编译0.9.1也遇到同样的错误。
1 楼 灵魂工程师 2013-10-11  
-intel-2.7/src/protocol/fastbinary.o -o build/lib.macosx-10.8-intel-2.7/thrift/protocol/fastbinary.so
Making all in rb
make[3]: Nothing to be done for `all'.
Making all in perl
Making all in test
make[4]: Nothing to be done for `all'.
/usr/bin/perl Makefile.PL MAKEFILE=Makefile-perl.mk INSTALLDIRS=vendor INSTALL_BASE=/usr/local
Writing Makefile-perl.mk for Thrift
make -f Makefile-perl.mk
cp lib/Thrift/Server.pm blib/lib/Thrift/Server.pm
cp lib/Thrift/Protocol.pm blib/lib/Thrift/Protocol.pm
cp lib/Thrift/BinaryProtocol.pm blib/lib/Thrift/BinaryProtocol.pm
cp lib/Thrift/Socket.pm blib/lib/Thrift/Socket.pm
cp lib/Thrift/FramedTransport.pm blib/lib/Thrift/FramedTransport.pm
cp lib/Thrift/BufferedTransport.pm blib/lib/Thrift/BufferedTransport.pm
cp lib/Thrift/Transport.pm blib/lib/Thrift/Transport.pm
cp lib/Thrift/HttpClient.pm blib/lib/Thrift/HttpClient.pm
cp lib/Thrift/MemoryBuffer.pm blib/lib/Thrift/MemoryBuffer.pm
cp lib/Thrift.pm blib/lib/Thrift.pm
find blib -name 'Makefile*' -exec rm -f {} \;
Making all in php
Making all in test
make[4]: Nothing to be done for `all'.
cd src/ext/thrift_protocol/ \
  && make
make[5]: *** No targets specified and no makefile found.  Stop.
make[4]: *** [src/ext/thrift_protocol/modules/thrift_protocol.so] Error 2
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

相关推荐

Global site tag (gtag.js) - Google Analytics