User Tools

Site Tools


lalsuite:src-install

Installing LALSuite from source

If you don't want to, or can't, use the packaged versions of LALSuite, you must install the suite from the git repository source.

Clone the repo

On the LIGO Data Grid computing clusters, you are encouraged to clone the repository on a disk local to the machine. Please see this page for instructions on choosing the correct local directory.
  1. Choose a directory in which to clone the repo
    LALSUITE_DIR=${HOME}/git # change as appropriate
  2. Clone the repository with your albert.einstein LIGO.ORG username
    git clone albert.einstein@ligo-vcs.phys.uwm.edu:/usr/local/git/lalsuite.git

    The repository can be cloned in a read-only state with no authentication via

    git clone git://ligo-vcs.phys.uwm.edu/lalsuite.git
  3. Move into the repository
    cd lalsuite

Installing with a top-level build

The following instructions describe a 'top-level' build, where all the C-based packages of LALSuite are compiled together. This is the simplest way to build if everything works, but can get complicated if there is a problem.

Configure the build

First, run the setup script

./00boot

This will return some minimal output, but should be obviously broken when it fails.

Next, configure the build. This requires a set of keyword arguments to the ./configure script. To see a list of all possible options, and their defaults, run

./configure --help

In short, you need to have

  • —-prefix /path/to/my/install, e.g. —-prefix ${HOME}/opt/lalsuite/master to install in your home directory for the specific 'master' branch of lalsuite. This allows you to install multiple branches in the same directory tree.

And you might want to add

  • —-enable-swig-python to install the SWIG-bindings for python
  • —-enable-swig-octave to install the SWIG-bindings for octave
  • —-quiet to print less verbose output during configure
  • —-enable-laldetchar to install the LALDetChar package

Once you have chosen your arguments, run the configure script. First, set the prefix path

LALSUITE_PREFIX=${HOME}/opt/lalsuite/master # change as appropriate

then run the configure, e.g:

./configure --prefix ${LALSUITE_PREFIX} --enable-swig-python --enable-laldetchar --silent

Compile and install the code

You can then compile and install the code via

make --quiet install
You can make make go a lot faster by allowing it to use more than one CPU at a time, use this code to find out how many CPUs your machine has
if [[ "${OSTYPE}" == "linux-gnu" ]]; then
    export NCPUS=$(cat /proc/cpuinfo | grep processor | wc -l)
elif [[ "${OSTYPE:0:6}" == "darwin" ]]; then
    export NCPUS=$(sysctl hw.ncpu | awk '{print $2}')
fi

then run make with another argument to use them all

make --quiet --jobs=${NCPUS} install

Installing GLUE and PyLAL

The LALSuite git repository also includes two python packages associated with the C-libraries.

Installing GLUE

The Grid LIGO User Environment is a python package that provides a bunch of tools to help data analysis on the LIGO Data Grid systems. It has no actual dependence on LAL and its friends, and should be installed on each of the LDG systems.

You can install it from the repository by moving into the directory and running the setup.py script:

cd glue
python setup.py install --prefix ${LALSUITE_PREFIX}

There aren't many options for the setup.py, but you could add –quiet before install to supress some output.

Installing PyLAL

PyLAL is a python package built on top of the LALSuite C-libraries, and is heavily dependent on the other parts of LALSuite, including GLUE and LAL.

As with GLUE, you can install it from the repository by moving into the directory and running the setup.py script:

cd pylal
python setup.py install --prefix ${LALSUITE_PREFIX}

Setting your environment

You will need to add a number of directory paths to a few environment variables so that you can easily find and use the codes you've just installed.

Each of the packages in LALSuite will have installed a script in the ${LALSUITE_PREFIX}/etc directory. It's best to manually build a script to pull them all together. Set the top-level environment script in the same directory

LALSUITERC=${LALSUITE_PREFIX}/etc/lalsuiterc

and run the following code to fill it with the correct text:

echo '#!/bin/bash
 
# define function to remove duplicates from path environment variables
cleanpath() {
    local badpath=$(eval echo \$$1)
    badpath=${badpath%%:}
    badpath="$(echo "${badpath}" | awk -v RS=":" -v ORS=":" "!a[\$1]++")"
    badpath=${badpath%%:}
    eval $1=${badpath}
    eval export $1
}
 
export LSCSOFT_LOCATION='${LALSUITE_PREFIX}'
 
# set environment for each sub-package of LALSuite
for PACKAGE in LAL LALFRAME LALMETAIO LALBURST LALINSPIRAL LALSTOCHASTIC LALPULSAR LALDETCHAR LALXML LALAPPS GLUE PYLAL; do
    lc_package=$(echo $PACKAGE | tr "[A-Z]" "[a-z]")
    PKG_ENV_SH=${LSCSOFT_LOCATION}/etc/${lc_package}-user-env.sh
    if [ -f "${PKG_ENV_SH}" ]; then
        . ${PKG_ENV_SH}
    fi
done
 
cleanpath PATH
cleanpath PYTHONPATH
cleanpath LD_LIBRARY_PATH' > ${LALSUITERC}
lalsuite/src-install.txt · Last modified: 2013/08/07 15:38 by duncan.macleod@LIGO.ORG