IRAF v2.16 fails at startup in mac os x 2.8 (mountain lion)
James Lowenthal wrote on Sep 05, 2012
On a new imac with 2.8 GHz Intel Core i7 running os x 10.8.1, I've tried installing IRAF several ways, especially: (1) using the scisoft distribution, and (2) using the binaries in iraf-macosx.tar.gz downloaded from iraf.net. The install script returned "OK" to everything and said "Installation Completed With No Errors".
I ran mkiraf to initialize the uparm and login.cl.
But when I start up terminal or XQuartz (was x11), call up an xgterm, and try to start IRAF, I get this error message:
bash-3.2$ ecl
** Syntax error
**: if (!defvar("helpdb")) {
^
**: }
^
ERROR: syntax error
called as: `cl ()'
called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error. CL dies.
bash-3.2$
I've tried rebuilding login.cl and also copying one over from another computer; same error.
Thanks for any help!
James Lowenthal
Smith College
I ran mkiraf to initialize the uparm and login.cl.
But when I start up terminal or XQuartz (was x11), call up an xgterm, and try to start IRAF, I get this error message:
bash-3.2$ ecl
** Syntax error
**: if (!defvar("helpdb")) {
^
**: }
^
ERROR: syntax error
called as: `cl ()'
called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error. CL dies.
bash-3.2$
I've tried rebuilding login.cl and also copying one over from another computer; same error.
Thanks for any help!
James Lowenthal
Smith College
Mike Fitzpatrick wrote on Sep 05, 2012
The "if (!defvar("helpdb"))' line isn't part of any of the core IRAF startup scripts, neither is it in anything in SciSoft from what I can tell, so I'm guessing this is either a local loginuser.cl file or some modification to the login.cl file that you've made.
The syntax error is probably coming from a known CL quirk where an if-statement sometimes needs to be terminated by a semicolon to avoid an ambiguity in determining whether an 'else' is expected. That is, the code might need to be something like
If you still have problems and have a loginuser.cl file feel free to post it (or try moving it temporarily to verify that fixes the problem).
The syntax error is probably coming from a known CL quirk where an if-statement sometimes needs to be terminated by a semicolon to avoid an ambiguity in determining whether an 'else' is expected. That is, the code might need to be something like
if (!defvar ("helpdb")) {
....some stuff
}
;
If you still have problems and have a loginuser.cl file feel free to post it (or try moving it temporarily to verify that fixes the problem).
tfish13 wrote on Sep 05, 2012
I too am having problems at startup, with near identical set up as James (instead using a 2.6 GHz MacBook Pro) where starting IRAF results with:
bash-3.2$ cl
/iraf/irafbin.macintel/vocl.e not found
/iraf/irafbin.macintel/vocl.e: Command not found.
Many of these forums show that 'Command not found' means that the path is incorrect, which I would guess makes sense as I assume there should be another '/' between the second iraf and bin.macintel?
Trying to use the new path results in:
bash-3.2$ /iraf/iraf/bin.macintel/cl.e
task 'cl' has no param file
Fatal startup error. CL dies.
SAD! Is there somewhere where I am incorrectly setting a path that could easily fix this?
bash-3.2$ cl
/iraf/irafbin.macintel/vocl.e not found
/iraf/irafbin.macintel/vocl.e: Command not found.
Many of these forums show that 'Command not found' means that the path is incorrect, which I would guess makes sense as I assume there should be another '/' between the second iraf and bin.macintel?
Trying to use the new path results in:
bash-3.2$ /iraf/iraf/bin.macintel/cl.e
task 'cl' has no param file
Fatal startup error. CL dies.
SAD! Is there somewhere where I am incorrectly setting a path that could easily fix this?
Mike Fitzpatrick wrote on Sep 05, 2012
In this case it sounds more like a value of $iraf is being set without the trailing '/', e.g. in your .cshrc you have something like
setenv iraf /iraf/iraf
instead of
setenv iraf /iraf/iraf/
Even though you explicitly give a path to a CL binary, the $iraf value is used in constructing other paths in the system, and when those are incorrect you see the 'has no param file' message. Note that if you don't define $iraf in your .login or .cshrc, it might be defined in e.g. a scisoft 'Setup.csh' that's loaded in there. If it isn't defined at all, look at the /usr/include/iraf.h to see how it is set there, if its missing the '/' then you should rerun the install script to specify the path *with* a trailing '/'.
setenv iraf /iraf/iraf
instead of
setenv iraf /iraf/iraf/
Even though you explicitly give a path to a CL binary, the $iraf value is used in constructing other paths in the system, and when those are incorrect you see the 'has no param file' message. Note that if you don't define $iraf in your .login or .cshrc, it might be defined in e.g. a scisoft 'Setup.csh' that's loaded in there. If it isn't defined at all, look at the /usr/include/iraf.h to see how it is set there, if its missing the '/' then you should rerun the install script to specify the path *with* a trailing '/'.
tfish13 wrote on Sep 05, 2012
This turned out to be true. The reason I was getting hung up is that I had set export iraf=/iraf/iraf/ in the root directory while setting it without the final '/' in the home directory. Embarassing. Thanks for the help!
James Lowenthal wrote on Sep 05, 2012
Still stuck on...
** Syntax error
**: if (!defvar("helpdb")) {
...problem. Thanks, fitz, for your suggestions, but: no, there is no loginuser.cl, and the login.cl file has no such line. I rebuilt login.cl with mkiraf too, but no change.
Another user emailed me another suggestion that didn't work: he said he'd found and commented out some lines of code including the offending
**: if (!defvar("helpdb")) {
in the file hlib$extern.pkg, and that IRAF then started up fine. But my extern.pkg does not have that line either.
In fact I did a global whole-computer search on the string "defvar" using the imac spotlight, and didn't come up with anything obviously relevant.
** Syntax error
**: if (!defvar("helpdb")) {
...problem. Thanks, fitz, for your suggestions, but: no, there is no loginuser.cl, and the login.cl file has no such line. I rebuilt login.cl with mkiraf too, but no change.
Another user emailed me another suggestion that didn't work: he said he'd found and commented out some lines of code including the offending
**: if (!defvar("helpdb")) {
in the file hlib$extern.pkg, and that IRAF then started up fine. But my extern.pkg does not have that line either.
In fact I did a global whole-computer search on the string "defvar" using the imac spotlight, and didn't come up with anything obviously relevant.
Mike Fitzpatrick wrote on Sep 05, 2012
Try adding the line "d_trace" to the top of your login.cl file to see whether that reveals where the line if coming from. If not, then do the same to hlib$clpackage.cl which is called earlier and does things like the extern.pkg file. Like I said, this isn't in the core system scripts so is likely either from an external package or some local modification in scisoft.
Mike Fitzpatrick wrote on Sep 05, 2012
I found out recently this 'defvar' is coming from a script called 'install_helper' in some STScI distribution of STSDAS/TABLES/STCECF. The syntax is actually invalid and should be replaced with
Either make the change in the hlib$extern.pkg file or the template used by install_helper in stsci_iraf_x/release_tools/extern.pkg.proto
If you're using v2.15 or later the dynamic package installation will do just as well to install STSDAS.
if (defvar("helpdb") == no) {
:
Either make the change in the hlib$extern.pkg file or the template used by install_helper in stsci_iraf_x/release_tools/extern.pkg.proto
If you're using v2.15 or later the dynamic package installation will do just as well to install STSDAS.
Mike Fitzpatrick wrote on Sep 05, 2012
[Moderator Note: posted on behalf of mrawls@nmsu.edu]
I had the very same problem with the 'defvar' syntax error when I tried to install IRAF v2.16 on OSX Mountain Lion on my Retina Macbook Pro. I had to dig quite a bit to find the proper extern.pkg file to edit. For me, the offending file was located in the directory
/usr/local/scisoft/packages/iraf/iraf/unix/hlib
Once I cd-ed there and edited extern.pkg as directed, I redid mkiraf in my xgterm, typed cl, and was on my way! What an obnoxious little bug. It was particularly frustrating because I have two other instances of extern.pkg on my machine (one called extern.pkg and the other called extern.pkg.proto, both in similarly buried scisoft-related directories) which I found first and edited to no avail.
I had the very same problem with the 'defvar' syntax error when I tried to install IRAF v2.16 on OSX Mountain Lion on my Retina Macbook Pro. I had to dig quite a bit to find the proper extern.pkg file to edit. For me, the offending file was located in the directory
/usr/local/scisoft/packages/iraf/iraf/unix/hlib
Once I cd-ed there and edited extern.pkg as directed, I redid mkiraf in my xgterm, typed cl, and was on my way! What an obnoxious little bug. It was particularly frustrating because I have two other instances of extern.pkg on my machine (one called extern.pkg and the other called extern.pkg.proto, both in similarly buried scisoft-related directories) which I found first and edited to no avail.
Ray Butler wrote on Sep 05, 2012
I just had the exact same problem (Scisoft on a new MacMini, OSX Mountain Lion). I followed the instructions in the last two posts [the code change by fitz, in the file pointed out by mrawls via fitz], and that fixed it. :D
Many thanks guys!!
Many thanks guys!!
Last post on Sep 05, 2012