View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

problems with running fc

Ronald James Buta wrote on Apr 06, 2009

Hi all,

I have a Sun Ultra-45 running on Sun studio compilers with Solaris 10.
I have IRAF installed and just about everything works except for one
critical thing: fc. This is what I need to compile fortran programs with
the imfort library. However, fc persistently gives the following error message,
that libraries lM77 and lF77 can't be found. I have sought good help to
track down the reason for this problem, but our best Unix people around
here have been unable to solve it. Do you have any suggestions as to why
this error message occurs? The compilation refuses to find the two libraries even if we can find them.

thanks very much,

Ron Buta
________

bdmodelr.f is just one of many programs I have that must compiled with fc:

fc bdmodelr.f
f77 -c -O bdmodelr.f
NOTICE: Invoking /opt/SUNWspro/bin/f90 -f77 -ftrap=%none -c -O bdmodelr.f
bdmodelr.f:
MAIN bdmodelr:
main:
link:
/usr/ccs/bin/ld -t -o T_bdmodelr.e bdmodelr.o /iraf/iraf/bin.ssun/libimfort.a /iraf/iraf/bin.ssun/libsys.a /iraf/iraf/bin.ssun/libvops.a /iraf/iraf/unix/bin.ssol/libos.a -lM77 -lM77 -lF77 -lsunmath -lm -lsocket -lnsl -lintl -ldl -lelf -lc /iraf/iraf/unix/bin.ssol/libcompat.a
ld: fatal: library -lM77: not found
ld: fatal: library -lM77: not found
ld: fatal: library -lF77: not found
ld: fatal: File processing errors. No output written to T_bdmodelr.e

Mike Fitzpatrick wrote on Apr 06, 2009

Hi Ron,

The short answer is that the 'f90' compiler isn't directly supported, however there are a number of systems on which it can be made to work. We don't have a Solaris 10 system here with Sun studio installed but I can offer some things to try.

The FC command is simply a shell-script wrapper around the default XC compiler that automates some of the flags. You'll want to use the 'f90' command to do the fortran compilation, as well as add at least a '-lf90' flag to the final link line. You can do these using environment variables in your .cshrc file (not the .login) which is read when the 'fc' command is used. For example


setenv XC_F77     f90
setenv XC_LFLAGS   "-L/opt/SUNWspro/lib -lf90"


would be a good first guess. The '-L' flag sets a directory to look in for the libf90.a library, adjust as needed. Presumably this directory would also contain the M77/F77/sunmath libs that are on the link line, if not add a second '-L' flag to name that directory as well (you said these were on the system?).

These setting will still use the C compiler to do the linking, if you don't have C installed then you can try linking with f90 by setting the XC_LINKER environment variable as you did for XC_F77. If you still have problems, please post the error output.

-Mike

Last post on Apr 06, 2009