Skip to content

Instantly share code, notes, and snippets.

@noisychannel
Last active February 24, 2016 16:54
Show Gist options
  • Save noisychannel/05adabcf2b39ea2ce2c2 to your computer and use it in GitHub Desktop.
Save noisychannel/05adabcf2b39ea2ce2c2 to your computer and use it in GitHub Desktop.
Makefile to install stuff on new machines/clusters
DATADIR=/export/ws15-mt-data/gkumar
ROOT=/home/gkumar/.local
MAX_THREADS=6
BOOST_DL=http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.55.0%2F&ts=1389613041&use_mirror=kent
CMPH_DL=http://downloads.sourceforge.net/project/cmph/cmph/cmph-2.0.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fcmph%2F&ts=1456331818&use_mirror=iweb
VIMCONFIG_DL=https://github.com/noisychannel/VIMconfig
all: new vim boost moses
new:
mkdir -p ${DATADIR}/tmp
mkdir -p ${DATADIR}/.local
mkdir -p ${DATADIR}/opt
cd ${DATADIR}/tmp
git clone https://github.com/noisychannel/bash_template
cd bash_template
make
cd ..
rm -rf bash_template
# Add datadir to bashrc
echo "alias gkumar='cd ${DATADIR}'" >> $$HOME/.bashrc
git:
git config --global color.ui auto
git config --global user.name "Gaurav Kumar"
git config --global user.email "gaurav.bison@gmail.com"
boost: new
cd ${DATADIR}/opt
wget ${BOOST_DL}
mv boost*tar.gz* boost.tar.gz 2>/dev/null
tar xvzf boost.tar.gz
mv boost* boost
cd boost
./bootstrap.sh
./b2 -j${MAX_THREADS} --prefix=$$PWD --libdir=$$PWD/lib64 --layout=system link=static install || echo FAILURE
rm ../boost.tar.gz
vim: new
cd
git clone ${VIMCONFIG_DL}
mv VIMconfig .vim
ln -s .vim/.vimrc .
cd .vim
git submodule update --init --recursive
cmph: new
cd ${DATADIR}/tmp
wget ${CMPH_DL}
mv cmph*tar.gz* cmph.tar.gz 2>/dev/null
tar xvzf cmph.tar.gz
cd cmph-2.0
./configure --prefix=${ROOT}
make
make install
cd ..
rm -rf cmph-2.0
moses: new boost cmph
# Install Moses
mkdir -p ${DATADIR}/code
cd ${DATADIR}/code
git clone https://github.com/moses-smt/mosesdecoder.git
cd mosesdecoder
./bjam --with-boost=${DATADIR}/opt/boost --with-cmph=${ROOT} -j${MAX_THREADS}
#./bjam --with-nplm=/export/a04/gkumar/code/nplm --with-cmph=/home/gkumar/.local -j20
echo "export MOSES=${DATADIR}/code/mosesdecoder" >> $$HOME/.bashrc
echo "alias tokenizer='$$MOSES/scripts/tokenizer/tokenizer.perl'" >> $HOME/.bashrc
echo "alias lowercase='$$MOSES/scripts/tokenizer/lowercase.perl'" >> $HOME/.bashrc
# Install MGIZA
cd ${DATADIR}/tmp
git clone https://github.com/moses-smt/mgiza.git
cd mgiza/mgizapp
sed -i "s:BOOST_ROOT=.*:BOOST_ROOT=${DATADIR}/opt/boost:;s:SRC_DIR=.*:SRC_DIR=${DATADIR}/tmp/mgiza/mgizapp/src:" manual-compile/compile.sh
cmake .
make
make install
mkdir -p $$MOSES/tools
cp bin/* $$MOSES/tools
cp scripts/merge_alignment.py $$MOSES/tools
cd ${DATADIR}/tmp
rm -rf mgiza
# Install Fast-align
git clone https://github.com/clab/fast_align.git
cd fast_align
mkdir build
cd build
cmake ..
make
cp fast_align atools force_align.py $$MOSES/tools
cd ..
rm -rf fast_align
python: new
# Install new pip
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
rm get-pip.py
# Install numpy, scipy, theano
pip install --user --upgrade numpy
pip install --user --upgrade scipy
pip install --user --upgrade theano
# Get the theanorc file
git clone https://gist.github.com/049acfdba3ea960ab061.git
cp 049acfdba3ea960ab061/.theanorc $$HOME
rm -rf 049acfdba3ea960ab061
cnn: new
cd ${DATADIR}/code
hg clone https://noisychannel@bitbucket.org/eigen/eigen
cd eigen
hg pull && hg update 3.2
cd ..
git clone https://github.com/clab/cnn.git
cd cnn
mkdir build
cd build
cmake .. -DEIGEN3_INCLUDE_DIR=${DATADIR}/code/eigen
make -j${MAX_THREADS}
gcc:
tar xzf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment