Download & building of the radiospec package

Quick-start for V1.0

Assuming dependencies, etc are all OK on your computer, the following script should be all you need to do. Note however that the radiospec is built in the “build” sub-directory of the directory you installed it to and is not installed – this is because you must modify at least some of the scripts to derive any new results with it.

# Destination directory, obviously adjust 
export INSTALLDIR=/home/bnikolic/temp/rsbuildtest

# Install BNMin1 
wget http://www.mrao.cam.ac.uk/~bn204/soft/bnmin1-1.11.tar.bz2
tar xjvf bnmin1-1.11.tar.bz2
cd bnmin1-1.11
LD_LIBRARY_PATH=$INSTALLDIR/lib PATH=$INSTALLDIR/bin:$PATH ./configure --prefix=$INSTALLDIR  --with-boost=/home/bn204/d/p/boost_1_35_0bin 
make && make install && cd ..

# Get PyHLP
wget http://www.mrao.cam.ac.uk/~bn204/soft/pyhlp-0.2.tar.gz
tar xvzf pyhlp-0.2.tar.gz
cd pyhlp-0.2
python setup.py install --home=$INSTALLDIR
cd ..

# Build radiospec
wget http://www.mrao.cam.ac.uk/~bn204/soft/radiospec-1.0.tar.gz
tar --strip-components=1  -xzvf radiospec-1.0.tar.gz
PATH=$INSTALLDIR/bin:$PATH scons PKG_CONFIG_PATH=$INSTALLDIR/lib/pkgconfig/

You should then start python as:

PYTHONPATH=$INSTALLDIR/bin:$INSTALLDIR/lib:$INSTALLDIR/lib/python python

Doesn’t work? Consult below for possible answers.

Dependencies

You will need a reasonably complete system with C++ development tools installed. Some of the dependencies at the time of writing are:

  • GCC/g++ and friends
  • Boost C++ libraries
  • GSL
  • Python 2.5 or 2.6 (including the development headers) (note Python 3.0 is not compatible with 2.x)
    • You will at least also need the numpy package for Python
  • SWIG – this generates the bindings to Python
  • PyX – this is the graphing library
  • PyHLP: Python routines for plotting built on PyX
  • SCons (version 1.2 or later)

FAQ & Answers

Problems installing BNMin1?

See also the BNMin1 page.

Problem installing GSL/BOOST/SWIG/SCons?

Here is a quick script that will install all of these to a location specified by you (but note this will involve a large amount of data download and will be processor intensive):

# Destination directory, obviously adjust 
export INSTALLDIR=/home/bnikolic/temp/rsbuildtest

# First install GSL
wget http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gsl/gsl-1.13.tar.gz
tar xzvf gsl-1.13.tar.gz
cd gsl-1.13
./configure --prefix=$INSTALLDIR
make && make install && cd ..

# Install swig. 
wget "http://downloads.sourceforge.net/project/swig/swig/swig-1.3.40/swig-1.3.40.tar.gz?use_mirror=kent"
tar xzvf swig-1.3.40.tar.gz
cd swig-1.3.40
./configure --prefix=$INSTALLDIR
make && make install && cd ..

# Install SCons
wget "http://downloads.sourceforge.net/project/scons/scons/1.2.0/scons-1.2.0.tar.gz?use_mirror=switch"
tar xzvf scons-1.2.0.tar.gz
cd scons-1.2.0
python setup.py install --home=$INSTALLDIR
cd ..

# Install Boost
wget "http://downloads.sourceforge.net/project/boost/boost/1.41.0/boost_1_41_0.tar.bz2?use_mirror=sunet"
tar xjvf "boost_1_41_0.tar.bz2"
cd boost_1_41_0/tools/jam/src/
./build.sh 
cp bin.*/bjam ../../../
cd ../../../
./bjam --prefix=$INSTALLDIR install
cd ..

