[Last updated 02/03/2016]
This guide takes you through the necessary steps required to install software for pulsar data analysis on a Mac running OSX El Capitan. Please note that for installation to be successful, the software should be installed in the order described on this page..bash_profile
file (if it doesn't exist, create it) e.g:
# Path to the pulsar software installation directory e.g: export ASTROSOFT=/Users/{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 # DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ASTROSOFT/lib:$PRESTO/lib # PATH # Some Presto executables match sigproc executables so keep separate - # all other executables are found in $ASTROSOFT/bin export PATH=$PATH:/usr/local/git/bin:$ASTROSOFT/bin:$PRESTO/bin # PYTHONPATH export PYTHONPATH=$PRESTO/lib/python:/usr/local/lib/python2.7/site-packages:/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:$ASTROSOFT/lib/python2.7/site-packages
Then reload your .bash_profile
file and check changes are taken up:
source ~/.bash_profile echo $ASTROSOFT
Install the latest version of XCode, XCode command line tools and gfortran from the App store.
Follow the installation instructions on http://mxcl.github.io/homebrew/. Homebrew is installed to /usr/local by default.
After the installation, run
brew doctor
brew install gcc
brew install glib
brew install fftw --with-fortran --with-mpi --with-openmp
brew install cfitsio
brew install autoconf
brew install automake
brew install libtool
brew install git
brew install python
brew install swig
brew install homebrew/versions/libpng12
brew install cmake
brew install gsl
brew install pkg-config
pip install numpy
pip install scipy
cd psrcat_tar source makeit
Copy psrcat executable to $ASTROSOFT/bin:
cp psrcat $ASTROSOFT/bin
pgplot-{version}/drivers.list
to the pgp
lot_build directory.
cd pgplot_buildEdit
drivers.list
as required to enable the a
ppropriate drivers, then start the build:
../pgplot-{version}/makemake ../pgplot-{version} bsd
Edit the makefile
with the following:
a) Set the fortran compiler to gfortran (line 25), add '-fPIC' to FFLAGC and CFLAGC, remove '-lipc' from LIBS, and add the path to libpng12/include to XINCL e.g:
FCOMPL=gfortran FFLAGC=-O2 -fPIC CFLAGC=-fPIC -DPG_PPU -O2 -I. LIBS=-L/usr/X11R6/lib -lX11 -lm XINCL=-I/usr/local/Cellar/libpng12/1.2.54/include/ -I/usr/X11R6/include
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/local/Cellar/libpng12/1.2.54/include/png.h /usr/local/Cellar/libpng12/1.2.54/include/pngconf.h /usr/include/zlib.h /usr/include/zconf.h
Save the file and compile it:
make make clean make cpg
Try the PGPLOT demo:
./pgdemo1
cd tempo ./prepare ./configure F77=gfortran --prefix=$ASTROSOFT make make install make clean
cd tempo2 ./bootstrap ./configure F77=gfortran --prefix=$ASTROSOFT --with-cfitsio-dir=$ASTROSOFT --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC FFLAGS=-fPIC CXXFLAGS="$ASTROSOFT/include -I$PGPLOT_DIR" make && make install make plugins && make plugins-install make unsupported make clean
cd psrchive ./bootstrap ./configure F77=gfortran --prefix=$ASTROSOFT --enable-shared --with-cfitsio-dir=$ASTROSOFT --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC FFLAGS=-fPIC LDFLAGS=-L/usr/local/lib LIBS="-lgsl -lgslcblas" make make install make clean
cd ../sigproc-{version} ./configure
Click enter to install to default path
Edit makefile.darwin
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
c) Add the following line defining the fortran compiler:
FC = gfortran -ffixed-line-length-none
d) Uncomment LFITS and LFFTW and edit paths e.g:
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 MultiNest/build/ cmake -DCMAKE_INSTALL_PREFIX=$ASTROSOFT .. make make install make clean
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/local/Cellar/gcc/5.3.0/lib/gcc/5" LIBS=-lgomp CC=/usr/local/Cellar/gcc/5.3.0/bin/gcc-5 make make install make clean
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 -L$ASTROSOFT/lib -L/usr/local/Cellar/gcc/5.3.0/lib/gcc/5" make make install make clean
cd TempoNest ./autogen.sh ./configure CXXFLAGS=-I$ASTROSOFT/include LDFLAGS="-L$ASTROSOFT/lib -L/usr/local/Cellar/gcc/5.3.0/lib/gcc/5" make && make install
cd presto/src
Edit Makefile
as follows:
a) Define paths to libs and compiler e.g:
X11LINK = -L/usr/X11/lib -lX11 PNGLINK = -L/usr/local/Cellar/libpng12/1.2.54/lib -lpng12 CC = /usr/local/Cellar/gcc/5.3.0/bin/gcc-5
b) Add -lm flag to CFLAGS
CFLAGS = -I$(PRESTO)/include $(GLIBINC) $(CFITSIOINC) $(PGPLOTINC) $(FFTINC) \ -DUSEFFTW -DUSEMMAP -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ -g -O3 -ffast-math -Wall -W -fPIC -lm
Continue the build:
make makewisdom make prep make
PGPLOT ERROR:
... ../pgplot/drivers/pndriv.c:225:21: error: incomplete definition of type 'struct png_struct_def' if (setjmp(png_ptr->jmpbuf)) { /* not really sure what I'm doing here... */ ~~~~~~~^ /usr/local/Cellar/libpng/1.6.21/include/png.h:444:16: note: forward declaration of 'struct png_struct_def' typedef struct png_struct_def png_struct; ...
FIX: install libpng12 with brew and define paths in makefile
PSRCHIVE ERROR:
... In file included from ../../local_include/Pulsar/WaveletSmooth.h:13: ../../local_include/Pulsar/WaveletTransform.h:14:10: fatal error: 'gsl/gsl_wavelet.h' file not found ...
FIX: install gsl with brew
SIGPROC ERROR (MK's version):
... In file included from typeof_inputdata.c:29: ./mjk_cmd.h:1:10: fatal error: 'omp.h' file not found ...
FIX: install latest gcc with brew, and add path to CC variable in configure
SIGPROC ERROR (MK's version):
... ld: library not found for -lgomp ...
FIX: add gcc lib path to LDFLAGS, and -lgomp to LIBS in configure