Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!pa.dec.com!rust.zso.dec.com!shlump.nac.dec.com!bigred.enet.dec.com!daniels From: daniels@bigred.enet.dec.com Newsgroups: comp.unix.ultrix Subject: Re: Trouble with cc/f77 Message-ID: <19468@shlump.nac.dec.com> Date: 25 Jan 91 20:03:22 GMT Sender: newsdaemon@shlump.nac.dec.com Organization: Digital Equipment Corporation Lines: 31 In article <1991Jan24.221720.25460@ims.alaska.edu>, fnddr@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