[ADMB Users] Open ADMB for Windows with MinGW

dave fournier davef at otter-rsch.com
Wed Dec 10 10:24:26 PST 2008

Schnute, Jon wrote:

I think that if a new user has the ocmpiler correctly installed then
they should be able to
simply install the admb software  by running an exe and then change to a
comman window and say somethihkg like.

           admb simple


and have everything just work.  this can be done with the inno installer
so that all the differences between
compilers are hidden from the user. except for the compiler it should
not be necessary to add any more software.
the reason that tpl2cpp or tpl2rem was looking for cat is that is was
the mingw32 version which  was originally intended
for cygwin whihc has these tools. the "true" windows version uses   copy
instead of cat.

It is really only necessary to have one verion of tpl2cpp and tpl2rem
for windows and another for Linux
so that part should be removed from the build of each version and just
copied into the bin file.  Is is necessary to
have a copy of sed.exe for whihc I use a mingw version. I have had
better luck with mingw32 than with cygwin when moving to 64bit XP.

However it is important to be able to use more than one compiler on the
same machine.
first consider how to set up the effortless install  I mentioned above.
I think the best way is to have the installer define a (global)
environment string like ADMB_HOME to
point to the directory where admb is installed. To run the software the
shell script admb.bat is copied to the
system directory know as {sys} to the Inno installer.  It can figure out
where this shold be for different
version of windows. for example something like c:\winnt\system32.  this
is already on the users path
so that it will be found when the user types in  admb  simple
the user may have to reboot to get the command shell window to "see" the
but windows users are used to rebooting.

If the installation detects that the user already has ADMB_HOME defined
and/or admb.bat in {sys}
it can use a variant such as a compiler specific name such as 
ADMB_VC8_HOME  and admb_vc8.bat
It should of course notify the user that there is already one version of
ADMB installed and that it is doing the curretn install in this way.

this works for different compilers so long as the compler shell command
are different. for example for vc++
is is cl.exe for borland it is bcc32.exe and for mingw32 it is gcc and g++.

If one needs say two different versions of g++ one can find the bin
directory conatining it and do a copy

     copy "g++.exe"  "g++421.exe"

and use g++421 in the admb_gcc421.bat file.


> I've spent most of today experimenting with the new release of ADMB for
> Windows with MinGW. I'm pleased to report that it works, but not without
> a few difficulties. The attached report explains exactly what happened.
> In particular, Step 5 resolves the problem with "cat" reported by Tony
> Booth earlier today.
> Hopefully, everyone who gets this message will also get the attached PDF
> file. If you have problems, let me know and I can send it again.
> Please note that I have two questions for which I'd like answers.
> Probably you compiler gurus can answer Question 1 instantly. I hope the
> ADMB Project gurus think carefully about my Question 2 because it points
> the way toward contributions that users can make, even at this early
> stage before the source code can be released.
> Best wishes,
> Jon
> ******************************************
> Jon Schnute, Scientist Emeritus
> Pacific Biological Station
> 3190 Hammond Bay Road
> Nanaimo, BC V9T 6N7
> NEW email: Jon.Schnute at dfo-mpo.gc.ca 
>  (formerly schnutej at pac.dfo-mpo.gc.ca)
> ******************************************

David A. Fournier
P.O. Box 2040, 
Sidney, B.C. V8l 3S3
Phone/FAX 250-655-3364

More information about the Users mailing list