Installing HEASoft - Mac OS

  • 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: We typically recommend using the Apple-supplied XCode compilers (clang [gcc], clang++ [g++], perl, python) though it is now possible to use other (third-party) C compilers and interpreters. Just please be aware that mixing compilers and interpreters from different sources can sometimes lead to problems. To make sure the XCode compilers are available, you should install the Command Line Tools using this command:
          xcode-select --install
        
      • A Fortran compiler. Multiple options are available via Mac package managers such as those listed below. Before choosing and installing one, please note that there are currently problems with the ximage package in HEASoft when built using the XCode C compilers paired with gfortran 8.x, as described on our issues page.

        • HOMEBREW

        • XCode compilers + gfortran 7.x (from the gcc@7 port):

              % brew install gcc@7
          
           In C-shell variants (tcsh/csh):           In Bourne shell variants (bash/sh):
          
              % setenv CC /usr/bin/clang                % export CC=/usr/bin/clang
              % setenv CXX /usr/bin/clang++             % export CXX=/usr/bin/clang++
              % setenv FC /usr/local/bin/gfortran-7     % export FC=/usr/local/bin/gfortran-7
          

          Or, use the entire gcc@8 package:

              % brew install gcc
          
           In C-shell variants (tcsh/csh):           In Bourne shell variants (bash/sh):
          
              % setenv CC /usr/local/bin/gcc-8          % export CC=/usr/local/bin/gcc-8
              % setenv CXX /usr/local/bin/g++-8         % export CXX=/usr/local/bin/g++-8
              % setenv FC /usr/local/bin/gfortran-8     % export FC=/usr/local/bin/gfortran-8
          
          
        • MACPORTS

        • macOS 10.13 (High Sierra) and older: We have typically had the most success with the MacPorts g95 compiler:
              % sudo port install g95
          
           In C-shell variants (tcsh/csh):           In Bourne shell variants (bash/sh):
          
              % setenv CC /usr/bin/clang                % export CC=/usr/bin/clang
              % setenv CXX /usr/bin/clang++             % export CXX=/usr/bin/clang++
              % setenv FC /opt/local/bin/g95            % export FC=/opt/local/bin/g95
          
          
          macOS 10.14 (Mojave) and newer: Unfortunately, the g95 port is apparently broken for newer macOS, so we currently recommend one of the following options:

          XCode compilers + gfortran 7.x (from the gcc7 port):

              % sudo port install gcc7
          
           In C-shell variants (tcsh/csh):           In Bourne shell variants (bash/sh):
          
              % setenv CC /usr/bin/clang                % export CC=/usr/bin/clang
              % setenv CXX /usr/bin/clang++             % export CXX=/usr/bin/clang++
              % setenv FC /opt/local/bin/gfortran-mp-7  % export FC=/opt/local/bin/gfortran-mp-7
          

          Or, use the entire gcc8 package:

              % sudo port install gcc8
          
           In C-shell variants (tcsh/csh):           In Bourne shell variants (bash/sh):
          
              % setenv CC /opt/local/bin/gcc-mp-8       % export CC=/opt/local/bin/gcc-mp-8
              % setenv CXX /opt/local/bin/g++-mp-8      % export CXX=/opt/local/bin/g++-mp-8
              % setenv FC /opt/local/bin/gfortran-mp-8  % export FC=/opt/local/bin/gfortran-mp-8
          
          
          If you use MacPorts, please refer to the MacPorts Migration page when updating your OS to avoid portability issues.

        • FINK

        • HPC For Mac OS

        • As with the options above, if using the newer 8.x compilers, you should use the entire suite (i.e. not just gfortran) in order to avoid a run-time problem with ximage.

        • GNU.ORG

        • gnu.org provides Apple-style installers for gfortran. As noted above, be aware that use of the gfortran 8.x compiler paired with the Apple XCode compilers may result in run-time problems in ximage.

          Note also that to install new versions of this compiler, it is recommended that you remove the previous gfortran installation first, as noted here:
             $ sudo rm -r /usr/local/gfortran /usr/local/bin/gfortran
          


    • 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/clang                % export CC=/usr/bin/clang
          % setenv CXX /usr/bin/clang++             % export CXX=/usr/bin/clang++
          % 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
      
      And as noted above in the Fortran section, when using gfortran 8.x, you should also use its matching C compilers (instead of the Apple XCode clang/clang++), for example:
          % setenv FC /usr/local/bin/gfortran-8     % export FC=/usr/local/bin/gfortran-8
          % setenv CC /usr/local/bin/gcc-8          % export CC=/usr/local/bin/gcc-8
          % setenv CXX /usr/local/bin/g++-8         % export CXX=/usr/local/bin/g++-8
          % setenv PERL /usr/bin/perl               % export PERL=/usr/bin/perl
          % setenv PYTHON /usr/bin/python           % export PYTHON=/usr/bin/python
      
      Users should also make sure that /usr/bin is ahead of /opt/local/bin in their PATH in order to avoid picking up a MacPorts assembler (as) that can cause configure errors ("I don't understand 'm' flag!"):
          % setenv PATH "/usr/bin:$PATH"            % export PATH="/usr/bin:$PATH"
      
      Next:
          % cd heasoft-6.25/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.25:

          % cd ~
          % tar zxf Downloads/heasoft-6.25src.tar.gz
      
          % cd heasoft-6.25/BUILD_DIR/
          % ./configure --prefix=/usr/local/heasoft-6.25
      
          % 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.25/(PLATFORM)
          source $HEADAS/headas-init.csh
      
         For users of Bourne Shell (sh, ash, ksh, and bash):
      
          export HEADAS=/path/to/your/installed/heasoft-6.25/(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.25/(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 Macs, 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.25/(PLATFORM)
          source $HEADAS/headas-init.csh
      
         For users of Bourne Shell (sh, ash, ksh, and bash):
      
          export HEADAS=/path/to/your/installed/heasoft-6.25/(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-darwin16.3.0
      



  • FTOOLS HELP DESK

    If FTOOLS has been useful in your research, please reference this site (http://heasarc.gsfc.nasa.gov/ftools) and use the ASCL reference for HEASoft [ascl:1408.004] or the ASCL reference for the original FTOOLs paper [ascl:9912.002]:

    Blackburn, J. K. 1995, in ASP Conf. Ser., Vol. 77, Astronomical Data Analysis Software and Systems IV, ed. R. A. Shaw, H. E. Payne, and J. J. E. Hayes (San Francisco: ASP), 367.

    Web page maintained by: Bryan K. Irby


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

    Last modified: Thursday, 14-Mar-2019 14:56:02 EDT

    HEASARC support for unencypted FTP access will be ending possibly as early as July 31, 2019. Please see this notice for details.