View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

error: f2c.h: No such file or directory

Kathleen Labrie wrote on Jul 14, 2010

Hi,

I'm trying to compile any external packages and I keep getting tripped by the f2c.h file not being found. The file is in /astro/iraf/macintel-10.6/iraf/iraf-v2.14.1/unix/bin.macintel/f2c.h . I have checked that iraf, IRAFARCH are set. I also source irafuser.csh.

Mac OS X 10.6 (snow leopard)
> uname -a
Darwin kathleen-labries-computer.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

I have been able to compile on snow leopard on another machine which I suspect had f2c.h somewhere else (un-verified).

My question I guess is how can I get IRAF to find its own f2c.h? Shouldn't it find it on its own?

Thanks for your help!
Kathleen

Mike Fitzpatrick wrote on Jul 14, 2010

I have checked that iraf, IRAFARCH are set. I also source irafuser.csh.


Set the what values exactly? And in which file? If you're compiling from a mkpkg then the XC gets spawned and your .cshrc file is used, but if you're compiling with XC directly then it uses whatever is in your shell environment and/or perhaps what was defined (differently?) in your .login file.

The f2c.h file needed by iraf is normally found on its own with a '-I' flag set in the hlib$f77.sh script, that path is build from whichever $iraf and $IRAFARCH is in play. If you edit the f77.sh script so there's a '-x' aarg on the first line it will trace the script and you can see what it is doing, compiling a simple hello.x file is all you need.

Kathleen Labrie wrote on Jul 14, 2010

$iraf is set to /astro/iraf/macintel-10.6/iraf/iraf-v2.14.1/
$IRAFARCH is set to macintel
The .cshrc is the one that comes with as.pcix.gen, save a correction for $iraf and the $PATH. Same for .login.

I am using mkpkg. I'm doing the same as I have always done:

cd color
setenv color `pwd`/
mkpkg macintel
mkpkg -p color update |& tee spool

----
add -x arg to f77.sh: you mean on the #!/bin/sh line?

Kathleen

Kathleen Labrie wrote on Jul 14, 2010

running xc with -dddd on hello.x:

hello.x:
debug: /astro/iraf/macintel-10.6/iraf/iraf-v2.14.1/unix/bin.macintel/xpp.e -R hello.x
hello:
debug: /astro/iraf/macintel-10.6/iraf/iraf-v2.14.1/unix/bin.macintel/rpp.e hello.r >hello.f
/astro/iraf/macintel-10.6/iraf/iraf-v2.14.1/unix/hlib/f77.sh -c -u -x -f2c /astro/iraf/macintel-10.6/iraf/iraf-v2.14.1/unix/bin.macintel/f2c.e -I/astro/iraf/macintel-10.6/iraf/iraf-v2.14.1/unix/hlib/libc hello.f
hello.f:
hello:
hello.c:13:17: error: f2c.h: No such file or directory
hello.c: In function 'hello_':
hello.c:19: error: nested functions are disabled, use -fnested-functions to re-enable
hello.c:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'st0001'
hello.c:19: error: 'st0001' undeclared (first use in this function)
hello.c:19: error: (Each undeclared identifier is reported only once
hello.c:19: error: for each function it appears in.)
hello.c:19: error: expected expression before '{' token

Kathleen Labrie wrote on Jul 14, 2010

PROBLEM SOLVED!

I had CFLAGS defined and it seems that the system doesn't just append to the variable but takes it as it is when already defined.

Thanks for the -x in f77.sh trick. Very useful outputs.

Kathleen

Last post on Jul 14, 2010