[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 up to and including the 'Snow Leopard' 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 # OSTYPE export OSTYPE=bsd # 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
If your OS is 10.6 or 10.7 you can install it through the App store. If you have upgraded from an earlier version of the OS since you last installed XCode you will need to re-install it. If your OS is 10.6.8 or 10.7 and you have never installed XCode, install 4.3 from the App store.
If your OS is 10.6.8 or 10.7 with a new XCode installed, you will need to install Homebrew in order to install glib. Follow the instructions on https://github.com/mxcl/homebrew/wiki/installation and paste the following into a terminal:
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/\ Library/Contributions/install_homebrew.rb)"
Then install glib:
brew install glib
If your OS is 10.6.8 or 10.7 with XCode 4.3 installed, you will need to download gfortran from here:
http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
If your OS is 10.7 with XCode 4.2 installed, you will need to download gfortran from here:
http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg
If your OS is 10.6 with XCode 4.1, 4.0 or 3.2.6 installed, you will need to download gfortran from here:
http://r.research.att.com/gfortran-42-5664.pkg
After gfortran is installed, run this command:
sudo ln -sf `which gfortran-4.2` /usr/bin/gfortran
Download the git installer for your OS from here:
http://code.google.com/p/git-osx-installer/downloads/list
cd fftw-{version}
a) single precision (for Psrchive)
./configure --prefix=$ASTROSOFT --enable-float CFLAGS="-fPIC" make make check make install make clean
b) double precision (for Tempo2)
./configure --prefix=$ASTROSOFT CFLAGS="-fPIC" make make check make install make clean
cd cfitsio-{version} ./configure --prefix=$ASTROSOFT CFLAGS=-fPIC make shared make install make clean
cd psrcat_tar source makeit
Copy psrcat executable to $ASTROSOFT/bin:
cp psrcat $ASTROSOFT/bin
pgplot-{version}/drivers.list
to the pgplot_build directory.
cd pgplot_buildEdit
drivers.list
as required to enable the appropriate drivers, then start the build:
../pgplot-{version}/makemake ../pgplot-{version} bsd
Edit the makefile
with the following:
a) Add the following to C compiler and compilation flags:
CFLAGS=-fPIC
Find the following line and remove '-lipc':
LIBS=-L/usr/X11R6/lib -lX11 -lm -lipc
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/X11/include/png.h /usr/X11/include/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.
cd tempo ./prepare ./configure F77=gfortran --prefix=$ASTROSOFT --with-cfitsio-dir=$SOFTWARE_DIR --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC make make install
cd tempo2 ./bootstrap ./configure --prefix=$ASTROSOFT --with-cfitsio-dir=$SOFTWARE_DIR --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC make && make install make plugins && make plugins-install
cd psrchive ./bootstrap ./configure --prefix=$ASTROSOFT --with-cfitsio-dir=$SOFTWARE_DIR --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC make make install
cd sigproc-{version} ./configure
Enter /Users/{user}/pulsar_software/bin
at prompt to set the default path of the executables.
Edit makefile.bsd
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
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
cd gnuplot-{version} ./configure --prefix=$ASTROSOFT CFLAGS="-fPIC" make make install make clean
Test gnuplot with:
gnuplot gnuplot> test