waqas bhatti / notes / installing iraf on fedora/rhel

Installing IRAF 2.16

The newest version of IRAF is much easier to install than older versions. The following steps have been tested on Fedora 18 64-bit, but should work for older Fedora/RHEL (+ clones) installations.

First, we need to install some required packages. Switch to the root user for all steps below. As root:

yum install tcsh ncurses ds9 xpa

We'll be using IRAF with xgterm, so we need to install a required library: libXmu.so.6. For Fedora 18, this is provided in the libXmu-1.1.1-2.fc18.i686 package. Use yum whatprovides libXmu.so.6 to get the correct package for your system. Go ahead and install that with yum:

yum install libXmu-1.1.1-2.fc18.i686

Now, we can go ahead and install IRAF. Then, make the required directories for IRAF:

mkdir -p /home/iraf/iraf/local

Link the directories to the /iraf directory.

ln -s /home/iraf /iraf

Add the IRAF user (not sure if this step is even required any more, but just in case):

useradd -c "IRAF login" -d /iraf/iraf/local -m -s /bin/csh -u 1001 iraf

Change the ownership on the /iraf directory so IRAF can use it:

chown -R iraf:iraf /iraf

Download the IRAF 2.16 tarball and extract it in the /iraf/iraf directory:

wget ftp://iraf.noao.edu/iraf/v216/PCIX/iraf.lnux.x86_64.tar.gz
tar xvfz iraf.lnux.x86_64.tar.gz

Set the required environmental variable, and run the IRAF install script (most of the questions should be straightforward; say no to IRAF networking, and tape driver installs since no one uses that stuff any more):

export iraf='/iraf/iraf/'
$iraf/unix/hlib/install

In the /iraf/iraf/ directory, make a directory for x11iraf, then download the x11iraf tarball there:

mkdir /iraf/iraf/x11iraf
cd /iraf/iraf/x11iraf
wget http://iraf.noao.edu/x11iraf/x11iraf-v2.0BETA-bin.redhat.tar.gz
tar xvfz x11iraf-v2.0BETA-bin.redhat.tar.gz

Make the required app-defaults directory for x11iraf:

mkdir /usr/lib64/X11/app-defaults

Now run the x11iraf installation script:

./install

Finally, we're going to use the new package repositories feature of IRAF 2.16 to install some useful external IRAF packages, such as rvsao, guiapps, and stsdas. To do this:

cd /iraf/iraf/extern
./config (and then wait a bit while it gets the repo info)
ls (to list available packages when the config script is done)
make rvsao stsdas guiapps

And now, we can test out our new IRAF installation. Switch back to a normal user and then:

mkiraf (in your home directory -> creates a login.cl file)
--> choose xgterm as the terminal type
ds9 &  --> starts DS9 and sets up the XPA connection that IRAF will use
xgterm & --> starts up xgterm which enables IRAF to show its graphics output
--> in xgterm: cl --> starts up IRAF

For post-install configuration, jump to Configuring IRAF below.

Useful references

Older information for IRAF 2.14

Note that this section might be outdated. I last tested these instructions on a Fedora 15 64-bit machine with IRAF 2.14, and they worked.

The following steps are to be carried out while logged as the superuser. Much of this is discussed in detail at http://gabriel-ip.blogspot.com and http://gracca.wordpress.com/how-to-install-iraf/. These steps could probably also be easily turned into a shell-script to automate installation.

1.  su -
2.  yum install tcsh ncurses ds9 xpa
3.  mkdir /home/iraf
4.  mkdir /home/iraf/iraf
5.  mkdir /home/iraf/iraf/local
6.  mkdir /home/iraf/irafbin
7.  mkdir /home/iraf/irafbin/bin.redhat
8.  mkdir /home/iraf/irafbin/noao.bin.redhat
9.  mkdir /home/iraf/source
10. mkdir /home/iraf/extern
11. ln -s /home/iraf /iraf
12. useradd -c "IRAF system login" -d /iraf/iraf/local -m -s /bin/csh -u 1001 iraf
13. cd /
14. chown -R iraf iraf/
15. chgrp -R iraf iraf/
16. su iraf
17. cd /iraf/source
18. wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/as.pcix.gen.gz
19. wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/ib.rhux.x86.gz
20. wget http://iraf.noao.edu/iraf/ftp/iraf/v214/PCIX/nb.rhux.x86.gz
21. setenv iraf /iraf/iraf
22. cd $iraf
23. tar xvfz /iraf/source/as.pcix.gen.gz
24. cd $iraf/bin.redhat
25. tar xvfz /iraf/source/ib.rhux.x86.gz
26. cd $iraf/noao/bin.redhat
27. tar xvfz /iraf/source/nb.rhux.x86.gz
28. cd $iraf/unix/hlib
29. source irafuser.csh
30. su
31. ./install
32. exit
33. cd
34. source .login
35. rehash
36. cd /home/iraf/irafbin/bin.redhat
37. wget http://iraf.net/ftp/pub/fitz/ecl.e
38. mv ecl.e ecl.e.old
39. mv ecl.e.1 ecl.e
40. chmod +x ecl.e
41. su
42. mkdir /usr/lib/X11/app-defaults
43. mkdir /usr/local/src/x11iraf
44. cd /usr/local/src/x11iraf
45. wget http://iraf.net/ftp/iraf/x11iraf/x11iraf-v1.5DEV-bin.redhat.tar.gz
46. tar xvfz x11iraf-v1.5DEV-bin.redhat.tar.gz
47. ./install
48. exit
49. change to normal user
50. mkiraf
51. xgterm &
52. ds9 &
53. cl

Configuring IRAF

You will probably want to set up the login.cl file so that the default image format is FITS, and change the width of the FITS viewer to a more comfortable size. Find the following section in login.cl:

# Uncomment and edit to change the defaults
#set	editor		= vi
#set	printer		= lp
#set	pspage		= "letter"
#set	stdimage	= imt800
#set	stdimcur	= stdimage
#set	stdplot		= lw
#set	clobber		= no
#set	filewait	= yes
#set	cmbuflen	= 512000
#set	min_lenuserarea	= 64000
#set	imtype		= "imh"
set	imextn		= "oif:imh fxf:fits,fit fxb:fxb plf:pl qpf:qp stf:hhh,??h"

Edit these lines and set as below:

set	stdimage	= imt2048
set	imtype		= "fits"