[ADMB Users] ADMB with gcc, mingw, and/or msys

Jon Schnute schnutej-dfo at shaw.ca
Wed Nov 13 12:01:14 PST 2013

Thanks to Arni for his work on the ADMB IDE. I note, however, that the files
available at http://code.google.com/p/admb-project/downloads/list?
&q=admb-ide apply to the earlier version 10.1 of ADMB, not the more recent
version 11.1 or the current version available from the SVN server


Despite this limitation, Arni's .zip files include two ADMB image
directories (32- and 64-bit) and two gcc directories that allow you install
ADMB without the IDE. I've included these in the R package PBSadmb at
http://code.google.com/p/pbs-admb/source/browse/trunk/Downloads/. If you use
R and PBSadmb, you can install ADMB in a manner that doesn't prejudice any
other installation on your system.


I want to make PBSadmb work in Windows with the most recent versions of
ADMB, so I've been experimenting with "official" versions of msys and mingw
available at http://sourceforge.net/projects/mingw/files/. Without going
into details (which I can make available in a separate file), I downloaded a
32 bit version mingw (C++ compiler, currently 4.8.1) and msys (unix make,
plus others) and "successfully" built ADMB 11.1.  However, when I used this
ADMB binary library with an actual example, the .tpl transformed to .cpp and
the .cpp transformed to .o, but the link step failed with the message:


g++ -s  -static  -o

ain.o): In function `main':

-src/src/libcrt/crt/main.c:91: undefined reference to `WinMain at 16'

collect2.exe: error: ld returned 1 exit status


I have several questions:


1. Does anyone know about the strange reference to WinMain at 16? This appears
to be part of mingw, not ADMB. Internet searches suggest that this problem
occurs with other applications of mingw. Maybe something is needed to tell
gcc that this is a console application, not one that requires the full
Windows subsystem.


2. What versions of mingw and msys (both 32 and 64 bit) will work with ADMB
11.1 and the current SVN release? For example, maybe I should use Arni's gcc
version 4.52 with a current version of msys "make".


3. The ADMB site http://www.admb-project.org/tools/gcc includes other
choices, including combined 32 and 64 bit compilers. Should we use one of
these? Also, I don't understand the comment: "Use the -m64 compiler option
to build 64-bit applications when working with a combined 32- and 64-bit
compiler (gcc*-win3264.zip)." If an option like that is needed, wouldn't the
ADMB makefiles and batch files have to include it?


4. Could we somehow use R tools
(http://cran.r-project.org/bin/windows/Rtools/) as the standard compiler and
"make" utility? Arni says that he has sometimes obtained his compilers from
this source, so couldn't we use them straight from an Rtools installation?


5. Why has the ADMB project dropped the "configure" script used in earlier
versions of ADMB? Should the current version include some argument to "make"
that selects options like 32 or 64 bit?


I realize that this message is a bit long and complicated. Maybe it should
go only to the ADMB developers, but perhaps members of the larger community
can contribute. The recent comments from Cliff Rice show that this is an
important issue. If we can resolve it in a manner that works now and in the
future, I volunteer to play a role in developing suitable documentation.
Also, the ADMB web site needs a bit of reorganization to avoid the problems
of conflicting instructions that Cliff identified. (Thanks, Cliff!)
Similarly, it should point unambiguously to the recommended current versions
of mingw and msys.


Thanks in advance for your help. Best wishes to all,


Jon Schnute


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20131113/dd254a9f/attachment.html>

More information about the Users mailing list