# Install NumPy
(wget "http://downloads.sourceforge.net/project/numpy/NumPy/1.4.1/numpy-1.4.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnumpy%2Ffiles%2FNumPy%2F1.4.1%2F&ts=1291202612&use_mirror=garr" &&
tar xzvf numpy-1.4.1.tar.gz  &&
cd numpy-1.4.1 &&
python setup.py install --home=$INSTALLDIR &&
cd ..
)

# Install Scipy
(wget "http://downloads.sourceforge.net/project/scipy/scipy/0.8.0/scipy-0.8.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fscipy%2Ffiles%2F&ts=1291303353&use_mirror=kent" &&
tar xzvf scipy-0.8.0.tar.gz &&
cd scipy-0.8.0 &&
PYTHONPATH=${INSTALLDIR}/lib64/python:$PYTHONPATH python setup.py install --home=$INSTALLDIR)

#install hdf5
(wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.5-patch1.tar.gz &&
tar xzvf hdf5-1.8.5-patch1.tar.gz &&
cd hdf5-1.8.5-patch1 &&
./configure --prefix=$INSTALLDIR &&
make install &&
cd ..)

#install Cython
(wget http://www.cython.org/release/Cython-0.13.tar.gz &&
 tar xzvf Cython-0.13.tar.gz &&
 cd Cython-0.13 &&
 PYTHONPATH=${INSTALLDIR}/lib64/python:$PYTHONPATH python setup.py install --home=$INSTALLDIR && 
 cd ..)

#install pytables
( wget http://www.pytables.org/download/stable/tables-2.2.1.tar.gz&&
  tar xzvf tables-2.2.1.tar.gz &&
  cd tables-2.2.1 &&
  PYTHONPATH=${INSTALLDIR}/lib64/python:$PYTHONPATH python setup.py install --home=$INSTALLDIR --hdf5=$INSTALLDIR &&
  cd ..)

# 
( wget http://numexpr.googlecode.com/files/numexpr-1.4.1.tar.gz &&
  tar xzvf numexpr-1.4.1.tar.gz &&
  cd numexpr-1.4.1 &&
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${INSTALLDIR}/lib PYTHONPATH=${INSTALLDIR}/lib64/python:$PYTHONPATH python setup.py install --home=$INSTALLDIR &&
  cd ..)

# Building bnmin1 -- See also other scipts
LD_LIBRARY_PATH=${INSTALLDIR}/lib:$LD_LIBRARY_PATH \
PATH=${INSTALLDIR}/bin:$PATH \
PKG_CONFIG_PATH=${INSTALLDIR}/lib/pkgconfig  \
./configure --prefix=${INSTALLDIR} --with-boost=${INSTALLDIR}



# PyX
(wget "http://downloads.sourceforge.net/project/pyx/pyx/0.10/PyX-0.10.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpyx%2Ffiles%2Fpyx%2F&ts=1291302980&use_mirror=kent"
tar xzvf PyX-0.10.tar.gz
cd PyX-0.10
PYTHONPATH=${INSTALLDIR}/lib64/python:$PYTHONPATH python setup.py install --home=$INSTALLDIR && 

Important note regarding boost: If you installed boost using this script you must specify its location to BNMin1 by changing the following lines in the simple installation script from:

cd bnmin1-1.9
LD_LIBRARY_PATH=$INSTALLDIR/lib PATH=$INSTALLDIR/bin:$PATH ./configure --prefix=$INSTALLDIR

to the following:

cd bnmin1-1.9
LD_LIBRARY_PATH=$INSTALLDIR/lib PATH=$INSTALLDIR/bin:$PATH ./configure --prefix=$INSTALLDIR --with-boost=$INSTALLDIR

This is because the boost installation is not detected by a program in path but rather using a more complicated algorithm.

SCons version problem

If you have problem running the build script with an output similar to:

scons: Reading SConscript files ...
NameError: name 'Variables' is not defined:
  File "/tmp/SConstruct", line 8:
    opts=Variables("")
Exit 2

then the most likely reason is that your version of SCons is too old. You need to use version 1.2 or newer.