<p>I am on Ubuntu 18.04, and just compiled IRAF successfully. Let me elaborate on my comments.</p>
<p>First, you need to understand how to install C++ packages, such as IRAF your interest here. To install a C++ package, there are two ways:</p>
<ol>
<li><strong>Install binaries directly.</strong> In palin words, download an <code>.exe</code> for your platform version (e.g. Windows 10) and double-click the <code>.exe</code> to install (basically, the computer will copy-paste all the pre-built libraries and header files to your target directory) and everything should work. Similar things happen on Ubuntu Linux that the binary version might just be a <code>.deb</code> package.</li>
<li><strong>Compile from source.</strong> This usually requires you have a basic understanding for how to compile a C++ project, and you will usually need to install other C++ packages as dependences for this purpose. This is the situation of your question here.</li>
</ol>
<p>Since you are installing IRAF using the 2nd approach, let me give you some basic background on how that should work. To compile a C++ project, you need:</p>
<ul>
<li>A C++ compiler. For example, GCC, Visual Studio, CLang, ...</li>
<li>A makefile (or many sub-makefiles) to orginize all the source and header files. It could be a <code>Makefile</code> file, or a <code>CMakeLists.txt</code>. The makefile could be either written by hand, or generated automatically using some scripts.</li>
</ul>
<p>The way to compile IRAF, from its readme, is:</p>
<ul>
<li><p>Generate a makefile using <code>./install</code>. After this step you should see a <code>Makefile</code> generated.</p>
</li>
<li><p>Run <code>make linux64</code> to compile if you are on Linux64. Then, run <code>make sysgen 2&gt;&amp;1 | tee build.log</code> to build. If this step is successful, you will see binary files generated as outputs. In IRAF, these files would be generated in the directory of <code>./bin</code> and <code>./bin.linux64</code>. In my case, these files are:</p>
</li>
</ul>
<pre><code>WDC:~/Downloads/iraf-2.16.1-2018.11.01/bin$ ls
bin.linux64  libc.a        libds.a       libimc.a       liblapack.a  libnlfit.a   libsys.a       x_color.e    x_mkttydata.e  x_proto.e     x_tv.e
cl.e         libcfitsio.a  libex.a       libimd.a       libllsq.a    libsgi.a     libtbtables.a  x_dataio.e   x_ncar.e       x_sgikern.e   x_utilities.e
ecl.e        libcur.a      libfftpack.a  libimfort.a    libmain.o    libslalib.a  libvops.a      x_images.e   x_nttools.e    x_softools.e  x_vol.e
irafks.e     libcurfit.a   libgks.a      libiminterp.a  libmemdbg.a  libstg.a     libVOTable.a   x_imdkern.e  x_obsolete.e   x_stdgraph.e
libbev.a     libdeboor.a   libgsurfit.a  libinterp.a    libncar.a    libsurfit.a  libxtools.a    x_lists.e    x_plot.e       x_system.e
</code></pre>
<p>Now you have finished compilation. You may run a test to see if it is all set. According to readme, you need to run:</p>
<pre><code>./test/run_tests
</code></pre>
<p>My outputs are:</p>
<pre><code>WDC:~/Downloads/iraf-2.16.1-2018.11.01$ ./test/run_tests 
ecl.e: files.md ......
ecl.e: images.imcoords.md ...........
ecl.e: images.imfilter.md ..............
ecl.e: images.imfit.md ...
ecl.e: images.imgeom.md ........
ecl.e: images.immatch.md ..
ecl.e: lists.md .......
ecl.e: noao.astutil.md ........
ecl.e: noao.digiphot.photcal.md .
ecl.e: numerical-recipes.md ..........
ecl.e: programming.md ............
ecl.e: README.md 
ecl.e: testproc.md .........................
ecl.e: test-syntax.md ...xsa
ecl.e: utilities.nttools.md ..............
Test summary:     124 passed
      2 skipped
      1 xfailed
</code></pre>
<p>Hope above text is clear for you to proceed.</p>

