[Last updated 17/07/2014]
This guide takes you through the necessary steps required to install software for pulsar data analysis on a Mac running the Mountain Lion OS. 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):
# Path to the pulsar software installation directory eg: export ASTROSOFT=/Users/{user}/pulsar_software # 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=/usr/local/Cellar/pgplot 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
Then reload your .bash_profile
file and check changes are taken up:
source ~/.bash_profile echo $ASTROSOFT
Install the latest version of XCode and XCode command line tools 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 glib
brew install gfortran
brew install fftw
brew install cfitsio
brew install pgplot
brew install autoconf
brew install automake
brew install libtool
brew install git
brew install cvs
brew install python
brew install swig
pip install numpy
cd psrcat_tar source makeit
Copy psrcat executable to $ASTROSOFT/bin:
$ cp psrcat $ASTROSOFT/bin
cd tempo ./prepare ./configure F77=gfortran --prefix=$ASTROSOFT make make install make clean
cd tempo2 ./bootstrap ./configure F77=gfortran --prefix=$ASTROSOFT make && make install make plugins && make plugins-install make clean
cd psrchive ./bootstrap ./configure F77=gfortran --prefix=$ASTROSOFT --enable-shared make make install make clean
cd ../sigproc-{version} ./configure
Enter eg. at prompt to set the default path of the executables.
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 to:
LFITS = -L/path/to/lib/ -lcfitsio LFFTW = -L/path/to/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/sigproc --with-cfitsio-dir=$SOFTWARE_DIR --with-fftw-dir=$ASTROSOFT F77=gfortran make make install make clean
cd presto/src
Edit Makefile
as follows:
a) Define the OS type - uncomment 'OSX' and comment out 'Linux'
b) Define path to LOCDIR:
LOCDIR = $(ASTROSOFT)
c) Edit path to FFT lib directories:
FFTLIBDIR = -L$(LOCDIR)/lib
d) Edit path to glib include directories (line 46) eg:
OTHERINCDIR = -I/usr/local/Cellar/glib/2.32.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.32.3/lib/glib-2.0/include
e) Edit path to 'other' lib directories (line 48):
OTHERLIBDIR = -L$(LOCDIR)/lib
f) Check fortran compiler is set to gfortran on line 61 (if PGPLOT was compiled with gfortran):
FC = gfortran
Continue the build:
make makewisdom make prep make make clean
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
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