Ubuntu Linux (64-bit)

[Last updated 11/08/2016]

This guide takes you through the necessary steps required to install software for pulsar data analysis on a machine running Ubuntu Linux. These notes are based on installation onto a fresh install of Ubuntu 14.04 LTS on a 64-bit machine. Please note that for installation to be successful, the software should be installed in the order described on this page.

Contents:

Define some environmental variables

Add the following lines to your .bashrc file e.g:

# Path to the pulsar software installation directory e.g:
export ASTROSOFT=/home/{user}/pulsar_software

# OSTYPE
export OSTYPE=linux

# PSRCAT
export PSRCAT_RUNDIR=$ASTROSOFT/psrcat_tar
export PSRCAT_FILE=$ASTROSOFT/psrcat_tar/psrcat.db

# Tempo
export TEMPO=$ASTROSOFT/tempo

# Tempo2
export TEMPO2=$ASTROSOFT/tempo2/T2runtime

# PGPLOT
export PGPLOT_DIR=$ASTROSOFT/pgplot_build
export PGPLOT_DEV=/xwindow

# PRESTO
export PRESTO=$ASTROSOFT/presto

# MULTINEST
export MULTINEST_DIR=$ASTROSOFT/TempoNest/MultiNest

# LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib:/usr/lib/x86_64-linux-gnu:$PGPLOT_DIR:$ASTROSOFT/lib:$PRESTO/lib:$PRESTO/lib64:$MULTINEST_DIR

# PATH
# Some Presto executables match sigproc executables so keep separate -
# all other executables are found in $ASTROSOFT/bin
export PATH=$PATH:$ASTROSOFT/bin:$PRESTO/bin:$PGPLOT_DIR

# PYTHON PATH eg.
export PYTHONPATH=$PRESTO/lib/python:$PRESTO/lib64/python:/usr/lib/python2.7/site-packages/:/usr/lib64/python2.7/site-packages:$ASTROSOFT/lib/python2.7/site-packages


Then reload your .bashrc file and check changes are taken up:

$ source ~/.bashrc
$ echo $ASTROSOFT
back to top ^

Install some dependencies

class='vspace'>

Using a package manager, install the following dependencies:

ftp
wget
csh
build-essential
gfortran
libpng12-dev
libgd2-xpm-dev
cvs
autoconf
automake
libtool
m4
git
gsl-bin
libgsl0-dev
flex
bison
fort77
libglib2.0-dev
gnuplot
gnuplot-x11
python-dev
python-numpy 
python-scipy 
python-matplotlib 
ipython 
python-sympy
python-nose 
swig
libltdl-dev
libltdl7
dkms
htop
screen
xterm
emacs
gpicview
xpdf
cmake
default-jre
default-jdk
libblas3
liblapack3
libblas-dev
liblapack-dev
libxext-dev
libx11-dev
libopenmpi-dev 
openmpi-bin 
libhdf5-openmpi-dev
mpich 
libmpich-dev 
libhdf5-mpich-dev
ImageMagick 
back to top ^

Build

FFTW

cd fftw-{version}

a) single precision (for Psrchive)

./configure --prefix=$ASTROSOFT --enable-float --enable-threads --enable-shared CFLAGS=-fPIC FFLAGS=-fPIC
make
make check
make install
make clean

b) double precision (for Tempo2)

./configure --prefix=$ASTROSOFT CFLAGS=-fPIC FFLAGS=-fPIC
make
make check
make install
make clean

CFITSIO

cd cfitsio
./configure --prefix=$ASTROSOFT CFLAGS=-fPIC FFLAGS=-fPIC
make shared
make install
make clean

PSRCAT

cd psrcat_tar
source makeit

Copy psrcat executable to $ASTROSOFT/bin:

cp psrcat $ASTROSOFT/bin

PGPLOT

Create an empty directory (pgplot_build) alongside the pgplot-{version} directory.

Copy pgplot-{version}/drivers.list to the pgplot_build directory.

cd pgplot_build

Edit drivers.list as required to enable the appropriate drivers, then start the build:

../pgplot/makemake ../pgplot linux g77_gcc_aout

Edit the makefile with the following:

a) Set the fortran compiler to gfortran, and append FFLAGC and CFLAGC with -fPIC e.g:

FCOMPL=gfortran
FFLAGC=-fPIC -Wall -O
CFLAGC=-fPIC -DPG_PPU -O2 -I.

b) Check paths to png.h, pngconf.h, zlib.h, zconf.h, and change line 882

pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h

to eg:

pndriv.o : /usr/include/libpng12/png.h /usr/include/libpng12/pngconf.h /usr/include/zlib.h /usr/include/x86_64-linux-gnu/zconf.h

Save the file and compile it:

make
make clean
make cpg
ld -shared -o libcpgplot.so --whole-archive libcpgplot.a

Try the PGPLOT demo:

./pgdemo1

Press enter at the prompt.

TEMPO

cd tempo
./prepare
./configure F77=gfortran --prefix=$ASTROSOFT CFLAGS=-fPIC FFLAGS=-fPIC
make
make install

TEMPO2

