[ADMB Users] Determine 32 vs. 64 bits

Arni Magnusson arnima at hafro.is
Fri Mar 1 10:35:05 PST 2013


How do you know when a GCC compiler is creating 32 or 64 bit applications? 
It's somewhat tricky, but here are a few thoughts:

1. If you install ADMB-IDE, the GCC compiler will be placed in a directory 
such as c:/gnu/gcc452-win64. I suggest using descriptive directory names 
when installing GCC or any other compiler. Preferably, the path before the 
directory (here c:/gnu) should be short and without spaces.


2. If I type
   gcc -v
I get
   Target: mingw32
or
   Target: i686-w64-mingw32
depending on which compiler I use.


3. When I'm in 32-bit Windows and run a 64-bit application I get a popup 
window saying "c:/hello/hello.exe is not a valid Win32 application".


4. If you have the program 'file' installed (found on all Linux machines 
and some Windows machines) then you can type
   file hello.exe
to see either
   hello.exe: PE32 executable for MS Windows (console)
or
   hello.exe: PE32+ executable for MS Windows (console)
where the 32+ means 64 bits.


5. You can also disassemble the executable,
   objdump -d hello.exe > dump.txt
and check if the first lines say
   hello.exe:     file format pei-i386
or
   hello.exe:     file format pei-x86-64


6. Some compilers, like 
http://admb-project.org/tools/gcc/gcc463-win3264.zip are bilingual so the 
same compiler accepts both -m32 and -m64 as targets. That sounds like the 
way to go for ADMB, so you can build models that your colleagues can run. 
One MinGW compiler might also make life easier for the development team. 
We're working on this.


Arni



On Fri, 1 Mar 2013, Jeff Laake wrote:

> Arni-
>
> So I switched to the new compiler and admb 10.1 but the problem I was 
> having is still there. Before I go back to Dave who said it worked for 
> him I'm trying to determine that it is using 64 bit. That 4.5.2 version 
> appears to be for 32 and 64 bit on Windows.  How do I know that it is 
> using the 64 bit? Below is my command line for the compile. Thanks for 
> any help you can give. --jeff
>
> compiling with args: ' -r -s ' ...
> compile output:
>  *** tpl2rem -bounds cjsre xxglobal.tmp xxhtop.tmp header.tmp xxalloc1.tmp
> xxalloc2.tmp xxalloc3.tmp xxtopm.tmp xxalloc6.tmp         1 file(s) copied.
> tfile1 tfile2 tfile3 tfile4         1 file(s) copied.  *** adcomp -r -s
> cjsre g++ -c -O3 -Wno-deprecated -D__GNUDOS__ -Dlinux -DSAFE_ALL
> -DUSE_LAPLACE -fpermissive -I. -I"c:/admb\include" -o cjsre.obj cjsre.cpp
> *** adlink -r -s cjsre g++ -s -static -L"c:/admb\lib" cjsre.obj -ldf1b2s
> -ladmod -ladt -lads -ldf1b2s -ladmod -ladt -lads -o cjsre  Done
> compile log:
>
>> Sys.getenv("PATH")
> [1] "c:/admb/bin;c:admb/utilities;c:/MinGW/bin;
>



More information about the Users mailing list