Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!lpi.liant.com!rcg From: rcg@lpi.liant.com (Rick Gorton) Newsgroups: comp.lang.fortran Subject: Re: Getting right modules from libraries Keywords: Unique entry names Message-ID: <1991Jan8.235305.14674@lpi.liant.com> Date: 8 Jan 91 23:53:05 GMT References: <9767@ncar.ucar.edu> Organization: Language Processors Inc., Framingham MA Lines: 46 In article <9767@ncar.ucar.edu> gary@cgdisis.cgd.ucar.edu (Gary Strand) writes: > > I'm bashing my brains in trying to figure out how to force 'f77' to load > in *my* object modules from *my* object library. > > What I'm doing is replacing several software-package routines, and putting > them all into my own .a file. But, when I link everything together, 'f77' > uses the system modules, not mine. This is fairly lengthly, since I don't know specifics here.... If you are trying to replace a specific system routine with your own copy and know what the entry point is, then you can force the linkage of your version by doing the following. Add a call to a dummy routine from some unused subroutine A, and put that dummy routine in the same compilation unit as your replacement module. Then, at link time, put your library (containing the new routine) on the command line before the 'f77' and system routines. This should solve the problem If you are having problems with your source code inadvertently colliding with system/f77 libraries, then you have a couple of options. One is to switch compilers for your sun, and pick one where the compiler libraries won't have entry point names which conflict with your [personal] library. Our libraries deal with this problem by having a special (and very unlikely) sequence in our entry point names (P$ALC31, and F$XWLR) which is not permitted by the language (in this case a '$'). We also have compile switches to permit or force case on external names. Enough on the advertisment :-) Another solution is to modify your source code and do something similar to the P$foo/F$foo trick we use. This solution is clearly unusable if the compiler/linker on other systems where this code must run only permits, say, six significant characters as external names. It is also not very reasonable if doing so would require many source modules and/or thousands of lines of source code to be modified.... Hope this helps, rick -- Richard Gorton rcg@lpi.liant.com (508) 626-0006 Language Processors, Inc. Framingham, MA 01760 Hey! This is MY opinion. Opinions have little to do with corporate policy.