View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Problem logging into IRAF

Guest wrote on Jan 20, 2006

Hello,

I'm having trouble getting IRAF to work. It work last week, but when I
close the xgterm, and reopen one and tried running cl I got the following
error:
Badly placed ()'s.

I've tried logging in from a SUN machine, and two linux boxes and I still
get this message. I've ran mkiraf, and I still get this error.

Also, I still get this error when I tried going into a directory without a
LOGIN.CL file.

I'm not sure if the problem is with my LOGIN.CL file or perhaps my shell.

I've seen this error when I source AIPS, but that was fixed by switching
my shell to bash and sourcing the corresponding AIPS file.

FYI: I tried typing cl in both csh, tcsh, and bash.

Thank you
- Chun Ly

Post generated using Mail2Forum (http://www.mail2forum.com)

Mike Fitzpatrick wrote on Jan 20, 2006

The message is coming from the C-shell, and since the 'cl' command is actually a C-shell startup script, and given your other symptoms, the problem is most likely in your .cshrc file. The simplest way to find the problem line is with

csh -x ~/.cshrc

to trace the script. Once you find the error and fix it you should be okay, be
sure to also check any files that your .cshrc might source.

-Mike

chunly wrote on Jan 20, 2006

Dear Mike. I've tried what you suggested, and it isn't my .cshrc file

I believe it has to do with IRAF source files:
I reran cl: csh -x /usr/local/bin/cl and got the following:
[chun@seyfert ~]$ csh -x /usr/local/bin/cl
setenv iraf /usr/local/pkg/iraf/iraf/
setenv host /usr/local/pkg/iraf/iraf//unix/
setenv hlib /usr/local/pkg/iraf/iraf//unix/hlib/
setenv hbin /usr/local/pkg/iraf/iraf//unix/bin/
source /usr/local/pkg/iraf/iraf//unix/hlib/irafuser.csh
if ( -f /etc/redhat-release ) then
if ( `uname -m` == ppc ) then
uname -m
setenv MACH redhat
endif
else if ( -f /etc/SuSE-release ) then
if ( redhat == darwin ) then
setenv hostid unix
setenv host /usr/local/pkg/iraf/iraf/unix/
setenv hlib /usr/local/pkg/iraf/iraf/unix/hlib/
setenv hbin /usr/local/pkg/iraf/iraf/unix/bin.redhat/
setenv tmp /tmp/
setenv CC gcc
setenv F77 /usr/local/pkg/iraf/iraf/unix/hlib//f77.sh
setenv F2C /usr/local/pkg/iraf/iraf/unix/bin.redhat//f2c.e
setenv RANLIB ranlib
Badly placed ()'s.

I've also turn on verbose to see what happen:
[chun@seyfert ~]$ csh -v /usr/local/bin/cl

setenv iraf /usr/local/pkg/iraf/iraf/
setenv host $iraf/unix/
setenv hlib $iraf/unix/hlib/
setenv hbin $iraf/unix/bin/
source $iraf/unix/hlib/irafuser.csh

if ( -f /etc/redhat-release ) then
if ( `uname -m` == "ppc" ) then

setenv MACH redhat
endif
else if ( -f /etc/SuSE-release ) then

if ( $MACH == "darwin" ) then

setenv hostid unix
setenv host ${iraf}unix/
setenv hlib ${iraf}unix/hlib/
setenv hbin ${iraf}unix/bin.$MACH/
setenv tmp /tmp/

setenv CC gcc
setenv F77 $hlib/f77.sh
setenv F2C $hbin/f2c.e
setenv RANLIB ranlib

switch ( $MACH )
Badly placed ()'s.

I don't know much about IRAF's structure. I never encountered this problem before with IRAF. Any ideas?

Mike Fitzpatrick wrote on Jan 20, 2006

setenv hostid unix
setenv host /usr/local/pkg/iraf/iraf/unix/
setenv hlib /usr/local/pkg/iraf/iraf/unix/hlib/
setenv hbin /usr/local/pkg/iraf/iraf/unix/bin.redhat/
setenv tmp /tmp/
setenv CC gcc
setenv F77 /usr/local/pkg/iraf/iraf/unix/hlib//f77.sh
setenv F2C /usr/local/pkg/iraf/iraf/unix/bin.redhat//f2c.e
setenv RANLIB ranlib


You've apparently got some sort of modified cl.csh script, none of this (and some other output) is in the script that comes with the standard system. The MACH variable is getting set but the error is in the switch statement someplace. Please post the entire script if you can't figure it out. Any idea how the script was modified and by whom?

-Mike

chunly wrote on Jan 20, 2006

IRAF was installed by the system admin. I hope we can find out what the problem is so I can tell them how to fix it.

Here's the script, /usr/local/pkg/iraf/iraf/unix/hlib/irafuser.csh:
# IRAF definitions for the UNIX/csh user. The additional variables iraf$ and
# home$ should be defined in the user's .login file.

if (-f /etc/redhat-release) then
if (`uname -m` == "ppc") then
setenv MACH linuxppc
else
setenv MACH redhat
endif
else if (-f /etc/SuSE-release) then
setenv MACH suse
else
setenv MACH `uname -s | tr '[A-Z]' '[a-z]'`
endif

if ($MACH == "darwin") then
setenv MACH macosx
endif

setenv hostid unix
setenv host ${iraf}unix/
setenv hlib ${iraf}unix/hlib/
setenv hbin ${iraf}unix/bin.$MACH/
setenv tmp /tmp/

# Default to GCC for compilation.
setenv CC gcc
setenv F77 $hlib/f77.sh
setenv F2C $hbin/f2c.e
setenv RANLIB ranlib

switch ($MACH)
case freebsd:
setenv HSI_CF "-O -DBSD -w -Wunused"
setenv HSI_XF "-Inolibc -/DBSD -w -/Wunused"
setenv HSI_FF "-O"
setenv HSI_LF "-static"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS "-lcompat"
set mkzflags = "'lflags=-z' -/static"
breaksw

case macosx:
setenv CC cc
setenv CC_f2c cc
setenv F2C $hbin/f2c.e

setenv HSI_CF "-O -DMACOSX -w -Wunused"
setenv HSI_XF "-Inolibc -/DMACOSX -w -/Wunused"
setenv HSI_FF "-O"
setenv HSI_LF ""
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-z'"
breaksw

case linux:
setenv HSI_CF "-O -DLINUX -DPOSIX -DSYSV -w -Wunused"
setenv HSI_XF "-Inolibc -w -/Wunused"
setenv HSI_FF "-O"
setenv HSI_LF "-Wl,-Bstatic"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw

case redhat:
setenv HSI_CF "-O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -Wunused"
setenv HSI_XF "-Inolibc -w -/Wunused"
setenv HSI_FF "-O"
setenv HSI_LF "-Wl,-Bstatic"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw

case suse:
setenv HSI_CF "-O -DSUSE -DLINUX -DPOSIX -DSYSV -w -Wunused"
setenv HSI_XF "-Inolibc -w -/Wunused"
setenv HSI_FF "-O"
setenv HSI_LF "-Wl,-Bstatic -specs=/iraf/iraf//unix/bin.suse/gcc-specs"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw

case sunos:
setenv HSI_CF "-O -DSOLARIS -DX86 -DPOSIX -DSYSV -w -Wunused"
setenv HSI_XF "-Inolibc -w -/Wunused"
setenv HSI_FF "-O"
#setenv HSI_LF "-t -Wl,-Bstatic"
#setenv HSI_LFLAGS "-t -Wl,-Bstatic"
#setenv HSI_OSLIBS \
# "-lsocket -lnsl -lintl -Wl,-Bdynamic -ldl -Wl,-Bstatic -lelf"
setenv HSI_LF "-t"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS "-t"
setenv HSI_OSLIBS "-lsocket -lnsl -lintl -ldl -lelf"
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw

case linuxppc:
setenv HSI_CF "-O -DLINUX -DREDHAT -DLINUXPPC -DPOSIX -DSYSV -w -Wunused"
setenv HSI_XF "-Inolibc -w -/Wunused"
setenv HSI_FF "-O"
setenv HSI_LF "-Wl,-Bstatic"
setenv HSI_F77LIBS ""
setenv HSI_LFLAGS ""
setenv HSI_OSLIBS ""
set mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
breaksw

default:
echo 'Warning in hlib$irafuser.csh: unknown platform '"$MACH"
exit 1
breaksw
endsw

# The following determines whether or not the VOS is used for filename mapping.
if (-f ${iraf}lib/libsys.a) then
setenv HSI_LIBS\
"${hlib}libboot.a ${iraf}lib/libsys.a ${iraf}lib/libvops.a ${hlib}libos.a"
else
setenv HSI_CF "$HSI_CF -DNOVOS"
setenv HSI_LIBS "${hlib}libboot.a ${hlib}libos.a"
endif

setenv HSI_LIBS "$HSI_LIBS $HSI_OSLIBS"

alias mkiraf ${hlib}mkiraf.csh
alias mkmlist ${hlib}mkmlist.csh
alias mkz ${hbin}mkpkg.e "$mkzflags"

alias edsym ${hbin}edsym.e
alias generic ${hbin}generic.e
alias mkpkg ${hbin}mkpkg.e
alias rmbin ${hbin}rmbin.e
alias rmfiles ${hbin}rmfiles.e
alias rtar ${hbin}rtar.e
alias wtar ${hbin}wtar.e
alias xc ${hbin}xc.e
alias xyacc ${hbin}xyacc.e

Mike Fitzpatrick wrote on Jan 20, 2006

The cl.csh and irafuser.csh scripts are two different things: /usr/local/bin/cl should be a symlink to the cl.csh that is actually used to start iraf, the irafuser.csh is an environment definition file that you normally 'source' in your .cshrc file along with other definitions such as

setenv iraf /iraf/iraf/
setenv IRAFARCH redhat
source $iraf/unix/hlib/irafuser.csh

Does your /usr/local/bin/cl actually point to irafuser.csh, if so it should be changed. The cl.csh script is run with the '-f' flag so your .cshrc shouldn't
be read, although I'm still not sure why executing irafuser.csh would create the error, I'd expect it to simply return to the prompt.
In any case, re-running the install script should fix the links.

-Mike

chunly wrote on Jan 20, 2006

Thanks for your help Mike.

The system admin and I debug what the problem is. You're initial hunch with my .cshrc file was right. I had an alias called "switch" intended to switch the
caps_lock and ctrl_lock keys.

Problem is now fix.

Thanks.
Chun

Last post on Jan 20, 2006