Installing HEASoft: Debian-based or RPM-based Linux


Instructions for Source Code or Pre-Compiled Binary distributions



  • SOURCE CODE INSTALLATION (Recommended):

    • Installations from the source code are recommended over the pre-compiled binaries due to the lack of portability of pre-compiled Perl libraries and other potential portability issues. Note that installations from the source code distribution are required for users who wish to load local models in Xspec or use the Xspec Python interface (PyXspec).

      The instructions below assume that you have already downloaded a HEASoft source code tar file and have unpacked it (using e.g. "tar zxf [tar file]") on your machine.

    • Prerequisite packages:

      If they aren't installed already, you will need to install - using a package manager - a few system-level packages required for building HEASoft from the source code distribution:

      For Debian-based Linux (e.g. Ubuntu), use the "apt-get" utility:
          sudo apt-get -y install libreadline-dev
          sudo apt-get -y install libncurses5-dev
          sudo apt-get -y install ncurses-dev
          sudo apt-get -y install curl
          sudo apt-get -y install libcurl4
          sudo apt-get -y install libcurl4-gnutls-dev
          sudo apt-get -y install xorg-dev
          sudo apt-get -y install make
          sudo apt-get -y install gcc g++ gfortran
          sudo apt-get -y install perl-modules
          sudo apt-get -y install python3-dev    (or: "python-dev")
          sudo apt-get -y install python3-pip
          sudo apt-get -y install python3-setuptools
          sudo apt-get -y install python3-astropy [needed for IXPE]
          sudo apt-get -y install python3-numpy [needed for IXPE]
          sudo apt-get -y install python3-scipy [needed for IXPE]
          sudo apt-get -y install python3-matplotlib [needed for IXPE]
          sudo pip install --upgrade pip
      

      For RPM-based Linux (e.g. Fedora), use the "dnf" (a.k.a. "yum") utility:
          sudo dnf -y install redhat-rpm-config
          sudo dnf -y install readline-devel
          sudo dnf -y install ncurses-devel
          sudo dnf -y install zlib-devel
          sudo dnf -y install libcurl-devel
          sudo dnf -y install libXt-devel
          sudo dnf -y install make
          sudo dnf -y install gcc gcc-c++
          sudo dnf -y install gcc gcc-gfortran   (or: "gcc gcc-fortran")
          sudo dnf -y install perl-devel
          sudo dnf -y install perl-Env
          sudo dnf -y install perl-ExtUtils-MakeMaker
          sudo dnf -y install python3-devel      (or: "python-devel")
          sudo dnf -y install python3-astropy [needed for IXPE]
          sudo dnf -y install python3-numpy [needed for IXPE]
          sudo dnf -y install python3-matplotlib [needed for IXPE]
          sudo pip3 install --only-binary=:all: scipy --upgrade
      
      HEASoftPy and other packages (IXPE, NICER) require Python 3.6 (or newer), as well as pip, AstroPy (v4.0.0 or newer), NumPy (v1.7.0 or newer), SciPy (v1.5.0 or newer) and MatPlotLib. If you have no need of any of these HEASoft packages, you may forgo installing the Python prerequisites.

      If you prefer to use a different Python environment (Anaconda, etc.), you may choose to install the Python packages (AstroPy, NumPy, SciPy, MatPlotLib) in that environment instead.

    • Configuring the software:

      After the prerequisite packages have been installed, the next step is to configure the software. While the configure script will try its best to find suitable choices, the safest way to ensure that the correct compilers are used by HEASoft is to employ the standard environment variables CC (C compiler), CXX (C++ compiler), FC (Fortran compiler), PERL (Perl interpreter), and PYTHON (Python interpreter). For example:

      First, make sure that the configure script will choose the correct set of compatible compilers for the build, for example:
       In Bourne shell variants (bash/sh/zsh):  In C-shell variants (tcsh/csh):
      
          export CC=/usr/bin/gcc                   setenv CC /usr/bin/gcc
          export CXX=/usr/bin/g++                  setenv CXX /usr/bin/g++
          export FC=/usr/bin/gfortran              setenv FC /usr/bin/gfortran
          export PERL=/usr/bin/perl                setenv PERL /usr/bin/perl
          export PYTHON=/usr/bin/python3           setenv PYTHON /usr/bin/python3
      
      If these variables are not used, the HEASoft configure script will attempt to find the necessary items in one of the system directories listed in your PATH environment variable, but success is not guaranteed.

      Please note that external packages (e.g. Anaconda) may set compiler flags in the environment which can break a HEASoft build, so users are advised to unset all *FLAGS variables:
       In Bourne shell variants (bash/sh/zsh):  In C-shell variants (tcsh/csh):
      
          unset CFLAGS CXXFLAGS FFLAGS LDFLAGS     unsetenv *FLAGS
      
      Alternatively, users may alter their session to cancel any Anaconda or other package initialization by editing their profile or other shell resource files.

      Other software packages (e.g. XMM-SAS) may change your LD_LIBRARY_PATH environment variable, and this can break a HEASoft build, so users are advised to check their LD_LIBRARY_PATH variable and remove any paths that aren't necessary. Typically none should be needed and this variable can remain empty when building HEASoft unless you are using a custom compiler suite for the build.

      Next, configure and build the software (optionally capturing the screen output to text files for reference as shown here):
       In Bourne shell variants (bash/sh/zsh):  In C-shell variants (tcsh/csh):
      
          cd heasoft-6.33/BUILD_DIR/              cd heasoft-6.33/BUILD_DIR/
          ./configure > config.txt 2>&1           ./configure >& config.txt
      
      The configure process may take several minutes to complete. If it is successful, the last line of screen output - or the last line in the "config.txt" file - should read "Finished". If it is not successful, do not proceed until any errors have been resolved. Check the HEASoft known issues page for aid, or contact the help desk.

    • Building the software:

      If the configure was successful, proceed to build the software, again optionally capturing the screen output to a text file for reference as shown here:
       In Bourne shell variants (bash/sh/zsh):  In C-shell variants (tcsh/csh):
      
          make > build.txt 2>&1                   make >& build.txt
      
      This process may take an hour or more to run, depending on your hardware and HEASoft download selections. If it is successful, the last line of output (in build.txt) should read "Finished make all". If it is not successful, do not proceed until any errors have been resolved. Check the HEASoft known issues page for aid, or contact the help desk.

    • Installing the software:

      If 'make' was successful, proceed to install the software, again optionally capturing the screen output to a text file for reference as shown here:
       In Bourne shell variants (bash/sh/zsh):  In C-shell variants (tcsh/csh):
      
          make install > install.txt 2>&1         make install >& install.txt
      
      This process may take 30-45 minutes to run, depending on your hardware and HEASoft download selections. If it is successful, the last line of output (in install.txt) should read "Finished make install". If it is not successful, do not proceed until any errors have been resolved. Check the HEASoft known issues page for aid, or contact the help desk.

    • Initialization:

      If the "make install" step was successful, you may proceed with initializing the software. The following are example commands which you will modify to be appropriate for your system:
         For users of Bourne Shell (sh, ash, ksh, bash, zsh):
      
          export HEADAS=/path/to/your/installed/heasoft-6.33/(PLATFORM)
          source $HEADAS/headas-init.sh
      
         For users of C Shell variants (csh, tcsh):
      
          setenv HEADAS /path/to/your/installed/heasoft-6.33/(PLATFORM)
          source $HEADAS/headas-init.csh
      
      In these commands, "/path/to/your/installed" is a placeholder for the actual directory path on your system identifying the location in which you installed heasoft. By default, the installed location will be in the source code tree directly under the top level heasoft-6.33 folder, and "(PLATFORM)" is a placeholder for the platform-specific string denoting your machine's architecture, for example:
          x86_64-pc-linux-gnu-libc2.35
      
      The initialization is silent and only generates a message if there is an error. If it is successful, you may begin using the software. For example, type "fhelp ftools" to see a full listing of possible tools, or type "xspec" to start the Xspec spectral analysis program.

    • Calibration Database (CALDB):

      Many HEASoft tasks require access to the CALDB, which is available separately from HEASoft. The simplest way to access the CALDB is remotely, assuming a good internet connection is available. Alternatively, the CALDB may be installed locally on your system.

    • Uninstalling HEASoft:

      For guidance about removing a HEASoft installation from your system, please refer to our uninstall guide.


  • PRE-COMPILED BINARY INSTALLATION (Not Recommended):

    • Installations of the pre-compiled binaries are not recommended due to the lack of portability of pre-compiled Perl libraries and other potential portability issues. Note that installations from the source code distribution are required for users who wish to load local models in Xspec or use the Xspec Python interface (PyXspec).

      The instructions below assume that you have already downloaded a HEASoft pre-compiled binary tar file and have unpacked it (using e.g. "tar zxf [tar file]") on your machine.

    • Prerequisite packages (Pre-Compiled Binaries):

      If they aren't installed already, you will need to install - using a package manager - a few system-level packages required for using the pre-compiled HEASoft binary distribution:

      For Debian-based Linux (e.g. Ubuntu), use the "apt-get" utility:
          sudo apt-get -y install libreadline-dev
          sudo apt-get -y install libncurses5-dev
          sudo apt-get -y install xorg-dev
          sudo apt-get -y install python3-dev    (or: "python-dev")
          sudo apt-get -y install python3-pip
          sudo apt-get -y install python3-setuptools
          sudo apt-get -y install python3-astropy
          sudo apt-get -y install python3-numpy
          sudo apt-get -y install python3-scipy
          sudo apt-get -y install python3-matplotlib
      

      For RPM-based Linux (e.g. Fedora), use the "dnf" (formerly "yum") utility:
          sudo dnf -y install readline-devel
          sudo dnf -y install ncurses-devel
          sudo dnf -y install libXt-devel
          sudo dnf -y install python3-devel      (or: "python-devel")
          sudo dnf -y install python3-astropy
          sudo dnf -y install python3-numpy
          sudo dnf -y install python3-matplotlib
          sudo pip3 install --only-binary=:all: scipy --upgrade
      
      HEASoftPy and other packages (IXPE, NICER) require Python 3.6 (or newer), as well as pip, AstroPy (v4.0.0 or newer), NumPy (v1.7.0 or newer), SciPy (v1.5.0 or newer) and MatPlotLib. If you have no need of any of these HEASoft packages, you may forgo installing the Python prerequisites.

      If you prefer to use a different Python environment (Anaconda, etc.), you may choose to install the Python packages (AstroPy, NumPy, SciPy, MatPlotLib) in that environment instead.

    • Configuring the software (Pre-Compiled Binaries):

      After the prerequisite packages have been installed, the next step is to configure the software:
          cd heasoft-6.33/(PLATFORM)/BUILD_DIR/
          ./configure
      
          (optionally capturing the screen output to a text file e.g., "config.txt")
      
      The configure process may take several minutes to complete. If it is successful, the last line of screen output - or the last line in the "config.txt" file - should read "Finished". If it is not successful, do not proceed until any errors have been resolved. Check the HEASoft known issues page for aid, or contact the help desk.

      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.

    • Initialization:

      If the "configure" step was successful, you may proceed with initializing the software. The following are example commands which you will modify to be appropriate for your system:
         For users of Bourne Shell (sh, ash, ksh, bash, zsh):
      
          export HEADAS=/path/to/your/installed/heasoft-6.33/(PLATFORM)
          source $HEADAS/headas-init.sh
      
         For users of C Shell variants (csh, tcsh):
      
          setenv HEADAS /path/to/your/installed/heasoft-6.33/(PLATFORM)
          source $HEADAS/headas-init.csh
      
      In these commands, "/path/to/your/installed" is a placeholder for the actual directory path on your system identifying the location in which you unpacked heasoft, and "(PLATFORM)" is a placeholder for the platform-specific string denoting the architecture of the pre-compiled binaries you chose, for example:
          x86_64-pc-linux-gnu-libc2.31
      
      The initialization is silent and only generates a message if there is an error. If it is successful, you may begin using the software. For example, type "fhelp ftools" to see a full listing of possible tools, or type "xspec" to start the Xspec spectral analysis program.

    • Calibration Database (CALDB):

      Many HEASoft tasks require access to the CALDB, which is available separately from HEASoft. The simplest way to access the CALDB is remotely, assuming a good internet connection is available. Alternatively, the CALDB may be installed locally on your system.

    • Uninstalling HEASoft:

      For guidance about removing a HEASoft installation from your system, please refer to our uninstall guide.



  • HEASoft / FTOOLS Help Desk

    If FTOOLS has been useful in your research, please reference this site (https://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: Friday, 08-Mar-2024 10:12:32 EST