Jubatusのインストールめも(MinimalInstall)

Jubatusはリアルタイムに大規模分散上で各種機械学習手法を実行するフレームワークとのことです。詳しくはJubatusを公開しました | Preferred Researchを参照してください。

今更ですがインストールしてみます。Ubuntuの12.04で、jubatus-0.2.2です。
下記の公式ページを参考にまずは最小構成でインストールしたメモになります。
http://jubat.us/quickstart.html#minimal-install


Jubatusの最小構成でのコンパイルには

  • MessagePack:serialization library for cross-language
  • pficommon:PFIさんが開発しているC++の汎用ライブラリ
  • libevent-dev:非同期イベント通知ライブラリ
  • google-glog:application-level logging

が必要なので、これらをインストール。

MessagePackは

$ sudo aptitude install libmsgpack-dev

でインストール完了し、ibevent-devは

$ sudo aptitude install libevent-dev

でインストール完了し、google-glogも

$ sudo aptitude install libgoogle-glog-dev
Couldn't find any package whose name or description matched "libgoogle-glog-dev"
Couldn't find any package whose name or description matched "libgoogle-glog-dev"
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

でインストール完了し、、、いや、パッケージがないから失敗してる。
そこで探してみるも

$ aptitude search libgoogle
p   libgoogle-collections-java              - suite of collections and related goodies for Java 
p   libgoogle-perftools-dev                 - libraries for CPU and heap analysis, plus an effic
p   libgoogle-perftools0                    - libraries for CPU and heap analysis, plus an effic
p   libgoogle-perftools0-dbg                - libraries for CPU and heap analysis, plus an effic
p   libgooglecharts-ruby                    - Ruby library to create sexy charts using the Googl
p   libgooglecharts-ruby1.8                 - Ruby library to create sexy charts using the Googl
v   libgooglepinyin                         -                                                   
v   libgooglepinyin-dev                     -                                                   
p   libgooglepinyin0                        - Pinyin engine fork from Google Pinyin on Android  
p   libgooglepinyin0-dbg                    - Pinyin engine fork from Google Pinyin on Android -
p   libgooglepinyin0-dev                    - Pinyin engine fork from Google Pinyin on Android -

該当するパッケージが見当たらない。UbuntuUpdates.orgのlibgoogle-glog-devパッケージChangeLogにはDeleteと残されていたので、ソースからコンパイルすることにする。

$ wget http://google-glog.googlecode.com/files/glog-0.3.2.tar.gz
$ tar -zxvf glog-0.3.2.tar.gz 
$ cd glog-0.3.2/
$ ./configure
$ make
$ sudo make install

でインストール。同様にpficommonは公式ページにあるように、

$ git clone git://github.com/pfi/pficommon.git
$ cd pficommon
$ ./waf configure
$ ./waf build
$ sudo ./waf install

でインストール。これで最小環境に必要なものはそろったので、

$ git clone git://github.com/jubatus/jubatus.git
$ cd jubatus
$ ./waf configure --disable-re2
$ ./waf build
# sudo ./waf install

コンパイルして、いざ実行

$ jubaclassifier
jubaclassifier: error while loading shared libraries: libjubatus_framework.so: cannot open shared object file: No such file or directory

とライブラリが読み込めていないので

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

と実行して(設定用シェルスクリプトに追記して)

$ jubaclassifier -v
jubatus-0.2.2 (jubaclassifier)

とすると実行できたみたいです。

次は周辺パッケージを含めてインストールして、何かサンプルを作るところまではやっておきたいなと。

前々からやりたかったのですが、Linuxスキルが弱かったためいつもインストールでこけて断念していました。
間違い等ありましたらコメント頂けると幸いです。


MachineLearningの各種手法のうち、オンライン型に変形できる手法はどんどん実装していくこととなれば、リアルタイム性を兼ね備えたインテリジェンスな仕組みを構築する障壁が一気に下がるということで、今後が楽しみですね。