Mac - OSX Snow Leopard

[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.

Contents:

Define some environmental variables

Add the following lines to your .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
back to top ^

Install some dependencies

back to top ^

Build

FFTW

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

CFITSIO

cd cfitsio-{version}
./configure --prefix=$ASTROSOFT CFLAGS=-fPIC
make shared
make install
make clean

PSRCAT

cd psrcat_tar
source makeit

Copy psrcat executable to $ASTROSOFT/bin:

cp psrcat $ASTROSOFT/bin

PGPLOT

Create an empty directory (pgplot_build) alongside the pgplot-{version} directory.

Copy pgplot-{version}/drivers.list to the pgplot_build directory.

cd pgplot_build

Edit 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.

TEMPO

cd tempo
./prepare
./configure F77=gfortran --prefix=$ASTROSOFT --with-cfitsio-dir=$SOFTWARE_DIR --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC
make
make install

TEMPO2

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

PSRCHIVE

cd psrchive
./bootstrap
./configure --prefix=$ASTROSOFT --with-cfitsio-dir=$SOFTWARE_DIR --with-fftw3-dir=$ASTROSOFT CFLAGS=-fPIC
make
make install

SIGPROC

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

SIGPROC (Mike Keith's version)

cd sigproc
./bootstrap
./configure --prefix=$ASTROSOFT/sigproc --with-cfitsio-dir=$SOFTWARE_DIR --with-fftw-dir=$ASTROSOFT F77=gfortran
make
make install
make clean

PRESTO v1 (old version)

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

PRESTO v2 (latest version)

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

GNUPLOT

cd gnuplot-{version}
./configure --prefix=$ASTROSOFT CFLAGS="-fPIC"
make
make install
make clean

Test gnuplot with:

gnuplot
gnuplot> test

Common installation problems

back to top ^