Skip to content

Instantly share code, notes, and snippets.

@transientlunatic
Last active October 20, 2015 09:32
Show Gist options
  • Save transientlunatic/15a69b53352b87647e6e to your computer and use it in GitHub Desktop.
Save transientlunatic/15a69b53352b87647e6e to your computer and use it in GitHub Desktop.
BurstSim Installation
#! /bin/bash
# This is a bash script to install the BurstSims environment as
# described at https://wiki.ligo.org/Bursts/BurstSimsEnvironment
NAME=burstsim
SOURCE_DIR=${HOME}/repositories
# Install PIP in the home directory
VERSION=`python -c 'import sys; print "%d.%d" % (sys.version_info[0], sys.version_info[1])'`
mkdir -p ${HOME}/local/pip-7.1.0/lib/python${VERSION}/site-packages
export PYTHONPATH=${HOME}/local/pip-7.1.0/lib/python${VERSION}/site-packages
export PATH=${HOME}/local/pip-7.1.0/bin:${PATH}
easy_install --prefix=${HOME}/local/pip-7.1.0 https://pypi.python.org/packages/source/p/pip/pip-7.1.0.tar.gz#md5=d935ee9146074b1d3f26c5f0acfd120e
# Get virtualenv and virtualenvwrapper via pip
# adds the new path definition onto the end of the .bash_profile for the user
pip install virtualenv --upgrade --user
pip install virtualenvwrapper --upgrade --user
export PATH=${HOME}/.local/bin:${PATH}
echo 'export PATH=${HOME}/.local/bin:${PATH}' >> ${HOME}/.bash_profile
echo 'export WORKON_HOME=~/Envs' >> ${HOME}/.bash_profile
mkdir -p $WORKON_HOME
# Removed the virtualenvwrapper startup line, because CIT doesn't like it
#echo 'source ${HOME}/.local/bin/virtualenvwrapper.sh' >> ${HOME}/.bash_profile
source ${HOME}/.local/bin/virtualenvwrapper.sh
source $HOME/.bash_profile
// Clean the python environment !! is this required??
unset PYTHONPATH
# set up a new virtualenv
mkvirtualenv $NAME
# switch into the new venv
workon $NAME
#######################
# INSTALL LALSUITE #
#######################
# Install numpy et al
pip install "numpy>=1.6.4" unittest2 python-cjson
# M2Crypto required for data grid services
SWIG_FEATURES="-cpperraswarn -includeall -I/usr/include/openssl" pip install M2Crypto
# Clone and install LALSuite into the VENV
cd $SOURCE_DIR
#git clone https://versions.ligo.org/git/lalsuite.git
cd lalsuite
./00boot
./configure --prefix=$VIRTUAL_ENV --enable-swig-python --disable-lalstochastic --disable-lalxml --disable-lalinference --disable-laldetchar
make -j 8
make install
echo 'source ${VIRTUAL_ENV}/etc/lalsuiterc' >> ${VIRTUAL_ENV}/bin/activate
deactivate
workon $NAME
#
# PyCBC
#
cd ${HOME}
pip install http://download.pegasus.isi.edu/pegasus/4.5.2cvs/pegasus-python-source-4.5.2cvs.tar.gz
pip install git+https://github.com/ligo-cbc/[email protected]#egg=pycbc --process-dependency-links
#
# Replace PyCBC PyLAL with LALSuite PyLAL
#
cd ${SOURCE_DIR}/lalsuite/pylal
python setup.py install
#
# PyBurst
#
pip install -e git+https://github.com/cpankow/pyburst.git#egg=pyburst --process-dependency-links
# Finally...
cd $VIRTUAL_ENV/lib/python${VERSION}/site-packages
ln -s /usr/lib64/python${VERSION}/site-packages/gtk-2.0
ln -s /usr/lib64/python${VERSION}/site-packages/pygtk.py
ln -s /usr/lib64/python${VERSION}/site-packages/pygtk.pth
ln -s /usr/lib64/python${VERSION}/site-packages/pygtk.pyc
ln -s /usr/lib64/python${VERSION}/site-packages/pygtk.pyo
ln -s /usr/lib64/python${VERSION}/site-packages/gstlal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment