Building libAIR

Quick-start for V0.18


These simplest instructions do not bind against CASA and therefore do not build the wvrgcal program. (I.e., the –disable-casawvr option is used to turn-off building against CASA). If you want wvrgcal look at the next subsection

Assuming dependencies, etc are all OK on your computer, this is all you should need to do:

# Obviously change this to approriate directory for your computer
export INSTALLDIR=/home/bnikolic/temp/libairtest

export BNMINVER=bnmin1-1.11
export LIBAIRVER=libair-0.18

# Install BNMin1 
tar xjvf ${BNMINVER}.tar.bz2
./configure --disable-pybind --prefix=$INSTALLDIR --with-boost=$PREREQPATH
make && make install && cd ..

# Install libAIR
wget -nc${LIBAIRVER}.tar.bz2
tar xjvf ${LIBAIRVER}.tar.bz2
PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig:$PREREQPATH/lib/pkgconfig \
./configure --prefix=$INSTALLDIR --with-boost=$PREREQPATH --disable-pybind
make && make install && cd ..

Doesn’t work? Consult below for answers

Quick-start for ALMA

I have installed libAIR on the sco-red and osf-red computers at ALMA. Here are the notes on how to do that.

# First, if suitable versions are not present, we need to install GSL
# and Boost. This takes a while but is entirely automated.  Please
# look at the page:

# Install CASA if needed: (see for version info)
wget -c
tar xzvf casapy-stable-31.0.13362-001-64b.tar.gz

export CASAPATH=/users/bnikolic/p/bnmain/casapy-stable-31.0.13362-001-64b/

# This is where all the pre-requists go
export PREREQPATH=/users/bnikolic/p/prereqs

# Except boost which is now separate
export BOOSTPATH=/users/bnikolic/p/prereqs

# Setup the installation directory -- all pre-requisites and the
# package itself will go there.

export BNMINVER=bnmin1-1.11
export LIBAIRVERNO=1.0

export INSTALLDIR=/users/bnikolic/p/wvr-${LIBAIRVERNO}

# Next up the actual software used by WVRGCAL

cd /users/bnikolic/p
mkdir $INSTALLDIR-src

# Install BNMin1 
tar xjvf ${BNMINVER}.tar.bz2
(cd ${BNMINVER} &&
 ./configure --disable-pybind --prefix=$INSTALLDIR --with-boost=$BOOSTPATH &&
 make && make install && cd ..)

# Install libAIR

wget -nc${LIBAIRVER}.tar.bz2
tar xjvf ${LIBAIRVER}.tar.bz2
(cd ${LIBAIRVER} &&
 PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig:$PREREQPATH/lib/pkgconfig \
 ./configure --prefix=$INSTALLDIR --with-boost=$BOOSTPATH --disable-pybind --with-casa=$CASAPATH \
 --with-hdf5=$PREREQPATH &&
 make && make install && cd ..)

(rm /users/bnikolic/p/wvr-latest; ln -s $INSTALLDIR /users/bnikolic/p/wvr-latest)

More detailed notes


libAIR currently has only one dependency, BNMin1 which a minimisation/inference library.


Please see the page BNMin1 for general information about BNMin1, where to download it and how to build it.

With the current configuration of the appcd computer in Cambridge, there are two depenencies of BNMin1 which are not satisfied:

  • GSL – no version is installed
  • SWIG – installed version is too old

The script below shows how to build these dependencies and BNMin1 itself:

# Destination directory -- you can place all components into a single
# tree OR separate them if you wish. In this example everything goes
export INSTALLDIR=/users/bnikolic/p/bnmain

# First install GSL -- obviously this is only necessary if a
# reasonably recent version of GSL is not already available on the
# system
tar xzvf gsl-1.13.tar.gz
cd gsl-1.13
./configure --prefix=$INSTALLDIR
make && make install && cd ..

# Install swig. 
wget ""
tar xzvf swig-1.3.40.tar.gz
cd swig-1.3.40
./configure --prefix=$INSTALLDIR
make && make install && cd ..

# Install BNMin1 proper
tar xjvf bnmin1-1.10.tar.bz2
cd bnmin1-1.10
make && make install && cd ..


Maintainer build

This is what you need to do if you access the source code repository directly rather than downloading a tar-ball.

The command to get the source code using bzr is:

bzr branch sftp://appcs/home/bn204/public_bzr/libair

The sequence of commands to do the actual build of the main library is:

export INSTALLDIR=/home/bnikolic/d/p/bnmain

# Only needed after making a fresh checkout from the source code
# repository
autoreconf -i
# Only needed after big changes to the makefiles, or on first checkout
./configure --prefix=$INSTALLDIR

Accessing MS & MSDump

LibAIR has an experimental program to access the measurement set, extract information relevant for testing of phase correction and save it a file in HDF5 format. The propose of this program is to avoid CASA as a dependency in the normal development cycle of phase correction algorithms.

The program named “msdump” and is located in the casawvr/test directory. It is not built by default. Instead, it is separately with using the ‘’scons’’ system (scons also being used to make casa-core and hopefully casa…).

The invoication to build the msdump program is:

scons CASACOREROOT=/home/bnikolic/d/p/cs

where CASACOREROOT is set to whatever the directory tree root is where casa core and supporting libraries were installed.