LoginSignup
4
3

More than 5 years have passed since last update.

Mosesのマニュアルインストール

Last updated at Posted at 2016-04-26

学校の共用計算機などを利用する際に、マニュアルインストールを要する場合がある。
基本的には公式のマニュアルインストールに則れば良い。
そのときの備忘録。

学校の計算機の環境
- OS:Red Hat Enterprise Linux Server release 6.7
- 1プロセスで最大16スレッド
- boostはインストールされておらず、ライブラリなどはおそらくほぼ標準構成

おそらくREHEL6系なら以下の手順でインストール可能なはず。

--

boostのインストール

任意のディレクトリ(ここでは、$HOME/env以下)にインストールする。

mkdir moses_install_src
cd moses_install_src

wget http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2

tar zxvf boost_1_60_0.tar.bz2
./b2 install -j16 --prefix=$HOME/env --libdir=$HOME/env/lib64 --layout=system link=static

mosesのインストール

cd moses_install_src
git clone https://github.com/moses-smt/mosesdecoder.git
cd mosesdecoder

# 先ほどインストールしたboostのパスを指定
./bjam --with-boost=$HOME/env -j16
# 16はコア数

単語アラインメントツール

mgizaのインストール

cd moses_install_src
git clone https://github.com/moses-smt/mgiza.git
cd mgiza

# BOOSTのパスをCMakeLists.txtに追加
emacs CMakeLists.txt

Boostのパスを追記

CMakeLists.txt
49:# BOOST_ROOT=/e/programs/boost_1_35_0
50:# BOOST_LIBRARYDIR=$BOOST_ROOT/stage/lib
51:set(BOOST_ROOT $HOME/boost_1_60_0)
52:set(BOOST_LIBRARYDIR $BOOST_ROOT/libs)

コンパイルしてコピー

cmake . -DCMAKE_INSTALL_PREFIX=$/env
cp ~/moses_install_src/mgiza/mgizapp/bin/{mgiza,mkcls,snt2cooc} ~/moses_install_src/mosesdecoder/tools

--

良きMosesライフを!

学校で利用する際にハマったこと

学校のバッチキューシステム(PBS)で利用する際に、環境変数でハマった。
ジョブファイルにも変数を書く必要がある。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3