2

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:

enter image description here

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): <CD>

*** 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.

Young Kindaichi
  • 483
  • 4
  • 10
  • 2
    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 Apr 10 '21 at 09:23
  • 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. – James K Apr 10 '21 at 09:25
  • @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. – Young Kindaichi Apr 10 '21 at 10:46
  • @JamesK Alright I downloaded the package in /home/young_kindaichi and unpacked it. Again I do the same. It says to hit to accept the default value. But when I did so : 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.

    – Young Kindaichi Apr 10 '21 at 10:49
  • I don't know what to do @JamesK , Please help me fixing this. – Young Kindaichi Apr 10 '21 at 10:49
  • 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 Apr 10 '21 at 11:13
  • 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 Apr 10 '21 at 11:16
  • Finally if nothing works, go back to the professor. He is paid to help you! – James K Apr 10 '21 at 11:17
  • @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 Apr 11 '21 at 00:24

1 Answers1

4

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:

  1. 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.
  2. 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.

WDC
  • 454
  • 3
  • 13
  • Oh, Great thanks to you. While reading your comment I found what a dumb I was. I was typing while I have click on enter. Now I'm seeing the following on my window. – Young Kindaichi Apr 10 '21 at 12:04
  • 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. – Young Kindaichi Apr 10 '21 at 12:14
  • @YoungKindaichi OK. Could you type make linux64 and then make sysgen 2>&1 | tee build.log and see what happen? – WDC Apr 10 '21 at 12:16
  • Okay Right now I'm in young_kindaichi@LAPTOP-K91A53NB:~/iraf-2.16.1-2018.11.01$ – Young Kindaichi Apr 10 '21 at 12:18
  • 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 – Young Kindaichi Apr 10 '21 at 12:20
  • 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? – Young Kindaichi Apr 10 '21 at 12:22
  • @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 Apr 10 '21 at 12:23
  • 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. – Young Kindaichi Apr 10 '21 at 12:40
  • 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 Apr 10 '21 at 22:34