[Developers] New compilation scripts - todo

Arni Magnusson arnima at hafro.is
Wed Sep 4 15:52:21 PDT 2013


More recent correspondence regarding the compilation scripts, read from 
bottom up.

---

When I starting working on this task recently, I got sidetracked and 
wanted to know what exactly the

   tpl2cpp -bounds

option does. I was quite surprised to find out that it doesn't do anything 
at all.

I wrote Dave about it, asking whether we should stop using -bounds since 
it doesn't do anything at all. He said sure.

The software development textbooks would call -bounds a fine example of 
"cargo cult" and recommend against it. If we agree, then we have a third 
subtask:

(3) Stop using tpl2cpp -bounds, both in scripts and documentation

Arni



On Wed, 4 Sep 2013, Arni Magnusson wrote:

> Thanks for bringing this up, Ian. The task at hand can be broken into 
> (1) changing the default to safe compilation and (2) introducing a new 
> option for optimized compilation.
>
> I'm afraid I've been stalling these tasks, while Johnoel has made some 
> progress on them.
>
> TASK 1: Safe default
>
> Last time I checked, compilation is _safe_ if the user runs
>
>  admb simple
>
> but if the user runs
>
>  tpl2cpp simple
>  adcomp simple
>  adlink simple
>
> it is _optimized_. ADMB 11.1 had a bug where some combination of 
> commands could actually delete an ADMB core library, but I think Johnoel 
> repaired that.
>
> In my opinion, the above commands should do the same thing and compile 
> _safe_. The equivalence of "admb" and "tpl2cpp,adcomp,adlink" has been a 
> design foundation, and a useful one. Likewise, "admb -s" should be the 
> same as "tpl2cpp -bounds,adcomp -s,adlink -s". Last time I checked, we 
> were not there yet.
>
> TASK 2: New option, perhaps -f
>
> Johnoel picked uppercase -O as the new option. I wrote to him (and 
> Chris) that I disliked that, because mixing lower- and uppercase letters 
> is ugly and more difficult to type. Also, the letter -O and zero -0 look 
> identical in many terminals, including the Putty window I'm typing in 
> right now.
>
> I first thought the best option would be a lowercase -o, but then 
> realized that experienced programmers will immediately interpret the 
> command
>
>  admb -r -o mymodel
>
> as specifying the output filename. Then I thought -f for "fast", and I 
> still think that has fewer drawbacks than the alternatives.
>
> Arni
>
>
>
> On Wed, 4 Sep 2013, Ian Taylor wrote:
>
>> Hi Johnoel and Arni,
>>
>> I'm finally getting some time to look at ADMB again. I installed the 
>> binaries on Linux and Mac machines and found that the -O flag doesn't 
>> seem to be getting through. And yet, it seems like -s has become the 
>> default. Am I missing something?
>>
>> -Ian
>>
>> # here's what I see with -O
>> # (shouldn't it be going to libadmbo.a instead of libadmb.a?)
>>
>> $ admb -O simple
>>
>> *** tpl2cpp simple
>>
>> *** adcomp simple.cpp
>> g++ -c -O3 -D__GNUDOS__ -Dlinux -DSAFE_ALL -DUSE_LAPLACE -I.
>> -I"/home/ian/admb/admb_home"/include
>> -I"/home/ian/admb/admb_home"/contrib/include simple.cpp
>>
>> *** adlink simple
>> g++ -o simple simple.o "/home/ian/admb/admb_home"/contrib/lib/libcontrib.a
>> "/home/ian/admb/admb_home"/lib/libadmb.a
>>
>> Successfully built executable.
>


More information about the Developers mailing list