[Developers] Link order of libraries

Arni Magnusson arnima at hafro.is
Sat May 2 16:49:02 PDT 2009

> The linker used with GCC only looks forward so the natural way tor der 
> the libraries is to put liba before libb if liba refers to things in 
> libb.  Then if libb also refers to things in liba you need to put liba 
> after libb as well in the list.  So just in case it is easeir to 
> duplicate the list at least once so that thee are no unsatisfied 
> references because dependencies have a tendency to slip into the 
> libraries over time.

Cross dependency it is. I will leave the GCC library order as is.

> Normally if thee are two identical symbols in the libraries lists for 
> Borland and VC++ I thought you would get a warning message or an error. 
> However maybe this is not the case. Changing the order presumably causes 
> a different function to get included. Probably just by comparing the map 
> files for the Borland linker you could see how the links differ.

Ugh, those maps are rough terrain for me (see attachments). The only thing 
I could decipher was that the original faulty df1b2-mod-t-o library order 
does not define "inv_cumd_norm_inner(double)", while the reversed 
o-t-mod-df1b2 does. But then I noticed that linking with the library order 
mod-to-o-df1b2 does not define "inv_cumd_norm_inner(double)" but still 
works fine, so that's not it. The model I'm working with is the 
random-effects simple.tpl example from the ADMB-RE manual.

Thanks Dave, for your explanations. I thimk I will reverse the library 
order of all the Borland scripts, to make things consistent within that 
compiler, while supporting random effects. This sensitivity to library 
order will probably fix itself in the future, as we go through the code 
and improve it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: borland-maps.zip
Type: application/zip
Size: 344729 bytes
URL: <http://lists.admb-project.org/pipermail/developers/attachments/20090502/58ac095f/attachment-0001.zip>

More information about the Developers mailing list