Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!C.CHEM.UPENN.EDU!YATES From: YATES@C.CHEM.UPENN.EDU ("YATES, JOHN H.") Newsgroups: comp.sys.sgi Subject: f77 and forward reference lib searching Message-ID: <9105222059.AA29476@noc1.dccs.upenn.edu> Date: 22 May 91 21:58:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 26 I have a user porting a large code from Berkeley UNIX to the SGI System V. After commenting out all the ranlib's in the makefiles,(and a few other changes) he found that the many libraries are searched in a forward reference manner only. i.e. if lib2 calls routines in lib1, they are not found. (in fact, he tells me that it is a forward reference search only within a given library.) This is indeed documented in the f77 manual (page 1-8 in the Fortran 77 Programmer's Guide, Document Version 2.0). I have suggested the following for building his code. Change: f77 prog.o lib1.a lib2.a lib3.a lib4.a To: f77 prog.o lib1.a lib2.a lib3.a lib4.a lib1.a lib2.a lib3.a lib4.a \ lib1.a lib2.a lib3.a lib4.a lib1.a lib2.a lib3.a lib4.a ... until it finds everything. It won't make the executable any bigger, but it isn't very tidy. (a similar thing happened to me on a DEC-10 years ago). Is there a better solution? Thanks, John yates@a.chem.upenn.edu