ThriftとBoost

巷ではHadoopが流行っているようですが

先月にTwitterがCassandraを採用というニュースがあったので

とりあえず環境だけでも作ってみた。

ここの記事を参考にさせていただきました。


Cassandra自体はインスコして立ち上げてたので省略。

環境はvm上のubuntu9.10。

で、今回はThriftとBoostのインスコについて。

まずは
Thriftを落としてコンパイル


$ wget http://ftp.riken.jp/net/apache/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
$ tar zxvf thrift-0.2.0-incubating.tar.gz
$ cd thrift-0.2.0
$ ./configure
.
.
.
checking for boostlib >= 1.33.1... configure: error: We could not detect the boost libraries (version 1.33 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.

エラー出ちゃった。

て事でboostlibのインストール。

ここからcmake版を落としてくる。


あ、cmakeが無い。。。のでインスコ


$ sudo apt-get install cmake
.
.
.

でBoostのインスコ。結構時間かかります。


$ cmake .
$ make
.
.
.
Linking CXX executable ../../bin/inspect
[100%] Built target inspec
$ sudo make install

で、今度はThrift。と思ったらまたエラー。

今度はflexが無いって。なので追加。


$ sudo apt-get install flex

今度こそThrift。


$ ./configure --with-boost=/usr/local/include/boost
$ make
$ sudo make install

とりあえず[Thrift]と[Boost]のインスコは完了。



[Thrift]
http://incubator.apache.org/thrift/

[Boost]
http://www.boost.org/



[2010/03/10] 追記
Boostをcmakeする際にPYTHON_INCLUDE_PATHがわかんねーとか言われたら
python-devをインストール


$ sudo apt-get install python-dev
Thriftのmakeでyaccが無いとか言われたら

$ sudo apt-get install bison
yaccは別にbisonじゃなくてもOkなはず