CentOS 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 CentOS Linux. These notes are based on installation onto a fresh install of CentOS 7 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=$LD_LIBRARY_PATH:/usr/lib:/usr/lib64:$PGPLOT_DIR:$ASTROSOFT/lib:$PRESTO/lib:$PRESTO/lib64:$MULTINEST_DIR:/usr/lib64/mpich/lib

# 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
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

Install the epel-release repository:

yum install epel-release

Install the following dependencies:

ftp
wget
kernel-headers
kernel-devel
gcc
gcc-gfortran
gcc-c++
make
tk
tk-devel
glib2-devel
libX11
libX11-devel
libXext-devel
libpng
gd
cvs
autoconf
automake
libtool
m4
git
tcsh
gsl-devel
python-devel
blas
blas-devel
numpy
swig
scipy
python-matplotlib
gnuplot
dkms
libxml2
libxml2-devel
fuse
fuse-sshfs
man
davfs2
atlas-devel
ImageMagick
xpdf
htop
screen
xterm
lapack
lapack-devel
cmake
python-pip
readline
readline-devel
patch
java
bzip2
libtool
libtool-ltdl
libtool-ltdl-devel
openmpi
openmpi-devel
mpich
mpich-devel
emacs
bc

Remove incompatible libpng-devel and install libpng12:

yum remove libpng-devel
yum install libpng12 libpng12-devel
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-{version}
./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-{version}/makemake ../pgplot-{version} linux g77_gcc

Edit the makefile with the following:

a) Set the fortran compiler to gfortran (line 25):

FCOMPL=gfortran

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 e.g:

pndriv.o : /usr/include/libpng12/png.h /usr/include/libpng12/pngconf.h /usr/include/zlib.h /usr/include/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 --prefix=$ASTROSOFT F77=gfortran CFLAGS=-fPIC FFLAGS=-fPIC
make
make install
make clean

TEMPO2

cd tempo2
./bootstrap
./configure --prefix=$ASTROSOFT --with-cfitsio-dir=$ASTROSOFT --with-fftw3-dir=$ASTROSOFT F77=gfortran 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

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

SIGPROC

cd sigproc-{version}
./configure

Enter /home/{user}/pulsar_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) Add the following line defining the fortran compiler:

FC = gfortran -ffixed-line-length-none

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/lib64" LIBS="-lX11 -ltempo2pred -lpng"
make
make install
make clean

DSPSR

cd dspsr

Create a file named 'backends.list' and add 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

./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

libpgplot errors e.g.:

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 ^