Trouble with cc/f77

daniels at bigred.enet.dec.com daniels at bigred.enet.dec.com
Sat Jan 26 07:03:22 AEST 1991


In article <1991Jan24.221720.25460 at ims.alaska.edu>, fnddr at acad3.alaska.edu (Rice Don D) writes...
>One possible problem: some libraries in /usr/lib are links to
>/usr/lib/cmplrs/cc2.0, while libraries in /usr/lib/cmplrs/f772.1 point into
>/usr/lib/cmplrs/cc2.1.  Having a mix of 2.0 and 2.1 libraries sounds like
>bad news to me.

Those are version numbers from different products, so that should not be a
problem.

>We found that we can get the whole mess to link in single precision by
>doing this:
>  cc -c main.c
>  f77 -o prog main.o sub.o -lF77 -lI77 -lm
>I had some reservations about using f77 with a C main program, but it
>seems to work.  Yuk.  Something is broken here, even if it is only the
>Fortran documentation.

That is definitely one way to get it to work, though I agree it is messy.

The problem is that any FORTRAN compiler provides a whole environment, not
just a way to call functions.  Compiler developers try to do as much as
they can to make the environment "lightweight", but there are still all
sorts of potential hidden gotchas.

If you want to find out the right set of libraries to use when linking
using cc, try the "-v" option on the f77 link command you gave above.
It will show which libraries f77 specifies, and you can then duplicate
that listof libraries in your cc link.

- Brad



More information about the Comp.unix.ultrix mailing list