Skip to content

Instantly share code, notes, and snippets.

@rohitdholakia
Created November 19, 2013 07:24
Show Gist options
  • Save rohitdholakia/7541567 to your computer and use it in GitHub Desktop.
Save rohitdholakia/7541567 to your computer and use it in GitHub Desktop.

Get Moses

Assuming you want to clone a branch "b" ( highly recommended to stick to Release-1.0), do the following :

git clone -b RELEASE-1.0 https://github.com/moses-smt/mosesdecoder.git

Set up Boost

Boost is a critical component. The Moses README file says that anything >= 1.36 goes. Taking them on their word, get boost from boost.org.

./bootstrap.sh

Now, assuming you are installing boost in boostdir, do the following :

./b2 --prefix=boostdir --libdir=boostdir/lib --layout=tagged link=static,shared threading=multi,single install || echo FAILURE

This will take quite a while. You can grab lunch, yes.

So, Boost is set. Before you proceed further to set up Moses, update the following in your shell_profile.

You can find what shell you are using by running

  echo $SHELL

Assuming the above says "/bin/bash", update ~/.bashrc :

export LD_LIBRARY_PATH=$boost_dir/lib:$LD_LIBRARY_PATH
export PATH=$boost_dir:$PATH
export INCLUDE=$boost_dir/include:$INCLUDE

Either log out or login, or open another terminal window. For a sanity check, do

echo $LD_LIBRARY_PATH

Your update should show up.

Assuming you are setting up moses on $moses_dir and you have SRILM set up at $srilm_dir.

  ./bjam --with-boost=$boost_dir --with-srilm=$srilm_dir --prefix=$moses_dir -j8 --libdir=$moses_dir/lib --bindir=$moses_dir/bin --includedir=$moses_dir/include --install-scripts=$moses_dir/scripts

This will also take a while.

It is advisable to use --debug-configuration and redirect the output to a debug.log file so that possible failures can be recorded.

In theory, the above process always installs Moses. You can now set $SCRIPTS_ROOTDIR and $MOSES_DIR in your .bashrc file and start using Moses.

Note:

Orcinus also has the same process, but, Orcinus is due for an upgrade in December. An upgrade generally means that there is a libstdc++ 32bit error, or giza++/mgiza raises a 32/64 bit error. In such cases, I found support@westgrid immensely helpful.

Note 2:

Ramtin recently set up cdec and Boost was misbehaving. Turns out Boost 1.53 has some libraries missing when compared to 1.44 and that was causing havoc. He will write his own account of getting cdec to work on grex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment