View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

xc: Command not found.

fsidoli wrote on May 29, 2008

Hi there,

I'm trying to run a program in/outside of IRAF that use the portable IRAF compile/link utility, 'xc'. I can see that I have the xc.e installed on my system under '/iraf/iraf/unix/bin.redhat/xc.e' and that it seems to be listed under the softools package. However, when I try to run xc in iraf I simply get the error message 'xc: Command not found.'.

Can you tell me if there is anything obvious I am forgetting to do? Do I need to set a path variable?

Many thanks,
Fab

Mike Fitzpatrick wrote on May 29, 2008

XC is declared as a foreign task in the CL, meaning that it is executed with a shell spawned to run the command. That shell is not a normal login shell and so the environment typically comes from the .cshrc file and not the .login file, this means that the $path defined in .cshrc must include the directory where you've installed the local iraf commands.

One way to check whether your paths are setup correctly is with a simple shell escape, e.g.

cl> !which xc


should return the path if it is found, or a 'command not found' otherwise.

Cheers,
-Mike

fsidoli wrote on May 29, 2008

Hi Mike,

The result of doing

>cl !which xc
returns

/usr/local/bin/xc
which is softlinked to

/iraf/iraf/unix/bin.redhat/xc.e 


However, typing 'xc' still yields a 'command not found' error.

Cheers,
Fab

Mike Fitzpatrick wrote on May 29, 2008

If you try running the 'xc' command outside of the CL does it work? If you run it as "cl> !!which cl" (i.e. with two exlamation marks) does it work? In this second case, the '!!' forces the command to be executed in a Bourne shell, in the first case this should be the same shell as when you execute a foreign command. In either case, 'command not found' is a shell message indicating a path problem.

You might also try "cl> !env" to dump the full environment -- look for the 'path' or 'PATH' variable to be sure it has /usr/local/bin, also check the SHELL variable to see which shell is being used. This will tell you whether you need to edit your .cshrc file or .bashrc.

Cheers,
-Mike

fsidoli wrote on May 29, 2008

Hi Mike,

Running 'xc' outside of the CL results in the same error message. I'm running a tcsh by default. Under bash (both inside and outside of the CL) I get the error message:

'/bin/sh: /usr/local/bin/xc:4?: bad ELF interpreter: No such file or directory'.

Doing a "cl> !env" shows me that I am using a tcsh shell "/usr/local/bin/tcsh" and that my PATH includes "/usr/local/bin".

I hope this helps to narrow down the problem.

Many thanks,
Fab

Mike Fitzpatrick wrote on May 29, 2008

The clue here is the 'bad ELF interpreter', which implies that the bin.redhat version of XC isn't gonna run on your machine. What OS are you using? The 'redhat' arch is appropriate for RedHat/Fedora/CentOS and many other linuxes but if XC won't run at the host level it won't work from IRAF either. Also, which version of IRAF are we talking about?

-Mike

fsidoli wrote on May 29, 2008

Hi Mike,

I'm running Scientific Linux SL release 4.6 and IRAF v2.12.2a.
I believe that the redhat 'arch' should be OK for this OS.

Fab

Last post on May 29, 2008