[ADMB Users] Problem with ADMB-IDE
Arni Magnusson
arnima at hafro.is
Thu Sep 16 15:05:42 PDT 2010
As a regular user of Rtools and Sweave, and a collector of historical GCC
and Borland compilers, as well as historical versions of ADMB, my approach
is to "mess with the environment variables". This is on Windows XP.
My default PATH includes only one C++ compiler, the current GCC, which is
now 4.5.0 (http://admb-project.org/community/related-software/gcc). Note
that my default PATH does not include ADMB, because I want a stripped-down
PATH when I use ADMB. As reported by Gary Nelson, Paul Conn, and others, a
full-fledged PATH can cause compilers to conflict with each other.
Before compiling an ADMB model, I need to switch to GCC 4.4.0, and put the
corresponding ADMB in the PATH. I use two alternative ways to do this:
*** Option 1 *** Open a Dos shell and type gcc440. This runs a script
called gcc440.bat (stored in a good place) that contains five lines of Dos
code:
@echo off
set ADMB_HOME=c:/admb/gcc440
set PATH=c:/gnu/gcc440/bin;c:/admb/gcc440/bin
echo ADMB_HOME=%admb_home%
PATH
Note the minimalistic PATH. This particular Dos shell is now ready to run
tpl2cpp, adcompile, adlink, and admb. These environment variable settings
only apply to this particular Dos shell, until I close it.
*** Option 2 *** Open a TPL file in Emacs (double click in Windows
Explorer, or type simple.tpl in a Dos shell, or open within Emacs). This
switches Emacs to ADMB Mode, and in my .emacs I have defined:
(setq admb-init "gcc440 & ")
The idea behind `admb-init' is to allow users to switch between ADMB
versions within a session, or just to make special configurations work.
ADMB Mode (and therefore ADMB-IDE) prepends this `admb-init' string in
front of all ADMB compilation commands. So my Emacs runs gcc440.bat
locally before calling tpl2cpp and friends. I generally don't think about
this, just open simple.tpl and compile.
---
This somewhat elaborate setup (but easy to use) would not be necessary if
I used only GCC 4.4.0 and the corresponding ADMB. I've used this setup for
many years and it requires very little maintenance when new versions of
compilers and ADMB come out. In other words, I have Dos scripts called
bcc52, bcc55, gcc295, gcc345, etc.
In Linux, I have only one version of GCC (whatever the good GNU provides)
and one version of ADMB (something that nearly matches the GCC version).
And of course dog food for special occasions.
Arni
On Thu, 16 Sep 2010, Paul Conn wrote:
> Nice find. I was having the same problem with ADMB-IDE a few months ago
> but never found the reason for the error (I also have Rtools\mingw\bin
> in my system path so suspect it was the issue) - after messing with it
> for a few hours my solution was to give up and go back to my old text
> editor and the Borland compiler. Does anyone know if there's a
> reasonable workaround for gcc, or should regular users of Rtools,
> Sweave, etc. stick with the Borland compiler to prevent having to
> continuously mess with environment variables?
>
> Paul
>
>
>
> Nelson, Gary (FWE) wrote:
>> The issue was a conflict between a mingw32 version used in the Rtools.
>> The system path has c:\Rtools\mingw\bin, so I guess it took precedence.
>> I removed the path and now ADMB-IDE works.
>>
>> Thanks for your help.
>>
>> Gary.
>
More information about the Users
mailing list