cd tempo2
./bootstrap
./configure F77=gfortran --prefix=$ASTROSOFT --with-cfitsio-dir=$ASTROSOFT --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC FFLAGS=-fPIC CXXFLAGS="-I$ASTROSOFT/include -I$PGPLOT_DIR" LDFLAGS=-L$PGPLOT_DIR
make && make install
make plugins && make plugins-install
make unsupported
make clean

PSRCHIVE (with python interface)

cd psrchive
./bootstrap
./configure F77=gfortran --prefix=$ASTROSOFT --with-cfitsio-dir=$ASTROSOFT --with-fftw3-dir=$ASTROSOFT --enable-shared CFLAGS=-fPIC FFLAGS=-fPIC
make
make install
make clean

SIGPROC

cd sigproc-{version}
./configure

Enter /full/path/to/your/software/bin at prompt to set the default path of the executables.

Edit makefile.linux with the following:

a) Ensure the PGPLOT libraries in the LPGPLOT line are in the following order, and add -lpng to enable png output from PGPLOT:

-lcpgplot -lpgplot -lpng

b) Add the following to the end of the CCC line:

-I$(ASTROSOFT)/include

c) Define the fortran compiler, and append the CCC and FC lines with -fPIC e.g:

CCC = gcc -O2 -I$(ASTROSOFT)/include -fPIC
FC = gfortran -ffixed-line-length-none -fPIC

d) Uncomment LFITS and LFFTW and edit paths to:

LFITS = -L$(ASTROSOFT)/lib/ -lcfitsio
LFFTW = -L$(ASTROSOFT)/lib/ -lfftw3 -lfftw3f

Remove the backslash and quote from dosearch.f (line 265):

Change from:

write(llog,*) 'DB\'s slow-but-simple harmonic summing routine'

to:

write(llog,*) 'DBs slow-but-simple harmonic summing routine'

Save the file and compile it:

make
make quickplot

SIGPROC (Mike Keith's version)

cd sigproc
./bootstrap
./configure --prefix=$ASTROSOFT --with-cfitsio-dir=$ASTROSOFT --with-fftw-dir=$ASTROSOFT F77=gfortran CFLAGS=-fPIC FFLAGS=-fPIC CPPFLAGS=-I$ASTROSOFT/include LDFLAGS="-L$ASTROSOFT/lib -L$PGPLOT_DIR -L/usr/lib/x86_64-linux-gnu" LIBS="-lX11 -ltempo2pred -lpng"
make
make install
make clean

DSPSR

To select the backend support to be compiled, create a text file named 'backends.list' containing e.g:

apsr asp bcpm bpsr caspsr cpsr2 cpsr dummy fits gmrt guppi kat lbadr64 lbadr lump lwa mark4 mark5 maxim mwa pdev pmdaq s2 sigproc spda1k spigot vdif

Continue the build:

./bootstrap
./configure --prefix=$ASTROSOFT --with-cfitsio-dir=$ASTROSOFT F77=gfortran CFLAGS=-fPIC FFLAGS=-fPIC LDFLAGS=-L$PGPLOT_DIR
make
make install
make clean

TEMPONEST

cd TempoNest

# build MultiNest
cd MultiNest/
mv Makefile MakefileMPI
cp MakefileNoMPI Makefile
make
make libnest3.so

cd ../
./autogen.sh
./configure CXXFLAGS=-I$ASTROSOFT/include LDFLAGS=-L$ASTROSOFT/lib
make && make install

PRESTO v2 (latest version)

cd presto/src

Edit Makefile as follows:

a) Define paths to fftw and cfitsio includes and libs

FFTINC = -I$(ASTROSOFT)/include
FFTLINK = -L$(ASTROSOFT)/lib -lfftw3f
CFITSIOINC = -I$(ASTROSOFT)/include
CFITSIOLINK = -L$(ASTROSOFT)/lib -lcfitsio

b) Add '-lm' flag to CFLAGS

c) Add '-g -fPIC' to FFLAGS

Continue the build:

make makewisdom
make prep
make
make clean

Now for the python:

cd $PRESTO/python

Edit library and include paths in setup.py and setup_ppgplot.py e.g.:

setup.py
---
extra_compile_args = ["-DUSEFFTW -fPIC"]
include_dirs = ["/home/{user}/pulsar_software/include"]
ppgplot_libraries = ["cpgplot", "pgplot", "X11", "png", "m", "gfortran"]
ppgplot_library_dirs = ["/home/{user}/pulsar_software/pgplot_build"]
presto_libraries = ["presto", "fftw3f", "m"]
presto_library_dirs = ["/home/{user}/pulsar_software/lib","/home/{user}/pulsar_software/presto/lib"]
---
setup_ppgplot.py
---
extra_compile_args = ["-fPIC"]
ppgplot_libraries = ["cpgplot", "pgplot", "X11", "png", "m", "g2c", "gfortran"]
ppgplot_library_dirs = ["/home/{user}/pulsar_software/pgplot_build"]
---

Continue the build:

make
make clean

Common installation problems

You may come across the following errors during a build:

libpgplot.so: undefined reference to 'f_open'
libpgplot.so: undefined reference to 's_wsfe'
libpgplot.so: undefined reference to 's_copy'
....

The chances are that the fortran compiler was not the same as the one used to compile PGPLOT. So if PGPLOT was compiled with gfortran, then ensure FC is set to gfortran when building the others.

back to top ^