Thrfit0.11版本安装

环境准备

            yum install libtool libtool-devel libevent libevent-devel flex  byacc byacc-devel  boost boost-devel  bison bison-devel -y


下载

            wget https://github.com/apache/thrift/archive/0.11.0.tar.gz


指令执行

 ./bootstrap.sh
./configure --enable-libs=no --prefix=/home/test/
make && make install

说明 --enable-libs=no开关仅在没有lib构建的情况下构建Apache Thrift IDL编译器


configure后面可以指定如下需要编译的语言库

  --with-csharp           build the C# library [default=yes]
  --with-java             build the Java library [default=yes]
  --with-erlang           build the Erlang library [default=yes]
  --with-nodejs           build the Nodejs library [default=yes]
  --with-lua              build the Lua library [default=yes]
  --with-python           build the Python library [default=yes]
  --with-perl             build the Perl library [default=yes]
  --with-php              build the PHP library [default=yes]
  --with-php_extension    build the PHP_EXTENSION library [default=yes]
  --with-dart             build the DART library [default=yes]
  --with-ruby             build the Ruby library [default=yes]
  --with-haskell          build the Haskell library [default=yes]
  --with-go               build the Go library [default=yes]


注意

# 当make报错时,package golang.org/x/net/context: unrecognized import path "golang.org/x/net/context",可以把go关掉:
[root@node1 thrift-0.11.0]# ./configure  --with-go=no


Thrfit0.90版本安装

./configure CPPFLAGS="-I /home/dong/3thrdparty/openssl-1.0.2j/include" LDFLAGS="-ldl -L /home/dong/3thrdparty/openssl-1.0.2j/"

否则编译出错

configure: error: "Error: libcrypto required."