edit · print · PDF

Please note that all the SIEpedia's articles address specific issues or questions raised by IAC users, so they do not attempt to be rigorous or exhaustive, and may or may not be useful or applicable in different or more general contexts.

Note: STScI has suggested that non-IAC users should consider using the AstroConda package from STScI, instead of following this procedure. This will simplify your installation and make it easier for the STScI helpdesk to assist you if you have problems.

How to install IRAF 2.16.1 in Mac OS X

Installing IRAF in a Linux or Mac OS X box has become easier than ever, as basically now one has to download a single tar file, and execute just a few commands to install also the most important external packages.

The IRAF installation procedure should be valid for recent Mac OS X releases running on an 64-bit Intel CPU.

Note for El Capitan users: Due to the introduction of the "System Integrity Protection" policy in the latest version of Mac OS X (see this Ars Technica review for details), there are some issues regarding installing and running IRAF (and xgterm). Please read this IRAF post where some fixes or workarounds are suggested.

Download the IRAF tarfile

Create the /iraf/ tree and unpack the tarfile

  • We follow the standard route and install IRAF into /iraf/iraf/.
    sudo mkdir -p /iraf/iraf/
    cd /iraf/iraf/
    sudo tar -zxvf ~/Downloads/iraf.macx.x86_64.tar.gz

Install

  • Define the iraf variable (the trailing slash is important!):
    export iraf="/iraf/iraf/" (this for a bash shell. For a tcsh shell: setenv iraf "/iraf/iraf/")
  • Run the installation script (we perform a system-wide installation so as to allow different users sharing a same Mac to use IRAF)
    sudo /iraf/iraf/install --system
    The default answers should be fine, but make sure to set "New iraf root directory" to "/iraf/iraf/" if it appears to be set by default to something else (it has been reported that in some cases the suggested value is "/Users/<username>").
  • At this point you should have the "/usr/local/bin/" directory populated with IRAF-related commands, in particular "ecl" and "mkiraf". "/usr/local/bin/" must be included in your PATH (check with echo $PATH); if not, add it to the PATH (for instance, export PATH=${PATH}:/usr/local/bin) You may need to type hash -r to make the shell aware of these new commands.

Install xgterm and DS9

IRAF is best used in a xgterm. You'll also need an image display, the most popular one is DS9.

  • X11IRAF now comes included in the v2.16.1 tarfile, so we only need to create the relevant symlink (no need to download the X11IRAF package)
    cd /usr/local/bin/
    sudo ln -sf /iraf/iraf/vendor/x11iraf/bin.macintel/xgterm
  • Now install DS9, by downloading the appropriate file from http://ds9.si.edu/site/Download.html. Under the link Archive you may find DS9 packages for older Mac OS X releases.

If you are unable to display or interact with images on DS9, getting error messages like "ERROR: Cannot open device (node!imtool,,8192,8192)", you might need to define the IMTDEV variable, as explained in http://iraf.net/forum/viewtopic.php?showtopic=1468688. However, this should not be necessary for DS9 v7.4 and higher versions.

Again, you may need to type hash -r if the bash shell does not recognize the xgterm and ds9 commands (for tcsh type rehash).

Install IRAF external packages

From time to time run the make check command to look if updates are available, and install them with make <packagename>. Usually, TABLES/STSDAS is updated shortly after a new release is published by STScI.

Set up IRAF

  • First set up the IRAF home directory and run mkiraf.
    cd ~/
    mkdir iraf ; cd iraf
    mkiraf (select xgterm as terminal type)
    xgterm & or
    xgterm -ls &
    (the latter will launch xgterm as a login shell, use it if you miss the settings or aliases defined in .bash_profile)

Check the login.cl file just created. If the cache variable is set to "/tmp" or "/tmp//", change it to something like "/tmp/cache/" or "/iraf/cache/".

  • Then, in the new xgterm terminal window:
    cd ~/iraf/
    ds9 &
    ecl or cl

Fix for PyRAF

  • If you use PyRAF, you may notice that you are unable to run TABLES/STSDAS tasks. The reason is that PyRAF will look for executable files in bin.macintel (the directory for 64-bit binaries), but TABLES/STSDAS binaries are actually in bin.macosx, as STScI only provides the two packages in 32-bit. While IRAF's ecl has a fallback mechanism and will use bin.macosx if bin.macintel is unavailable, PyRAF doesn't.
  • Fortunately the fix is quite simple, as we only need to create a symlink from bin.macosx to bin.macintel
    cd /iraf/iraf/extern/stsdas/
    sudo ln -sf bin.macosx bin.macintel
    cd /iraf/iraf/extern/tables/
    sudo ln -sf bin.macosx bin.macintel
    (the above commands should probably be repeated after each update of TABLES/STSDAS)
edit · print · PDF
Page last modified on March 29, 2017, at 12:35 PM