Skip to content

Installing External Libraries

Isaac Schifferer edited this page Nov 17, 2023 · 5 revisions

External Libraries

Some libraries used in SILNLP are not Python libraries and need to be installed separately. These do not need to be installed for SILNLP to work, but if you need to use one of them specifically, follow the corresponding instructions below.

eflomal

  1. Install dependencies.

    In a terminal, run:

    sudo apt-get update
    sudo apt-get install make
    
  2. Install eflomal.

    In a terminal, run:

    git clone https://github.com/robertostling/eflomal.git
    make -C eflomal/src
    make -C eflomal/src install
    rm -rf eflomal
    
  3. Set environment variable.

    Add the following line to your .bashrc file in your home directory:

    export EFLOMAL_PATH="/usr/local/bin"
    

fast_align

  1. Install dependencies.

    In a terminal, run:

    sudo apt-get update
    sudo apt-get install cmake make libgoogle-perftools-dev libsparsehash-dev
    
  2. Install fast_align.

    In a terminal, run:

    git clone https://github.com/clab/fast_align.git
    mkdir fast_align/build
    cmake -S fast_align -B fast_align/build
    make -C fast_align/build
    mv fast_align/build/atools fast_align/build/fast_align /usr/local/bin
    rm -rf fast_align
    
  3. Set environment variable.

    Add the following line to your .bashrc file in your home directory:

    export FAST_ALIGN_PATH="/usr/local/bin"
    

mgiza

  1. Install dependencies.

    In a terminal, run:

    sudo apt-get update
    sudo apt-get install cmake make libboost-all-dev
    
  2. Install mgiza.

    In a terminal, run:

    git clone https://github.com/moses-smt/mgiza.git
    cmake -S mgiza/mgizapp -B mgiza/mgizapp
    make -C mgiza/mgizapp
    make -C mgiza/mgizapp install
    mv mgiza/mgizapp/inst/mgiza mgiza/mgizapp/inst/mkcls mgiza/mgizapp/inst/plain2snt mgiza/mgizapp/inst/snt2cooc /usr/local/bin
    rm -rf mgiza
    
  3. Set environment variable.

    Add the following line to your .bashrc file in your home directory:

    export MGIZA_PATH="/usr/local/bin"
    

meteor

  1. Install dependencies.

    In a terminal, run:

    sudo apt-get update
    sudo apt-get install wget tar
    
  2. Install meteor.

    In a terminal, run:

    wget "https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz"
    tar -xf jdk-21_linux-x64_bin.tar.gz
    rm jdk-21_linux-x64_bin.tar.gz
    wget "http://www.cs.cmu.edu/~alavie/METEOR/download/meteor-1.5.tar.gz"
    tar -xf meteor-1.5.tar.gz
    rm meteor-1.5.tar.gz
    mv meteor-1.5/meteor-1.5.jar /usr/local/bin
    rm -rf meteor-1.5
    
  3. Set environment variable.

    Add the following line to your .bashrc file in your home directory:

    export METEOR_PATH="/usr/local/bin"