[Developers] ADMB in a Linux machine

dave fournier davef at otter-rsch.com
Thu May 20 06:13:23 PDT 2010


Arni Magnusson wrote:

Hi,

I modified the code to strip the ctrl M off the string. (See crtl M in
the comments).
This is the lex source for tpl2cpp. myallc builds tpl2cpp from it.

     Dave


> It turns out that ADMB in Linux compiles and runs many models
> (including simple.tpl) regardless of line endings:
>
> $ unix2dos simple.tpl
> $ admb simple
> $ simple
>
> GCC, R, and most tools I work with can handle both line endings just
> fine, so I think it would be worthwhile to make ADMB robust to line
> endings.
>
> In Saang-Yoon's example (attached), it's enough to comment out the
> runtime section,
>
> // RUNTIME_SECTION
> //   maximum_function_evaluations 10000
>
> and then the model compiles and runs. Otherwise, tpl2cpp mangles this
> specific line so mark_recap13.cpp becomes:
>
>   void model_parameters::set_runtime(void)
>   {
>     dvector temp1("{10000^M}");
>     ...
>
> Note the ^M inside the string. Do you think this is an isolated bug in
> tpl2cpp that we can fix, to make ADMB as robust to line endings as GCC
> and related tools?
>
> Arni
>
>
>
> ---------- Forwarded message ----------
> Date: Thu, 20 May 2010 19:57:34 +0000 (UTC)
> From: Arni Magnusson <arnima at hafro.is>
> To: Saang-Yoon Hyun <shyunuw at gmail.com>, forh at critfc.org
> Cc: users at admb-project.org
> Subject: Re: [ADMB Users] ADMB in a Linux machine
>
> Hi Saang-Yoon,
>
> The problem you're running into is that ADMB in Linux doesn't like
> Windows line endings (see
> http://en.wikipedia.org/wiki/Newline#Common_problems).
>
> You can convert between Linux and Windows line endings using a text
> editor, or command line tools like 'dos2unix' and 'unix2dos':
>
> $ dos2unix mark_recap13.tpl
> $ admb mark_recap13.tpl
> $ mark_recap13 -ind mr_v13.dat
>
> Arni
>
>
>
> On Thu, 13 May 2010, Saang-Yoon Hyun wrote:
>
>> A programmer at my agency and I run into a few errors in compling a
>> TPL file in a Linux machine.  We believe this problem is about a
>> mis-match between a complier and the TPL codes, because the TPL file
>> was perfectly run in a MS Window machine.  I wonder about whether you
>> had some experience in compling and linking a TPL file in a Linux
>> machine.  If not, would you introduce someone else we can inquire?
>> For information, I attach TPL and DAT files to this email.
>>
>> Thank you very much,
>>
>> Saang-Yoon
>>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developers mailing list
> Developers at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/developers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tpl2cpp.zip
Type: application/x-zip-compressed
Size: 358217 bytes
Desc: not available
URL: <http://lists.admb-project.org/pipermail/developers/attachments/20100520/7605355e/attachment-0001.bin>


More information about the Developers mailing list