This guide takes you through the necessary steps required to install the workshop software on a Mac.
Please note that for installation to be successful, the software must be installed in the following order.
1) XCode
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.
2) glib
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
3) gfortran
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
4) git
Download the git installer for your OS from here:
Add the following to your .bash_profile:
# Path to ipta_software directory (where /Users/<user> is your home directory) eg: export IPTA_DIR=/Users/<user>/ipta_software
# OSTYPE
export OSTYPE=bsd
# PSRCAT export PSRCAT_FILE=$IPTA_DIR/psrcat_tar/psrcat.db # Tempo
export TEMPO=$IPTA_DIR/tempo
# Tempo2 export TEMPO2=$IPTA_DIR/tempo2/T2runtime # PGPLOT export PGPLOT_DIR=$IPTA_DIR/pgplot_build export PGPLOT_DEV=/xwindow # PRESTO export PRESTO=$IPTA_DIR/scottransom-presto-59b9e74 # DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/lib:$IPTA_DIR/lib:\ $IPTA_DIR/pgplot_build:$IPTA_DIR/scottransom-presto-59b9e74/lib # PATH # Some Presto executables match sigproc executables so keep separate - # all other executables are found in $IPTA_DIR/bin export PATH=$PATH:/usr/local/git/bin:$IPTA_DIR/bin:$IPTA_DIR/scottransom-presto-59b9e74/bin #
Then reload your .bash_profile and check changes are taken up:
$ source ~/.bash_profile $ echo $IPTA_DIR
$ cd ipta_software
$ git clone git://psrchive.git.sourceforge.net/gitroot/psrchive/psrchive $ cvs -z3 -d:pserver:anonymous@tempo.cvs.sourceforge.net:/cvsroot/tempo co -P tempo
$ cvs -z3 -d:pserver:anonymous@tempo2.cvs.sourceforge.net:/cvsroot/tempo2 co tempo2
$ cd fftw-3.3.1
a) single precision (for Psrchive)
$ ./configure --prefix=$IPTA_DIR --enable-float CFLAGS="-fPIC"
$ make $ make check
$ make install $ make clean
b) double precision (for Tempo2)
$ ./configure --prefix=$IPTA_DIR CFLAGS="-fPIC"
$ make $ make check $ make install $ make clean
$ cd ../cfitsio $ ./configure --prefix=$IPTA_DIR CFLAGS="-fPIC" $ make shared $ make install $ make clean
$ cd ../psrcat_tar $ source makeit
Copy psrcat executable to $IPTA_DIR/bin:
$ cp psrcat $IPTA_DIR/bin
$ cd ../pgplot_build $ ../pgplot/makemake ../pgplot bsd
Edit the makefile -
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
Check paths to png.h, pngconf.h, zlib.h, zconf.h:
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 pgplot demo:
$ ./pgdemo1
Press enter at the prompt.
$ cd ../tempo $ ./prepare $ ./configure --prefix=$IPTA_DIR --with-cfitsio-dir=$IPTA_DIR --with-fftw3-dir=$IPTA_DIR CFLAGS="-fPIC" $ make $ make install
$ cd ../tempo2 $ ./bootstrap $ ./configure --prefix=$IPTA_DIR --with-cfitsio-dir=$IPTA_DIR --with-fftw3-dir=$IPTA_DIR CFLAGS="-fPIC"
$ make && make install $ make plugins && make plugins-install
Test tempo2:
$ cd ../tempo2_test_data $ tempo2 -gr plk -f psr1_2.par psr1.tim
$ cd ../psrchive $ ./bootstrap $ ./configure --prefix=$IPTA_DIR --with-cfitsio-dir=$IPTA_DIR --with-fftw3-dir=$IPTA_DIR CFLAGS="-fPIC" $ make $ make install
$ cd ../sigproc-4.3 $ ./configure
Enter '/Users/<user>/ipta_software/bin' at prompt to set default path of executables.
Edit makefile.bsd with the following:
a) Add the following to the end of the LPGPLOT line in order to get png output from PGPLOT:
-lpng
b) Add the following to the end of the CCC line:
-I$(IPTA_DIR)/include
c) Add the following line to define the fortran compiler
FC=gfortran -ffixed-line-length-none
d) Uncomment LFITS and LFFTW and edit paths to:
LFITS = -L$(IPTA_DIR)/lib/ -lcfitsio LFFTW = -L$(IPTA_DIR)/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 ../scottransom-presto-59b9e74/src $ make makewisdom $ make prep
Edit Makefile as follows:
Define the OS type - uncomment 'OSX' and comment out 'Linux'
#OS = Linux OS = OSX
Edit paths to libs and includes (from line 39):
# Path to FFT includes
FFTINCDIR = -I$(IPTA_DIR)/include
# Path to FFT libraries FFTLIBDIR = -L$(IPTA_DIR)/lib
#Check path to glib-2.0 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
# Other lib directories (line 48): OTHERLIBDIR = -L$(IPTA_DIR)/lib
Check the fortran compiler is set to gfortran on line 61 (if PGPLOT was compiled with gfortran):
FC = gfortran
Continue the compilation:
$ make $ make clean
$ cd ../../gnuplot-4.4.3 $ ./configure --prefix=$IPTA_DIR CFLAGS="-fPIC"
$ make $ make install $ make clean
Test gnuplot with:
$ gnuplot gnuplot> test