How to Install IRAF (Image Reduction and Analysis Facility)

IRAF – Image Reduction and Analysis Facility is a product of the National Optical Astronomy Observatory (NOAO).
It has been widely used in the astronomical community for reducing data in the form of images and spectra.

IRAF works best in UNIX-based distributions such as Ubuntu, Debian, or Fedora.

Step 1 – Check your system architecture

Before installing, find out if your operating system is 64-bit or 32-bit.

$ sudo -s # specify your user password
$ uname -m # shows 64-bit (x86_64) or 32-bit (i686)

Step 2 – Download the IRAF package

$ wget https://github.com/iraf-community/iraf/archive/refs/tags/v2.16.1+2021.06.14.tar.gz

The downloaded file
iraf-2.16.1-2021.06.14.tar.gz
will appear in your Downloads folder.

Move it to your preferred working directory (e.g., /home) and extract:

$ mv iraf-2.16.1-2021.06.14.tar.gz /home
$ tar -xvzf iraf-2.16.1-2021.06.14.tar.gz
$ mv /home/iraf-2.16.1-2021.06.14 /home/iraf

Step 3 – Install required packages

On Debian/Ubuntu/Mint/Devuan/Raspbian

$ sudo apt install gcc make flex
$ sudo apt install libcurl4-openssl-dev libexpat-dev libreadline-dev

On Fedora/Red Hat/Scientific Linux

$ sudo dnf install gcc make perl flex
$ sudo dnf install libcurl-devel expat-devel readline-devel

On macOS X

Install Xcode Command Line Tools (required to build from source):

$ xcode-select –install

Step 4 – Run the IRAF installer

Navigate to the IRAF folder and execute the installer:

Replace /path/to/iraf/bin/ with the binary path printed by the install script.

$ cd /home/iraf
$ ./install

The script will prompt for paths to:

  • the default image directory

  • the cache directory

  • the binary files directory

You can safely accept the default values by pressing Enter each time.

Step 5 – Add IRAF to your PATH

Before compiling, include the IRAF binary directory in your PATH variable:

$ export PATH=/path/to/iraf/bin/:$PATH

Replace /path/to/iraf/bin/ with the binary path printed by the install script.

Step 6 – Build the software

Configure for your architecture and build the system:

$ make <arch>
$ make sysgen 2>&1 | tee build.log
This step takes time; IRAF is compiling its full software tree.

Replace <arch> with the appropriate keyword for your system (e.g., linux64)

Figure: Supported architectures and CPU types for building IRAF.

<arch> Operating System Supported CPU Types
linux64 Linux 64-bit x86_64, arm64, mips64, ppc64, riscv64, alpha
linux Linux 32-bit i386, x32, arm, mips
macos64 macOS 64-bit arm64
macintel macOS 64-bit x86_64
macosx macOS 32-bit i386
freebsd64 FreeBSD 64-bit x86_64
freebsd FreeBSD 32-bit i386, arm
hurd GNU HURD 32-bit i386

Step 7 – Run tests

Verify that the IRAF build completed successfully:

$ ./test/run_tests

Step 8 – Launch IRAF

Open a new terminal and type:

$ cl

This launches the IRAF Command Language (CL) environment.


Do Not Delete Your build.log

The file build.log inside the iraf folder contains your entire build record. Keep it for troubleshooting or future upgrades.

Summary

Step Action Purpose
1 Check OS architecture Confirm 32/64-bit
2 Download IRAF tarball Get latest release
3 Install dependencies Enable compilation
4 Run install script Configure directories
5 Export PATH Allow terminal access
6 Build IRAF Compile code
7 Run tests Verify installation
8 Launch cl Start working!

Leave a Reply

Your email address will not be published. Required fields are marked *