[Developers] How to build admb source with mingw 64 - finally!

Grandin, Chris Chris.Grandin at dfo-mpo.gc.ca
Mon Dec 9 19:07:49 PST 2013


Hi Wade,
You definitely have a 64-bit build.  I have it working now too, and I put together a little howto so that other developers can get it working. The trick is getting msys64 as well as the tdm mingw64/32 compiler. I read in many places that MSYS64 didn't exist and was led down many blind alleys before finding the right combination with your suggestion of TDM. This is the bleeding edge and I must give you your kudos due for getting it working first, nice job!

I'll try building the debug version tomorrow and let you all know how that goes.

Jon, if you could try this howto out I would really appreciate it!
Cheers & thanks
Chris



-----Original Message-----
From: Cooper, Wade [mailto:Wade.Cooper at MyFWC.com]
Sent: Mon 12/9/2013 6:18 PM
To: Grandin, Chris; Jon Schnute; John Sibert; Johnoel Ancheta; developers at admb-project.org
Cc: Haigh, Rowan
Subject: RE: Replacement for MinGW; bug in ADMB revision 1461
 
Hi Chris,

You're right this could be.  I don't have VS dumpbin, so tried another approach.  Checking on my home machine I built from source in the same fashion a few months back, I ran the spatial model checked my task manager while running - it comes up as spatial.exe (not spatial.exe *32).  Not sure if that says a lot, but the website you directed me to suggests that may be 64-bit.   

As a 2nd approach I tried objdump -a filename.obj, which comes up as
spatial.obj:  file format pe-x86-64

This is outside my expertise in interpreting since i'm not a developer, ADMB is about the only source building I do.

Wade

________________________________________
From: Grandin, Chris [Chris.Grandin at dfo-mpo.gc.ca]
Sent: Monday, December 09, 2013 8:32 PM
To: Cooper, Wade; Jon Schnute; John Sibert; Johnoel Ancheta; developers at admb-project.org
Cc: Haigh, Rowan
Subject: RE: Replacement for MinGW; bug in ADMB revision 1461

Hi Wade,
  Thanks for your help with this.
But.. I think you are compiling 32-bit objects.  I also got TDM64 4.8.1 (it is 32/64 bit) and compiled the same way you do but the object files created are 32-bit Windows objects. I checked this by running:

dumpbin /headers C:\admb-trunk\build\objects\dist\optlp-df1b2-separable-adpool.obj

