Installing HEASoft - Mac OS X

  • SOURCE CODE INSTALLATION:
    • Installations from the source code are generally recommended over the pre-compiled binaries to avoid any potential portability issues. Note also that source code builds are required for users who wish to load local models in Xspec or use the Xspec Python interface (PyXspec).

    • Prerequisite packages:

      In order to build HEASoft from the source code distribution, you will need some additional software:

      • X11: We recommend XQuartz but X11 is also available via the various Mac package managers.

      • Apple XCode: To make sure the Apple-supplied XCode compilers (gcc, g++, perl, python) are installed, you should install the Command Line Tools using this command:
          xcode-select --install
        
        The XCode compilers are known to work best for building HEASoft when paired with a third-party (i.e. non-Apple) Fortran compiler (see the section on Fortran just below). Other compilers may or may not work, so please use the Apple XCode compilers as shown below (under "Building the software") unless you have a specific reason not to do so.

        (Note specifically that the v5.3 gcc compiler distributed from HPC fails to build HEASoft, and that the task 'prefilter' may fail with a memory error when built with the HPC gcc v6.1.)

      • A Fortran compiler. Multiple options are available via Mac package managers such as these,


        or Apple-style installers for gfortran are available from gnu.org:


        gfortran tar files are available from SourceForge:

        • HPC For Mac OS X (Please use gfortran 5.3 or 6.2 for El Capitan, or 5.1 for Yosemite.)

        Note that as of HEASoft 6.16, builds on Mac OS X are now 64-bit by default and that the g95 compiler from g95.org - which we have recommended in previous releases - will not generate 64-bit objects, so alternate compilers are required for the default 64-bit build (for example, the g95 compiler available from MacPorts, which does generate 64-bit objects). HEASoft may be forced into 32-bit mode using the configure option "--enable-mac_32bit_build=yes", in which case the binary from g95.org may still be used.

    • Building the software:

      After installing the prerequisite packages above, most users should just follow the basic GNU-like build procedure outlined in the HEASoft installation guide, i.e.:
       First, make sure that the configure script will choose the
       correct set of compatible compilers for the build (and note that
       a Python interpreter is only required if you plan to use PyXspec):
      
       In C-shell variants (tcsh/csh):       In Bourne shell variants (bash/sh):
      
          % setenv CC /usr/bin/gcc              % export CC=/usr/bin/gcc
          % setenv CXX /usr/bin/g++             % export CXX=/usr/bin/g++
          % setenv PERL /usr/bin/perl           % export PERL=/usr/bin/perl
          % setenv PYTHON /usr/bin/python       % export PYTHON=/usr/bin/python
      
       Your Fortran compiler will live elsewhere, so for example:
      
          % setenv FC /opt/local/bin/g95        % export FC=/opt/local/bin/g95
       or
          % setenv FC /usr/local/bin/gfortran   % export FC=/usr/local/bin/gfortran
      
       Next:
      
          % cd heasoft-6.19/BUILD_DIR/
          % ./configure
          % make
          % make install
      
      Note that it is a good idea to capture the output from these steps in the manner appropriate for your shell, for example:
           In C-shell variants (tcsh/csh):      In Bourne Shell variants (bash/sh):
        
               ./configure >& config.out &        ./configure > config.out 2>&1 &
           and
               make >& build.log &                make > build.log 2>&1 &
           etc.
      
      Note that you should let each step finish before proceeding to the next. The installation guide contains descriptions of optional configuration flags that more advanced users may wish to utilize.

      Please also note that the compiler settings described above will NOT pass to a sudo shell, so if you want to install HEASoft in a location which requires su write privileges, we recommend that you configure and build the software in a location writeable by you, and only when doing the final install step should you use sudo. Here is an example in which a user has acquired the source code tar file and it is sitting in their Downloads/ directory; they then unpack, configure and build the HEASoft source code in their home directory and then install under /usr/local/heasoft-6.19:

          % cd ~
          % tar zxf Downloads/heasoft-6.19src.tar.gz
      
          % cd heasoft-6.19/BUILD_DIR/
          % ./configure --prefix=/usr/local/heasoft-6.19
      
          % make
      
          % sudo make install
      

    • Initialization:

      To initialize the software, do the following:
         For users of C Shell variants (csh, tcsh):
      
          setenv HEADAS /path/to/your/installed/heasoft-6.19/(PLATFORM)
          source $HEADAS/headas-init.csh
      
         For users of Bourne Shell (sh, ash, ksh, and bash):
      
          export HEADAS=/path/to/your/installed/heasoft-6.19/(PLATFORM)
          . $HEADAS/headas-init.sh
      
      In the examples above, (PLATFORM) is a placeholder for the platform- specific string denoting your machine's architecture, for example:
            x86_64-apple-darwin13.2.0
      


  • PRE-COMPILED BINARY INSTALLATION:
    • Note that users who wish to load local models in Xspec or use the Xspec Python interface (PyXspec) must install HEASoft from the source code distribution instead of the pre-compiled binaries.

    • Prerequisite packages:

      When using the pre-compiled HEASoft binaries, users will need a copy of X11 in order to use any of the graphical tasks:

      • X11: We recommend XQuartz but X11 is also available via the various Mac package managers.

      • Apple XCode: To make sure the necessary XCode utilities (perl and install_name_tool) are installed, you should install the Command Line Tools using this command:
          xcode-select --install
        
    • Configuring the software:

      After installing the above packages, most users should just follow the basic binary installation procedure outlined in the HEASoft installation guide, i.e.:
          % setenv PERL /usr/bin/perl  (tcsh/csh)
       or
          % export PERL=/usr/bin/perl  (bash/sh)
      
       Then:
      
          % cd heasoft-6.19/(PLATFORM)/BUILD_DIR/
          % ./configure
      
      If the configure script yields a message about a "Perl mismatch", you will either need to install HEASoft from the source code distribution, or install a version of Perl which matches that listed for your platform in our Perl reference. On Mac OS X, most users should be able to

    • Initialization:

      To initialize the software, do the following:
         For users of C Shell variants (csh, tcsh):
      
          setenv HEADAS /path/to/your/installed/heasoft-6.19/(PLATFORM)
          source $HEADAS/headas-init.csh
      
         For users of Bourne Shell (sh, ash, ksh, and bash):
      
          export HEADAS=/path/to/your/installed/heasoft-6.19/(PLATFORM)
          . $HEADAS/headas-init.sh
      
      In the examples above, (PLATFORM) is a placeholder for the platform- specific string denoting your machine's architecture, for example:
            x86_64-apple-darwin13.2.0
      



  • Help lines: FTOOLS or xanprob@athena.gsfc.nasa.gov

    Web page maintained by Bryan K. Irby



    HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

    Last modified: Friday, 30-Sep-2016 10:00:11 EDT