[Developers] Link order of libraries
Arni Magnusson
arnima at hafro.is
Sat May 2 05:41:23 PDT 2009
On Thu, 30 Apr 2009, Hans Julius Skaug wrote:
> I do not know the "correct" way of linking in the libraries, but I can
> confirm that ado32.lib adt32.lib admod32.lib adf1b2o.lib was the order
> Dave used previously for the Borland version.
I see. Here are the scripts I have access to:
ADMB 5.0.1 for Borland 5.5, lnkadmb.bat (12-Feb-1999):
admod32.lib adt32.lib ado32.lib
ADMB 9.0.202 for Borland 5.5, lnkadmb.bat (15-Apr-2009):
df1b2stub.lib admod32.lib adt32.lib ado32.lib
ADMB 9.0.202 for Borland 5.5, lnkadmb-re.bat (15-Apr-2009):
df1b2o.lib admod32.lib adt32.lib ado32.lib
So for over 10 years, the Borland order has been [df1b2]-mod-t-o, and as
far as I can tell, the Microsoft and GCC scripts have also been
[df1b2]-mod-t-o through the years.
Now, Jason bas pointed out that o-t-mod-df1b2 works better for Borland
random effects, and Hans has seen this order somewhere before.
Johnoel and I are going to update the user scripts, so the question is
should we:
1. Change only Borland lnkadmb-re.bat to o-t-mod-df1b2, following Jason's
finding. Everything works, and it doesn't really matter why.
2. Change only Borland lnkadmb-re.bat to mod-t-o-df1b2. This creates a
larger executable, presumably because more functions are defined.
3. Change all Borland lnkadmb*.bat to o-t-mod-df1b2 or mod-t-o-df1b2.
Perhaps Borland's rule for linking libraries is the opposite of GCC. The
GCC rule is to read aloud "uses functions defined in" between the
libraries
(http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Link-Options.html#Link-Options).
That's why I thought the original order df1b2-mod-t-o makes sense: RE uses
ADMB uses AUTODIF.
4. Investigate this further, hopefully understanding why the GCC scripts
repeat the libraries twice: df1b2-mod-t-o-df1b2-mod-t-o. Whey does GCC
need repeating, if Borland and Microsoft don't? Being a GCC user myself, I
find this even more interesting than the Borland issue.
Cheers,
Arni
More information about the Developers
mailing list