CC BY-SA 4.0
2021-04-10T12:04:55.903Z
Oh, Great thanks to you. While reading your comment I found what a dumb I was. I was typing <CR> while I have click on enter. Now I'm seeing the following on my window.
Himanshu
CC BY-SA 4.0
2021-04-10T12:14:00.543Z
Please find https://drive.google.com/drive/folders/1NtpfcOLTd_dgfk1gk8WSZviRjgt6Rp_N?usp=sharing this. This is what I'm seeing right now. As per the instructions I have to add binary files my path. What step should I take? As per your answer.
Himanshu
CC BY-SA 4.0
2021-04-10T12:16:24.023Z
@YoungKindaichi  OK. Could you type `make linux64` and then `make sysgen 2>&1 | tee build.log` and see what happen?
WDC
CC BY-SA 4.0
2021-04-10T12:18:47.020Z
Okay Right now I'm in young_kindaichi@LAPTOP-K91A53NB:~/iraf-2.16.1-2018.11.01$
Himanshu
CC BY-SA 4.0
2021-04-10T12:20:05.777Z
It shows : (util/mkarch linux64)
util/mkarch: 17: export: Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2021.222.0_x64__79rhkp1fndgsc:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program: bad variable name
make: *** [Makefile:109: linux64] Error 2
Himanshu
CC BY-SA 4.0
2021-04-10T12:22:12.300Z
You said, After this step, you should see a Makefile generated. What mean by that I don't see anything like this? Do I see some file?
Himanshu
CC BY-SA 4.0
2021-04-10T12:23:40.223Z
@YoungKindaichi  (i) I believe the error is relevant to the WSL (see for example https://askubuntu.com/questions/1215961/bad-variable-name-in-wsl). Google may be your friend. (ii) From your screen shot there is already a Makefile generated.  -- Unfortunately I cannot help you further and have to leave the conversation like this.  Good luck.
WDC
CC BY-SA 4.0
2021-04-10T12:40:19.193Z
I posted the issue on GitHub to the maintainer too. He said, You just need to type in ``sudo apt install iraf`` The process is complete, but I don't how to know if iraf is installed or not.
Himanshu
CC BY-SA 4.0
2021-04-10T22:34:55.137Z
If IRAF is installed and in the path then you should be able to do `mkiraf`, answer the questions (If I remember correctly (it's been many years since I had to use it), you can just accept all the defaults). Then you can launch the IRAF shell with `cl`. While looking at this Q I noticed NOAO have removed all the IRAF docs and source from their site so unless you have a complete set of instructions that still work 8 years after IRAF maintenance stopped, you may run into more trouble. IRAF had issues on stock Linux, running under WSL could go badly
astrosnapper
CC BY-SA 4.0
2021-04-10T11:52:14.320Z
2021-04-10T11:52:14.320Z
WDC
<p>Recently I asked <a href="https://astronomy.stackexchange.com/q/43334/38780">this</a> question on IRAF like software that can be run in a window but it seems it is not possible. So I installed <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10" rel="nofollow noreferrer">window subsystem for linux</a>. I followed <a href="https://iraf-community.github.io/install.html" rel="nofollow noreferrer">these</a> steps to install IRAF.</p>
<p>Everything works very well till the step <code>./install</code>. The following are the code I'm seeing on my screen:</p>
<pre><code>young_kindaichi@LAPTOP-K91A53NB:~$ sudo -i

[sudo] password for young_kindaichi:

root@LAPTOP-K91A53NB:~# ls

iraf-2.16.1-2018.11.01  v2.16.1+2018.11.01.tar.gz

root@LAPTOP-K91A53NB:~# cd iraf-2.16.1-2018.11.01

root@LAPTOP-K91A53NB:~/iraf-2.16.1-2018.11.01# ls

COPYRIGHT   Makefile         README.md   dev  extern   install  local  mkpkg  pkg  test  util

INSTALL.md  README.contents  RELEASE.md  doc  include  lib      math   noao   sys  unix  vendor

root@LAPTOP-K91A53NB:~/iraf-2.16.1-2018.11.01# ./install  
</code></pre>
<p>which leads me to:</p>
<p><a href="https://i.sstatic.net/mwkt7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mwkt7.png" alt="enter image description here" /></a></p>
<p>As per the guide, It says</p>
<blockquote>
<p>The script will prompt you for the path to the default image directory, the cache directory and the binary files directory. Usually, you can everywhere use the default settings when asked from the install script. You will need to include the binary files directory in your PATH before proceeding to the  step. In BASH this can be done with the command:</p>
</blockquote>
<p>I do not understand this, And I don't what to do now. Please consider that It's the first time I'm using Linux and I don't have any basic knowledge. So please help me.</p>
<hr />
<p>On a suggestion, I downloaded the package at <code>/home/young_kindaichi</code>.</p>
<p>After <code>./install</code></p>
<p>As given in the manual that is &quot;The script will prompt you for the path to the default image directory, the cache directory, and the binary files directory. Usually, you can everywhere use the default settings when asked from the install script&quot;.</p>
<p>I used the following code:</p>
<pre><code>
Default root image storage directory (/home/young_kindaichi/.iraf/imdir): &lt;CD&gt;

*** The definition of imdir cannot be the same as the iraf

*** root, please choose a different directory. Ideally this

*** should be some large data area on your system or a user

*** data area such as /home, /users, /u1, etc.

Default root image storage directory (/home/young_kindaichi/.iraf/imdir): 
</code></pre>
<p>The problem is as I can understood it's not taking default settings.</p>

CC BY-SA 4.0
2021-04-10T09:23:47.497Z
I know nothing about IRAF. But it seems to me that what you are doing is just installing the C++ package (i.e. compile the binaries from source).  After `./install`, could you try to see if there is any makefiles generated, and a simple `make` should do the trick.
WDC
CC BY-SA 4.0
2021-04-10T09:25:12.557Z
Don't run the install script as root. You only need to use sudo to copy the files to system directories.  But you don't need this for a local install. So don't use sudo. and try using all default settings to see if it works.
James K
CC BY-SA 4.0
2021-04-10T10:46:29.127Z
@WDC I'm not too familiar with this code. I don't understand what you mean by makefiles but there is a directory Makefile. I do not understand what is made. If you tell me to step by step what I have to see and what I have to try then I can do it. Please help me.
Himanshu
CC BY-SA 4.0
2021-04-10T10:49:26.767Z
@JamesK Alright I downloaded the package in /home/young_kindaichi and unpacked it. Again I do the same. It says to hit <CR> to accept the default value. But when I did so :                                                                             Default root image storage directory (/home/young_kindaichi/.iraf/imdir): <CR>

   ***  The definition of imdir cannot be the same as the iraf
   ***  root, please choose a different directory.  Ideally this
   ***  should be some large data area on your system or a user
   ***  data area such as /home, /users, /u1, etc.
Himanshu
CC BY-SA 4.0
2021-04-10T10:49:47.583Z
I don't know what to do @JamesK , Please help me fixing this.
Himanshu
CC BY-SA 4.0
2021-04-10T11:13:45.363Z
I don't know.  I've never installed it.  You sound like you are at college.  I'd suggest walking into the computer science department and calling out "Hey! Anybody here know anything about Linux!?"    You can usually pay computer science students for their kindness in snacks.
James K
CC BY-SA 4.0
2021-04-10T11:16:50.553Z
Alternatively you can try using virtualbox and a virtual ubuntu installation, then you can do a binary `.deb` package install, but this is a lot of fuss to go through before you get to installing iraf.  But it would be straightforward for most computing students, it just takes a bit of time.
James K
CC BY-SA 4.0
2021-04-10T11:17:50.397Z
Finally if nothing works, go back to the professor.  He is paid to help you!
James K
CC BY-SA 4.0
2021-04-11T00:24:13.880Z
@JamesK "I'd suggest walking into the computer science department and calling out 'Hey! Anybody here know anything about Linux!?'" COVID-19 has changed things a bit, depending on where one is in the world at this point.
uhoh
<software>
Installing IRAF
Himanshu
# Installing IRAF

(Asked by: username_0 on 2021-04-10)

Recently I asked this question on IRAF like software that can be run in a window but it seems it is not possible. So I installed window subsystem for linux. I followed these steps to install IRAF.
Everything works very well till the step ./install. The following are the code I'm seeing on my screen:
young_kindaichi@LAPTOP-K91A53NB:~$ sudo -i

[sudo] password for young_kindaichi:

root@LAPTOP-K91A53NB:~# ls

iraf-2.16.1-2018.11.01  v2.16.1+2018.11.01.tar.gz

root@LAPTOP-K91A53NB:~# cd iraf-2.16.1-2018.11.01

root@LAPTOP-K91A53NB:~/iraf-2.16.1-2018.11.01# ls

COPYRIGHT   Makefile         README.md   dev  extern   install  local  mkpkg  pkg  test  util

INSTALL.md  README.contents  RELEASE.md  doc  include  lib      math   noao   sys  unix  vendor

root@LAPTOP-K91A53NB:~/iraf-2.16.1-2018.11.01# ./install  

which leads me to:

As per the guide, It says

The script will prompt you for the path to the default image directory, the cache directory and the binary files directory. Usually, you can everywhere use the default settings when asked from the install script. You will need to include the binary files directory in your PATH before proceeding to the  step. In BASH this can be done with the command:

I do not understand this, And I don't what to do now. Please consider that It's the first time I'm using Linux and I don't have any basic knowledge. So please help me.

On a suggestion, I downloaded the package at /home/young_kindaichi.
After ./install
As given in the manual that is "The script will prompt you for the path to the default image directory, the cache directory, and the binary files directory. Usually, you can everywhere use the default settings when asked from the install script".
I used the following code:

Default root image storage directory (/home/young_kindaichi/.iraf/imdir): 

*** The definition of imdir cannot be the same as the iraf

*** root, please choose a different directory. Ideally this

*** should be some large data area on your system or a user

*** data area such as /home, /users, /u1, etc.

Default root image storage directory (/home/young_kindaichi/.iraf/imdir): 

The problem is as I can understood it's not taking default settings.

**Tags:** software
> **Comments:**
> **username_1**: I know nothing about IRAF. But it seems to me that what you are doing is just installing the C++ package (i.e. compile the binaries from source).  After `./install`, could you try to see if there is any makefiles generated, and a simple `make` should do the trick.  
> **username_2**: Don't run the install script as root. You only need to use sudo to copy the files to system directories.  But you don't need this for a local install. So don't use sudo. and try using all default settings to see if it works.  
> **username_0**: @WDC I'm not too familiar with this code. I don't understand what you mean by makefiles but there is a directory Makefile. I do not understand what is made. If you tell me to step by step what I have to see and what I have to try then I can do it. Please help me.  
> **username_0**: @JamesK Alright I downloaded the package in /home/young_kindaichi and unpacked it. Again I do the same. It says to hit <CR> to accept the default value. But when I did so :                                                                             Default root image storage directory (/home/young_kindaichi/.iraf/imdir): <CR>     ***  The definition of imdir cannot be the same as the iraf    ***  root, please choose a different directory.  Ideally this    ***  should be some large data area on your system or a user    ***  data area such as /home, /users, /u1, etc.  
> **username_0**: I don't know what to do @JamesK , Please help me fixing this.  
> **username_2**: I don't know.  I've never installed it.  You sound like you are at college.  I'd suggest walking into the computer science department and calling out "Hey! Anybody here know anything about Linux!?"    You can usually pay computer science students for their kindness in snacks.  
> **username_2**: Alternatively you can try using virtualbox and a virtual ubuntu installation, then you can do a binary `.deb` package install, but this is a lot of fuss to go through before you get to installing iraf.  But it would be straightforward for most computing students, it just takes a bit of time.  
> **username_2**: Finally if nothing works, go back to the professor.  He is paid to help you!  
> **username_3**: @JamesK "I'd suggest walking into the computer science department and calling out 'Hey! Anybody here know anything about Linux!?'" COVID-19 has changed things a bit, depending on where one is in the world at this point.  

---

## 1 answers

### Answer by username_1 on 2021-04-10. Score: 4 | Accepted answer

I am on Ubuntu 18.04, and just compiled IRAF successfully. Let me elaborate on my comments.
First, you need to understand how to install C++ packages, such as IRAF your interest here. To install a C++ package, there are two ways:

Install binaries directly. In palin words, download an .exe for your platform version (e.g. Windows 10) and double-click the .exe to install (basically, the computer will copy-paste all the pre-built libraries and header files to your target directory) and everything should work. Similar things happen on Ubuntu Linux that the binary version might just be a .deb package.
Compile from source. This usually requires you have a basic understanding for how to compile a C++ project, and you will usually need to install other C++ packages as dependences for this purpose. This is the situation of your question here.

Since you are installing IRAF using the 2nd approach, let me give you some basic background on how that should work. To compile a C++ project, you need:

A C++ compiler. For example, GCC, Visual Studio, CLang, ...
A makefile (or many sub-makefiles) to orginize all the source and header files. It could be a Makefile file, or a CMakeLists.txt. The makefile could be either written by hand, or generated automatically using some scripts.

The way to compile IRAF, from its readme, is:

Generate a makefile using ./install. After this step you should see a Makefile generated.

Run make linux64 to compile if you are on Linux64. Then, run make sysgen 2>&1 | tee build.log to build. If this step is successful, you will see binary files generated as outputs. In IRAF, these files would be generated in the directory of ./bin and ./bin.linux64. In my case, these files are:


WDC:~/Downloads/iraf-2.16.1-2018.11.01/bin$ ls
bin.linux64  libc.a        libds.a       libimc.a       liblapack.a  libnlfit.a   libsys.a       x_color.e    x_mkttydata.e  x_proto.e     x_tv.e
cl.e         libcfitsio.a  libex.a       libimd.a       libllsq.a    libsgi.a     libtbtables.a  x_dataio.e   x_ncar.e       x_sgikern.e   x_utilities.e
ecl.e        libcur.a      libfftpack.a  libimfort.a    libmain.o    libslalib.a  libvops.a      x_images.e   x_nttools.e    x_softools.e  x_vol.e
irafks.e     libcurfit.a   libgks.a      libiminterp.a  libmemdbg.a  libstg.a     libVOTable.a   x_imdkern.e  x_obsolete.e   x_stdgraph.e
libbev.a     libdeboor.a   libgsurfit.a  libinterp.a    libncar.a    libsurfit.a  libxtools.a    x_lists.e    x_plot.e       x_system.e

Now you have finished compilation. You may run a test to see if it is all set. According to readme, you need to run:
./test/run_tests

My outputs are:
WDC:~/Downloads/iraf-2.16.1-2018.11.01$ ./test/run_tests 
ecl.e: files.md ......
ecl.e: images.imcoords.md ...........
ecl.e: images.imfilter.md ..............
ecl.e: images.imfit.md ...
ecl.e: images.imgeom.md ........
ecl.e: images.immatch.md ..
ecl.e: lists.md .......
ecl.e: noao.astutil.md ........
ecl.e: noao.digiphot.photcal.md .
ecl.e: numerical-recipes.md ..........
ecl.e: programming.md ............
ecl.e: README.md 
ecl.e: testproc.md .........................
ecl.e: test-syntax.md ...xsa
ecl.e: utilities.nttools.md ..............
Test summary:     124 passed
      2 skipped
      1 xfailed

Hope above text is clear for you to proceed.

> **Comments:**
> **username_0**: Oh, Great thanks to you. While reading your comment I found what a dumb I was. I was typing <CR> while I have click on enter. Now I'm seeing the following on my window.  
> **username_0**: Please find https://drive.google.com/drive/folders/1NtpfcOLTd_dgfk1gk8WSZviRjgt6Rp_N?usp=sharing this. This is what I'm seeing right now. As per the instructions I have to add binary files my path. What step should I take? As per your answer.  
> **username_1**: @YoungKindaichi  OK. Could you type `make linux64` and then `make sysgen 2>&1 | tee build.log` and see what happen?  
> **username_0**: Okay Right now I'm in young_kindaichi@LAPTOP-K91A53NB:~/iraf-2.16.1-2018.11.01$  
> **username_0**: It shows : (util/mkarch linux64) util/mkarch: 17: export: Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2021.222.0_x64__79rhkp1fndgsc:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program: bad variable name make: *** [Makefile:109: linux64] Error 2  
> **username_0**: You said, After this step, you should see a Makefile generated. What mean by that I don't see anything like this? Do I see some file?  
> **username_1**: @YoungKindaichi  (i) I believe the error is relevant to the WSL (see for example https://askubuntu.com/questions/1215961/bad-variable-name-in-wsl). Google may be your friend. (ii) From your screen shot there is already a Makefile generated.  -- Unfortunately I cannot help you further and have to leave the conversation like this.  Good luck.  
> **username_0**: I posted the issue on GitHub to the maintainer too. He said, You just need to type in ``sudo apt install iraf`` The process is complete, but I don't how to know if iraf is installed or not.  
> **username_4**: If IRAF is installed and in the path then you should be able to do `mkiraf`, answer the questions (If I remember correctly (it's been many years since I had to use it), you can just accept all the defaults). Then you can launch the IRAF shell with `cl`. While looking at this Q I noticed NOAO have removed all the IRAF docs and source from their site so unless you have a complete set of instructions that still work 8 years after IRAF maintenance stopped, you may run into more trouble. IRAF had issues on stock Linux, running under WSL could go badly  

---

