CentOS安裝thrift

來源:互聯網
上載者:User

 

下載thrift依賴的東西
yum -y install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel crypto-utils
openssl openssl-devel

下載最新版本thrift,網址:http://thrift.apache.org
 
tar -zxvf thrift-0.8.0.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~~
 

make
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!)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.