SAS Installation - XMM-Newton
SAS Installation and initialisation
The SAS software is distributed in a single tgz archive for each Operating System where it was built. The filename syntax of such archive is sas_m.n.p-OS.tgz, where m.n.p is the canonical SAS version number (the SAS a.k.a.) and OS is a string combining the name of the Operating System and its version.
- sas_19.1.0-macOS-10.15.7.tgz: SAS 19.1.0 built on macOS 10.15.7 (a.k.a. Catalina)
- sas_19.1.0-Ubuntu18.04.tgz: SAS 19.1.0 built on Ubuntu 18.04LTS.
SAS is also distributed in a Linux-based Virtual Machine, where it is installed together with some "ready-to-use" tools like Heasoft, ds9, Grace, etc. Such package is dubbed Virtual Machine for SAS (VM4SASNN) where NN is a short SAS version, e.g. VM4SAS19.1 is the Virtual Machine for SAS 19.1.0.
For each release, this Table shows the builds of SAS available for download, including VM4SASNN. On the same page, reading section "Which SAS should I take? might help you choose the most suitable build for your Operating System.
To work with SAS you must install some tools. Find here detailed information on these tools.
To process XMM-Newton Observations with SAS you will need also the full set of calibration data files known as Current Calibration Files (CCF). You can find information on how to download and install these files here.
Finally, full instructions on how to install and use the VM4SAS19.1 can be found here.
Let us get started by choosing properly the most appropriate SAS build for the Operating System you are working on. Please read carefully the tips given in here before clicking on any download link shown in the accompanying Table. Once you have made up your choice, click on the selected link to start downloading the single tgz archive.
Before installing on macOS, specially if you are running macOS Catalina or BigSur, you must consider whether the System Integrity Protection or SIP is enabled or not. A simple way to check it is by running the command:
If it is enabled, just after downloading the archive including the build of SAS 19.1.0 for macOS (sas_19.1.0-macOS-10.15.7.tgz), you must execute on that archive the following command:
xattr -d com.apple.quarantine sas_19.1.0-macOS-10.15.7.tgz
Such command will delete the com.apple.quarantine attribute which is set automatically on any file downloaded from internet via any web-browser. The file is put in quarantine because is considered suspicious of containing malicious software. Failing to remove such attribute will prevent you to run any installed SAS binary, raising fatal errors of the form: code signature in (...) not valid for use in process using Library Validation: library load disallowed by system policy....
Once chosen the directory where you want to install the SAS, e.g. /top_dir, copy the downloaded archive to it and unpack it with
tar zxf sas_19.1.0-OS.tgz
Inmediately after, run the install.sh script as
The installation script checks for the presence of the required components of SAS and unpacks them into binaries, libraries and documentation in a directory named xmmsas_20210317_1624 below /top_dir. It finishes running a script named configure_install which checks for the exixtence in your system of installations of Perl and Python.
Regarding Perl it looks whether the variable SAS_PERL is defined and points to a binary which must be available through the PATH. Similarly, it checks whether a Python binary with version >=3.8 is available through the PATH. In case any of the two conditions is not fulfilled, the script complains and stops the installation. Once the missing component is provided, to complete the installation you must run again configure_install.
The installation is complete when configure_install creates, in the same directory, two shell scripts named setsas.sh and setsas.csh which can be used to initialise the SAS.
Depending on your shell, you can initialise SAS sourcing either setsas.sh or setsas.csh
source /top_dir/xmmsas_20210317_1624/setsas.sh (sh/bash/ksh)
source /top_dir/xmmsas_20210317_1624/setsas.csh (csh/tcsh)
The setsas.[c]sh scripts configure properly your shell environment to run any SAS task in your operating system except for the variables SAS_CCFPATH, SAS_ODF and SAS_CCF.
You must define SAS_CCFPATH to point to the directory where you have stored the Calibration Files.
Once you have chosen the XMM-Newton Observation to analize, SAS_CCF and SAS_ODF must be defined specifically for it. Detailed information on how to start working with SAS can be found in the SAS Startup Thread.
Some SAS tasks use Heasoft FTOOLS which forces us to initialise Heasoft before SAS. Any attempt to initialise only SAS will fail with an error message.
macOS SIP, SELinux and the (DY)LD_LIBRARY_PATH
The macOS System Integrity Protection or SIP, introduced by macOS v10.11 "El Capitan" in 2015, when enabled, prevents the use of the DYLD_LIBRARY_PATH as the mechanism used by a binary to search for the shared libraries it requires to run. Given that SAS macOS binaries relied on using DYLD_LIBRARY_PATH to run, we have requested until now to disable SIP on macOS.
A security system similar to SIP was available on Linux since 2003, the Security Enhanced Linux or SELinux, but computers running Linux were not setting it by default as it did macOS with SIP. SELinux disables the use of LD_LIBRARY_PATH to search for the shared libraries required to run a SAS Linux binary.
SAS 19.1.0 binaries on macOS and Linux do not require anymore the setting of the (DY)LD_LIBRARY_PATH as the search path for shared libraries. Therefore, macOS and Linux builds of SAS 19.1.0 can be used with macOS SIP enabled and on Linux running SELinux. Nevertheless, the SAS initialisation scripts still set properly the (DY)LD_LIBRARY_PATH environment variable, to allow running SAS on systems where SIP or SELinux are not enabled.