[Last updated 24/11/2022] THIS PAGE IS UNDER CONSTRUCTION!
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 22.04.1 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..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 # 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
Using a package manager, install the following dependencies:
libtool libfftw3-3 libfftw3-dev libcfitsio8 libcfitsio-dev wget libpng-dev libgd-dev autoconf automake libtool m4 git gsl-bin libgsl-dev flex bison fort77 libglib2.0-dev gnuplot python-dev python-numpy python-scipy python-matplotlib python-setuptools python-sympy python-nose swig libltdl-dev libltdl7 cmake libblas3 liblapack3 libblas-dev liblapack-dev libxext-dev libx11-dev libopenmpi-dev openmpi-bin libhdf5-openmpi-dev mpich libmpich-dev libhdf5-mpich-dev tcsh pgplot5 imagemagick bc latex2html gfortran
cd psrcat_tar source makeit
Copy psrcat executable to $ASTROSOFT/bin:
cp psrcat $ASTROSOFT/bin
cd tempo ./prepare ./configure F77=gfortran --prefix=$ASTROSOFT CFLAGS=-fPIC FFLAGS=-fPIC make make install
cd tempo2 ./bootstrap ./configure --prefix=$ASTROSOFT LDFLAGS=-L/lib/arch64-linux-gnu make && make install make plugins && make plugins-install make unsupported
cd psrchive ./bootstrap ./configure --prefix=$ASTROSOFT LDFLAGS=-L/lib/arch64-linux-gnu --enable-shared make make install make clean
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
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
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
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
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
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.