How to install LAL and LALApps software
Contents
Introduction
This document provides step-by-step instructions for installing LAL and LALApps from the current CVS HEAD version.
Before using these instructions, be sure that all of the required LSC software is installed. If you are using Fedora, Red Hat or Debian Linux and have root access (or access to a sysadmin), it is recommended that you follow the instructions at Download > Repositories [ HTML ] to install the software on the system. It is also possible to build the software from source. Instructions for this can be found in the LSC Software Installation HOWTO [ HTML ] or in other formats from the DASWG howto section.
If you are using a C-shell [tcsh] rather than a Bourne shell [bash], the syntax for setting shell variables is slightly different. Instead of
VARIABLE=valueyou will need to type
setenv VARIABLE value
Before you start
Make sure that your environment variables are set appropriately. If you are building LAL/LALApps on one of the LIGO Data Grid clusters, this should be true by default. If you are building on your own system where the software has been installed using the binary distributions mentioned above, then it should simply require you to follow the instructions for FC2/3/4 RedHat Debian.
These instructions require a few more environment variables to be set to specify where you want to install LAL and LALApps, where you want to build LAL and LALApps, and your LSCSoft CVS username.
If you have an account on the lscsoft CVS pserver, you can use this account by setting LSCSOFT_USER to your user name. Otherwise you will obtain LAL from the repository as user anonymous. More information can be found in the LSCSoft CVS Archive HOWTO.
Note to LSCsoft repository users: If you installed LAL/LALApps as part of the LSCsoft repository install, before continuing, you should create a files called .nolscsoft-lal and .nolscsoft-lalapps in your home directory by running
cd ${HOME}
touch ~/.nolscsoft-lal
touch ~/.nolscsoft-lalapps
Log out and log back in again;
this will disable the versions of LAL/LALAPPS that are installed by the LSCSoft
repository. You can find more information about this in the LSCSOFT Repository Howto
You also need to set the variable LAL_PREFIX and LALAPPS_PREFIX to be the location to install LAL. If this variable is unset, LAL/LALAPPS will be installed in $HOME/head/opt/lscsoft/lal and $HOME/head/opt/lscsoft/lalapps. The commands listed below are appropriate for a Bourne-shell (e.g., bash); they will need to be modified appropriately for C-shells (e.g., tcsh). Suggestion: if you're using tcsh, just type bash and cut-and-paste the commands into your terminal.
LSCSOFT_USER=${LSCSOFT_USER:-"anonymous"} # change as appropriate
LSCSOFT_SRCDIR=${LSCSOFT_SRCDIR:-"${HOME}/head/src/lscsoft/"} # change as appropriate
LSCSOFT_ROOTDIR=${LSCSOFT_ROOTDIR:-"${HOME}/head"} # change as appropriate
LAL_PREFIX=${LAL_PREFIX:-"${LSCSOFT_ROOTDIR}/opt/lscsoft/lal"} # change as appropriate
LALAPPS_PREFIX=${LALAPPS_PREFIX:-"${LSCSOFT_ROOTDIR}/opt/lscsoft/lalapps"} # change as appropriate
Download LAL and LALApps from CVS
Note: make sure that you have set the environment variables LSCSOFT_USER and LSCSOFT_SRCDIR if you have not yet done so:
LSCSOFT_USER=${LSCSOFT_USER:-"anonymous"} # change as appropriate
LSCSOFT_SRCDIR=${LSCSOFT_SRCDIR:-"${HOME}/head/src/lscsoft/"} # change as appropriate
This is where the source code for lal will be put. If you are working on one of the LDG clusters, it is recommended that you put the source code into a local directory. For the LDAS clusters, this requires setting
LSCSOFT_SRCDIR=/usr1/${USER}/head/src/lscsoft/
For nemo at UWM,
LSCSOFT_SRCDIR=/people/${USER}/head/src/lscsoft/
First you will need to create the directory for LAL and LALApps sources.
mkdir -p ${LSCSOFT_SRCDIR}
Now you will need to login to the
LSCSoft CVS repository
pserver. You only need to do this once:
cvs -d:pserver:${LSCSOFT_USER}@gravity.phys.uwm.edu:2402/usr/local/cvs/lscsoft login
when prompted, enter the password. If you are anonymous the password
is lscsoft. Now check-out the LAL and LALApps repositories.
cd ${LSCSOFT_SRCDIR}
cvs -d:pserver:${LSCSOFT_USER}@gravity.phys.uwm.edu:2402/usr/local/cvs/lscsoft co lal
cvs -d:pserver:${LSCSOFT_USER}@gravity.phys.uwm.edu:2402/usr/local/cvs/lscsoft co lalapps
In order to check out a tagged version of the libraries with a the name TAG, type
cvs -d:pserver:${LSCSOFT_USER}@gravity.phys.uwm.edu:2402/usr/local/cvs/lscsoft co -r TAG lal
cvs -d:pserver:${LSCSOFT_USER}@gravity.phys.uwm.edu:2402/usr/local/cvs/lscsoft co -r TAG lalapps
Build and install LAL
Note: make sure that you have set the environment variables LSCSOFT_SRCDIR, LSCSOFT_ROOTDIR and LAL_PREFIX if you have not yet done so:
LSCSOFT_SRCDIR=${LSCSOFT_SRCDIR:-"${HOME}/head/src/lscsoft/"} # change as appropriate
LSCSOFT_ROOTDIR=${LSCSOFT_ROOTDIR:-"${HOME}/head"} # change as appropriate
LAL_PREFIX=${LAL_PREFIX:-"${LSCSOFT_ROOTDIR}/opt/lscsoft/lal"} # change as appropriate
Now enter into the lal directory and boot, configure, build, and install LAL.
cd ${LSCSOFT_SRCDIR}/lal
./00boot
./configure --prefix=${LAL_PREFIX}
make
make install
To setup your environment to use the newly-built LAL, we recommend
creating a setup script that you can source when you need to. For
advanced users, this method allows for the installation of multiple
versions without problems. For beginners, it allows for easier
debugging by others in the case of problems. To setup your environment
to use the software that has been installed please do the following if
you use a bourne shell (e.g. bash):
mkdir -p ${LSCSOFT_ROOTDIR}/etc
echo "export LSCSOFT_LOCATION=${LSCSOFT_ROOTDIR}/opt/lscsoft" > ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "# setup LAL for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "export LAL_LOCATION=\$LSCSOFT_LOCATION/lal" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if [ -f "\$LAL_LOCATION/etc/lal-user-env.sh" ]; then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$LAL_LOCATION/etc/lal-user-env.sh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "fi" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
If you are using a C shell (e.g., tcsh), instead add these lines to
your .login:
mkdir -p ${LSCSOFT_ROOTDIR}/etc
echo "setenv LSCSOFT_LOCATION ${LSCSOFT_ROOTDIR}/opt/lscsoft" > ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "# setup LAL for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "setenv LAL_LOCATION \$LSCSOFT_LOCATION/lal" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if ( -r \$LAL_LOCATION/etc/lal-user-env.csh ) then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$LAL_LOCATION/etc/lal-user-env.csh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "endif" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
To set up LAL, you do
source ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
You can also test that it worked by doing
lal-versionwhich should give output something like
marlin:~> lal-version LAL Version: 5.2 CVS Tag: Build Date: 2008-04-17T05:45:39-0500 Configure Date: 2008-04-17T05:32:44-0500 Configure Arguments: '--prefix=/home/patrick/head/opt/lscsoft/lal' (RCS $Id: lal-install.html,v 1.67 2008/04/22 08:08:55 mckechan Exp $)
Note to LSCsoft repository users: If you installed LAL as part of the LSCsoft repository install, before continuing, you should create a file called .nolscsoft-lal in your home directory by running
touch ~/.nolscsoft-lalThis will disable the version of LAL that is installed by the LSCSoft repository when you log out and log back in.
Build and install LALApps
First, make sure that your environment is setup to find the LAL that you have just installed. This means sourcing the user environment scripts in your current shell (unless you have already). If you are using a Bourne shell, do
. ${LAL_PREFIX}/etc/lal-user-env.sh
and if you are using a C shell do
source ${LAL_PREFIX}/etc/lal-user-env.csh
Make sure that you have set the environment variables
LSCSOFT_SRCDIR, LSCSOFT_ROOTDIR and
LALAPPS_PREFIX if you have not yet done so:
LSCSOFT_SRCDIR=${LSCSOFT_SRCDIR:-"${HOME}/head/src/lscsoft/"} # change as appropriate
LSCSOFT_ROOTDIR=${LSCSOFT_ROOTDIR:-"${HOME}/head"} # change as appropriate
LALAPPS_PREFIX=${LALAPPS_PREFIX:-"${LSCSOFT_ROOTDIR}/opt/lscsoft/lalapps"} # change as appropriate
Now enter into the lalapps directory and boot, configure, build, and install LALApps.
cd ${LSCSOFT_SRCDIR}/lalapps
./00boot
./configure --prefix=${LALAPPS_PREFIX} --enable-condor
make
make install
Note, the --enable-condor will condor_compile
the code for use with Condor. If you do not have Condor installed or
condor_compile is not in your path, then simply remove
the --enable-condor option from the configure line above.
To setup your environment to use the newly-built LALApps, we recommend appending the following to the lscsoftrc setup script described above in the LAL section. For advanced users, this method allows for the installation of multiple versions without problems. For beginners, it allows for easier debugging by others in the case of problems. The commands here assume you have completed the corresponding part described in the LAL build section. To setup your environment to use the software that has been installed please do the following if you use a bourne shell (e.g. bash):
echo "# setup LALApps for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "export LALAPPS_LOCATION=\$LSCSOFT_LOCATION/lalapps" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if [ -f "\$LALAPPS_LOCATION/etc/lalapps-user-env.sh" ]; then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$LALAPPS_LOCATION/etc/lalapps-user-env.sh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "fi" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
If you are using a C shell (e.g., tcsh), instead add these lines to
your .login:
echo "# setup LALApps for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "setenv LALAPPS_LOCATION \$LSCSOFT_LOCATION/lal" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if ( -r \$LALAPPS_LOCATION/etc/lalapps-user-env.csh ) then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$LALAPPS_LOCATION/etc/lalapps-user-env.csh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "endif" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
To set up LAL/LALApps, you do
source ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
You can also test that it worked by doing
lalapps_versionwhich should give output something like
marlin:lalapps> lalapps_version Condor: Notice: Will checkpoint to lalapps_version.ckpt Condor: Notice: Remote system calls disabled. LALApps Version: 5.2 CVS Tag: Configure Date: 2008-04-17T06:16:03-0500 Configure Arguments: '--prefix=/home/patrick/head/opt/lscsoft/lalapps' '--enable-condor' (RCS $Id: lal-install.html,v 1.67 2008/04/22 08:08:55 mckechan Exp $) LAL Version: 5.2 CVS Tag: Build Date: 2008-04-17T05:45:39-0500 Configure Date: 2008-04-17T05:32:44-0500 Configure Arguments: '--prefix=/home/patrick/head/opt/lscsoft/lal' (RCS $Id: lal-install.html,v 1.67 2008/04/22 08:08:55 mckechan Exp $)
Download and install PyLAL
You must ensure that your environment is setup to find the LAL that you have just installed, for details see the Build and install LALApps section. Also, ensure that you are logged in to the CVS repository as instructed in the Download LAL and LALApps from CVS section. Now, checkout the PyLAL repository:
cd ${LSCSOFT_SRCDIR}
cvs -d:pserver:${LSCSOFT_USER}@gravity.phys.uwm.edu:2402/usr/local/cvs/lscsoft co pylal
Before installing PyLAL, you must determine which version of python you have installed. Type:
python -VOn some operating systems (e.g. Red Hat 7.3) the program named python runs python version 1 and the version 2 executable is named python2. If python -V does not return 2.2 or greater, type:
python2 -VIf you do not have version 2.2 or greater installed, contact your system administrator for help installing Python.
Set the environment variable PYTHON to be the name of your python version 2 executable. For example if your executable is named python, bash or sh users should type:
export PYTHON=pythonIf your executable is named python2, bash or sh users should type:
export PYTHON=python2Choose where you wish to install PyLAL, enter into the pylal directory and install PyLAL.
PYLAL_PREFIX=${LSCSOFT_ROOTDIR}/opt/lscsoft/pylal # change as appropriate
cd ${LSCSOFT_SRCDIR}/pylal
${PYTHON} setup.py install --prefix=${PYLAL_PREFIX}
To setup your environment to use the newly-built PyLAL, we recommend appending the following to the lscsoftrc setup script described above in the LAL section. For advanced users, this method allows for the installation of multiple versions without problems. For beginners, it allows for easier debugging by others in the case of problems. The commands here assume you have completed the corresponding part described in the LAL build section. To setup your environment to use the software that has been installed please do the following if you use a bourne shell (e.g. bash):
echo "# setup PyLAL for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "export PYLAL_LOCATION=\$LSCSOFT_LOCATION/pylal" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if [ -f "\$PYLAL_LOCATION/etc/pylal-user-env.sh" ]; then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$PYLAL_LOCATION/etc/pylal-user-env.sh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "fi" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
If you are using a C shell (e.g., tcsh), instead add these lines to
your .login:
echo "# setup PyLAL for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "setenv PYLAL_LOCATION \$LSCSOFT_LOCATION/pylal" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if ( -r \$PYLAL_LOCATION/etc/pylal-user-env.csh ) then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$PYLAL_LOCATION/etc/pylal-user-env.csh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "endif" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
To set up LAL/LALApps/PyLAL, you do
source ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
Download and install GLUE
In general, you should not need to install GLUE. These instructions are here for completeness. You must ensure that your environment is setup to find the LAL that you have just installed, for details see the Build and install LALApps section. Also, ensure that you are logged in to the CVS repository as instructed in the Download LAL and LALApps from CVS section. Now, checkout the GLUE repository:
cd ${LSCSOFT_SRCDIR}
cvs -d:pserver:${LSCSOFT_USER}@gravity.phys.uwm.edu:2402/usr/local/cvs/lscsoft co glue
Choose where you wish to install GLUE, enter into the glue directory and install GLUE.
GLUE_PREFIX=${LSCSOFT_ROOTDIR}/opt/lscsoft/glue # change as appropriate
cd ${LSCSOFT_SRCDIR}/glue
${PYTHON} setup.py install --prefix=${GLUE_PREFIX}
To setup your environment to use the newly-built GLUE, we recommend appending the following to the lscsoftrc setup script described above in the LAL section. For advanced users, this method allows for the installation of multiple versions without problems. For beginners, it allows for easier debugging by others in the case of problems. The commands here assume you have completed the corresponding part described in the LAL build section. To setup your environment to use the software that has been installed please do the following if you use a bourne shell (e.g. bash):
echo "# setup GLUE for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "export GLUE_LOCATION=\$LSCSOFT_LOCATION/glue" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if [ -f "\$GLUE_LOCATION/etc/glue-user-env.sh" ]; then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$GLUE_LOCATION/etc/glue-user-env.sh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "fi" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
If you are using a C shell (e.g., tcsh), instead add these lines to
your .login:
echo "# setup GLUE for development: " >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "setenv GLUE_LOCATION \$LSCSOFT_LOCATION/glue" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "if ( -r \$GLUE_LOCATION/etc/glue-user-env.csh ) then" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo " source \$GLUE_LOCATION/etc/glue-user-env.csh" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
echo "endif" >> ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
To set up LAL/LALApps/PyLAL/GLUE, you do
source ${LSCSOFT_ROOTDIR}/etc/lscsoftrc
Important pet tricks
The advanced user may wish to configure and compile LAL and LALApps in some custom manner. Here are some common things you may wish to do.Configure LAL and LALApps for code development
It is recommended that the --with-gcc-flags configure flag be used when developing code for LAL and LALApps (while using the gcc compiler). This enables a number of warning messages. Code contributed to LAL and LALApps should be warning free when configured with the --with-gcc-flags configure flag. To use this flag, simply configure both LAL and LALApps with the command
./configure --prefix=${LAL_PREFIX} --with-gcc-flags
for LAL and
./configure --prefix=${LALAPPS_PREFIX} --with-gcc-flags
for LALApps (and do a make and make install as before).
Configure LAL in production mode
For performance optimization, it is important to turn off many of the debugging features of LAL. This can be done with the configure flag --disable-debug when configuring LAL:
./configure --prefix=${LAL_PREFIX} --disable-debug
(and do a make and make install as before). This should
be done whenever installing LAL for data analysis production work, but not for
code development. (This is done when LAL RPMs are built.)
Configure multiple LAL/LALapps installs from one source directory
For testing or development you may wish to install a production version of LAL/LALapps as well as a development version. The safest way to do this is to create separate directories in which to configure each version. First it is important to clean up any previous configuration of LAL by running make distclean in the source directory:
cd ${LSCSOFT_SRCDIR}/lal
make distclean
Then create a directory to configure your production version of LAL:
mkdir -p configureProduction cd configureProductionWithin that directory run configure with the desired arguments:
../configure --prefix=${LAL_PREFIX_PRODUCTION} --disable-debug
Create another directory, in the LAL source directory, for the development
version and configure in the same way:
cd ${LSCSOFT_SRCDIR}/lal
mkdir -p configureDevelopment
cd configureDevelopment
../configure --prefix=${LAL_PREFIX_DEVELOPMENT} --with-gcc-flags
You can then install each version of LAL separately by running make and make install in the directories
${LSCOSFT_SRCDIR}/lal/configureProduction and
${LSCOSFT_SRCDIR}/lal/configureDevelopment respectively.
You may wish to create two separate files from which to source the environment variables for each version e.g., ${LSCSOFT_ROOTDIR}/etc/lscsoftrcProduction and ${LSCSOFT_ROOTDIR}/etc/lscsoftrcDevelopment .
For lalapps you should repeat the above steps in the lalapps source directory. However, you must make sure you have sourced the correct environment variables from the corresponding LAL installation:
cd $LSCSOFT_SRCDIR/lalapps make distclean
source ${LSCSOFT_ROOTDIR}/etc/lscsoftrcProduction
mkdir -p configureProduction
cd configureProduction
../configure --prefix={LALAPPS_PREFIX_PRODUCTION} --disable-debug
cd $LSCSOFT_SRCDIR/lalapps
source ${LSCSOFT_ROOTDIR}/etc/lscsoftrcDevelopment
mkdir -p configureDevelopment
cd configureDevelopment
../configure --prefix={LALAPPS_PREFIX_DEVELOPMENT} --with-gcc-flags
Notes:
- The commands make and make install should be run from within the directory in which you configured LAL.
- You will need to create separate lscsoftrc files for the environment variables for each version of LAL/LALapps that you install.
- Make sure you have sourced the correct version of LAL before configuring and installing LALapps.
Configure LALApps to run under Condor
If you are running a LALApps program under condor, it should be compiled with condor_compile. LALApps has a configure flag to accomplish this. First make sure that condor_compile is in your path. To do this typewhich condor_compileand this should indicate the program that is first in your path. If you get a message indicating that condor_compile is not in your path, you will need to install Condor on your system (or locate it on your system and setup your environment appropriately). This can be done by installing the LSC DataGrid Client.
Once you have condor_compile on your system, simply configure LALApps with the command
./configure --prefix=${LALAPPS_PREFIX} --enable-condor
(and do a make and make install as before).
Configure LALApps to build static programs
If you add the option--with-extra-ldflags="-static -all-static"
to the configure for lalapps, it will build completely static executables. This will work for gcc. It has not been tested thoroughly with other compilers. The -all-static option tells gcc to really make the exectuables static by linking in glibc as well.
If you only specify -static then it will link everything other than glibc statically, which it links dynamically.
This means that the executables aren't portable between redhat 7.3 and redhat 9, for example, since glibc changes.
If you are condor compiling your code (i.e. adding --enable-condor to the lalapps configure), then the executables will be static without adding the extra ldflags.
(the above info was kindly provided by Duncan)
Building documentation
This is as simple as runningmake dviafter building LAL or LALApps. The documentation will be in the doc subdirectory of LAL or LALApps. To build the documentation you must have a working latex or pdflatex in your path. Note: if you want to build the documentation before building LAL, you only need to build the laldoc program. In this case you simply need to do
cd doc make cd .. make dviLALApps does not need laldoc so the documentation can be built before building LALApps.
Building doxygen documentation
This is not yet integrated into the rest of the build system.cd doc/doxygen makeIf you wish to customize the output, edit the file lal-doxy.cfg in this directory.