HEAsoft install on a Mac

Here are my instructions for how to get HEAsoft, the NASA High Energy Astrophysics Software, set up on a new Mac! I learned most of this from HEAsoft’s own documentation (and a little trial and error over the years). I just did this all again today on a clean new Mac, and it worked on the first try for me! Disclaimer: I’m not a HEAsoft developer or maintainer, so follow this advice at your own risk. Actual HEAsoft maintainers should be your first point of contact if something goes wrong.

Step 0

Make a full backup of your machine as-is.

Step 1

Install these things:

XQuartz
Xcode (in the app store)
Command Line Tools for Xcode (also in the app store)
homebrew (or another package manager like MacPorts or Fink)

Step 2

Using the package manager, install:

wget
intltool
gawk
gcc
libtool
automake
mawk
pkgconfig
libgc
GMP
MPFR
MPC
cairo
pango
lzip
pgplot
flex

Step 3

Download the HEAsoft source tarball. The first bullet point, above Step 1 on that page, should have everything you need (and you probably don’t need the extra old XSPEC stuff). This download takes like 30 minutes! I then sudo-make the directory /usr/local/src and sudo-unzip the HEAsoft tarball in there.

Step 4

Copy/paste into ~/.bashrc (since I work in the bash shell) (using homebrew installations of the gcc compilers):

export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
export FC=/usr/local/bin/gfortran
export PERL=/usr/bin/perl

The following is the HEASARC calibration database info that also needs to be in your ~/.bashrc file:

export CALDB=http://heasarc.gsfc.nasa.gov/FTP/caldb
export CALDBCONFIG=$CALDB/software/tools/caldb.config
export CALDBALIAS=$CALDB/software/tools/alias_config.fits

Step 5

Check that /opt/X11 is a real place where X11 lives. For example, if cd /opt/X11 takes you somewhere and has contents like bin, include, and lib (among others), you’re probably good to go.

Step 6

To configure, make, and install (Note: your HEAsoft version number might be different if you’re referencing this blogpost well after I publish it):

cd /usr/local/src/heasoft-6.24/BUILD_DIR/
./configure –x-libraries=/opt/X11/lib –x-includes=/opt/X11/include >& config.out
make > build.log 2>&1
make install > install.log 2>&1

You should be able to open config.out, build.log and install.log as those things are going (from a different terminal window) to see their progress. The make line with build.log takes a particularly long amount of time (like 20ish minutes).

Step 7

Copy/paste into ~/.bashrc for general use (again, your HEAsoft version number and system architecture might be different. If you ls in the HEAsoft directory you’ll see what to put for the system architecture thing):

export HEADAS=/usr/local/src/heasoft-6.24/x86_64-apple-darwin17.5.0
alias heainit=”. $HEADAS/headas-init.sh”

To start up XSPEC, in a bash terminal session type

heainit
xspec

and it should start up an XSPEC environment! Happy analysis!

Comments Off on HEAsoft install on a Mac

Filed under apps & software, coding & computing

Comments are closed.