(You need Visual studio for dumpbin.exe or look here for another way to tell: http://superuser.com/questions/358434/how-to-check-if-a-binary-is-32-or-64-bit-on-windows)

The (truncated) output follows, the line that says 14C machine(x86) should read x64 instead of x86

Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file optlp-contrib-alk.obj

File Type: COFF OBJECT

FILE HEADER VALUES
             14C machine (x86)
               7 number of sections
               0 time date stamp Wed Dec 31 16:00:00 1969
             F30 file pointer to symbol table
              33 number of symbols
               0 size of optional header
             104 characteristics
                   Line numbers stripped
                   32 bit word machine


Cheers
Chris

-----Original Message-----
From: Cooper, Wade [mailto:Wade.Cooper at MyFWC.com]
Sent: Mon 12/9/2013 7:43 AM
To: Jon Schnute; 'John Sibert'; 'Johnoel Ancheta'; developers at admb-project.org
Cc: Haigh, Rowan; Grandin, Chris
Subject: RE: Replacement for MinGW; bug in ADMB revision 1461

Hi Jon,

I just pulled the latest version from the svn this morning (revision 1461), built using my normal approach (make through msys shell) with my existing mingw-w64 (4.8.1 from tdm64) and it works fine.  I checked simple and polio and both ran.

I then tried the mingw-w64 version you had a link for in your ADMBtools.pdf document (http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-posix/seh/x64-4.8.1-release-posix-seh-rev5.7z/download).  This worked fine too on my machine (Win 7 64 bit).

Good luck with diagnosing the issue,

Wade



-----Original Message-----
From: Jon Schnute [mailto:schnutej-dfo at shaw.ca]
Sent: Monday, December 09, 2013 4:06 AM
To: 'John Sibert'; 'Johnoel Ancheta'; developers at admb-project.org
Cc: 'Haigh, Rowan'; Cooper, Wade; 'Chris Grandin'
Subject: Replacement for MinGW; bug in ADMB revision 1461

John and others - I hope you just got my message about problems with the old MinGW. Next I enclose my proposed solution for moving to MinGW-w64 (see ADMBtools.pdf). The file includes links to the download sites for each software package. I ended up with something close to that used by Wade Cooper. I also used the discussion at Rioki's Corner (http://www.rioki.org/2013/10/16/mingw-w64.html).

Having assembled these tools on my computer, I used them to build the latest revision 1461. Unfortunately, I encountered a bug that you can see in the following output:

**********
g++ -c -Wall -O3  -DOPT_LIB -D__GNUDOS__ -Dlinux -D__SPDLL__
g++ -DUSE_LAPLACE
-I../
build/dist/include
-o../build/objects/dist/optlp-df1b2-separable-fquadpri.obj df 1b2-separable/fquadpri.cpp
g++ -c -Wall -O3  -DOPT_LIB -D__GNUDOS__ -Dlinux -D__SPDLL__
g++ -DUSE_LAPLACE
-I../
build/dist/include -o../build/objects/dist/optlp-df1b2-separable-gammdev.obj
df1
b2-separable/gammdev.cpp
GNUmakefile:267: recipe for target
`../build/objects/dist/optlp-df1b2-separable-
gammdev.obj' failed
make[2]: *** [../build/objects/dist/optlp-df1b2-separable-gammdev.obj] Error
1
make[2]: Leaving directory `/d/ADMbuild/admb1461/src'
Makefile:63: recipe for target `g++-src' failed
make[1]: *** [g++-src] Error 2
make[1]: Leaving directory `/d/ADMbuild/admb1461'
Makefile:60: recipe for target `g++-all' failed
make: *** [g++-all] Error 2
**********

A strange window popped up referring to "cc1plus.exe". Is it possible that the makefile confuses the new version of MinGW with Microsoft Visual Studio?

Wade, it would be great if you could test the latest version of ADMB with your software.

Best wishes to all,

Jon



-----Original Message-----
From: Jon Schnute [mailto:schnutej-dfo at shaw.ca]
Sent: December-09-13 12:41 AM
To: 'John Sibert'; 'Johnoel Ancheta'; 'developers at admb-project.org'
Cc: 'Haigh, Rowan'; 'Cooper, Wade'
Subject: MinGW "nasty problem"

Hi John - Your experience with the MinGW "nasty problem" matches mine exactly. I've done a lot of research on this, and I've written the attached report "MinGW problem with drives that don't exist". I think you'll find that it offers a credible explanation. It contains many Internet links that connect you with other sources.

Along with other developers (cited in the report), I've concluded that the original MinGW project has fallen off the rails and can no longer be considered reliable. We need to move to the independent new project MinGW-w64. In the long run, we need to do this anyway to get 64-bit support.

I hope my little report convinces everyone involved. I'm copying Wade Cooper on this because he reported success with ADMB in the message he sent on November 18.

In my next message, I'll send my recommendations for the explicit software I think we should use.

Best wishes,

Jon

-----Original Message-----
From: John Sibert [mailto:sibert at hawaii.edu]
Sent: December-06-13 9:54 AM
To: Jon Schnute; 'Johnoel Ancheta'; developers at admb-project.org
Cc: 'Haigh, Rowan'
Subject: Re: [Developers] Big changes in Revision 1438

Hi Jon,
Thank you for your patience in testing this stuff. It can be onerous in windows.

Regarding the "nasty problem with MinGW" that you mentioned, I may have encountered something similar.

I was trying to install admb on my wife's new windows 7 machine and the procedure ran smoothly until it started to build the libraries. As soon as it started to compile the first source file, the system popped up an error window titled "g++" containing the error message "There is no disk in the drive. Please insert a disk in drive \Device\Harddisk2\DR2."
Further experimentation revealed the error window any time g++ starts.
So it appears not to be anything to do with admb; it is an windows/mingw issue.

Searching for a solution was pretty fruitless. I lot of know-nothing responses to similar questions and BS remarks from microsoft flacks about how important solving the problem is to microsoft. But the responses pointed to usb drive issues.

So I'm wonder if this is the "nasty problem" you mentioned, and if so, how it was solved.

Cheers,
John


John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa
Honolulu HI (GMT-10)
808-294-3842

Visit the ADMB project http://admb-project.org/

On 12/05/2013 11:17 PM, Jon Schnute wrote:
>
> I've tested revisions 1444 and 1447 on Windows 7 using Msys and MinGW,
> obtained independently from the Internet. The build process worked in
> both cases with no problems. Also, the executable files and scripts in
> ..\build\dist successfully converted .tpl files to .exe files.
>
> In the process, I discovered a nasty problem with MinGW that stems
> from a bug in Windows. It will occur if you connect and disconnect a
> USB drive before using MinGW.
>
> I'm planning to write installation instructions that document exactly
> what I've done, along with a warning about the potential MinGW problem
> and its resolution. I'll circulate this document when I have a draft.
>
> I should add that Rowan Haigh, using the official QuickStart procedure
> on revision 1444, encountered the problem with "banner.cpp" that I've
> described in earlier email. When we have the opportunity, we'll check
> into this further and send a bug report if we can reproduce the problem.
>
> Again, thanks to everyone for your good work cleaning up the code.
>
> Jon
>
> *From:*developers-bounces at admb-project.org
> [mailto:developers-bounces at admb-project.org] *On Behalf Of *Johnoel
> Ancheta
> *Sent:* December-05-13 1:32 AM
> *To:* developers at admb-project.org
> *Subject:* [Developers] Big changes in Revision 1438
>
> Hi all,
>
> The ADMB build files have again been reworked and improved. After
> getting
>
> feedback,
>
> * the build files have been simplified a bit more
>
> - Dave Fournier
>
> * works with Rtools (but not with Rtools->make)
>
> - Jon Schnute
>
> * should build in Windows if Msys or Rtools are in the system PATH
>
> A lot of time and effort was spent by everyone to test and develop
>
> the build scripts.
>
> Please test the installation by following documentation in
>
> http://www.admb-project.org/buildbot/documentation/
>
> Changes and QuickStart pages are in the the directory.
>
> Thanks to everyone who participated in the testing.
>
> Johnoel
>
>
>
> _______________________________________________
> Developers mailing list
> Developers at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/developers





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/developers/attachments/20131209/5161abd7/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mingw64-howto.txt
URL: <http://lists.admb-project.org/pipermail/developers/attachments/20131209/5161abd7/attachment-0001.txt>


More information about the Developers mailing list