RS: [Beowulf] Sempron compile optimization

Robert G. Brown rgb at phy.duke.edu
Mon Nov 28 05:58:29 PST 2005


On Thu, 24 Nov 2005, Chris Samuel wrote:

> On Thursday 24 November 2005 03:43, Robert G. Brown wrote:
>
>> Again, it was my understanding that if you run an x86_64 version of a
>> distro, the kernel, the libraries, and the applications are all compiled
>> with gcc which is ITSELF compiled for that architecture, and gcc
>> defaults to doing the right thing and linking the right libraries
>> automagically.
>
> Not AMD64, but SuSE SLES 9 for PPC64 on Power5 the system supplied GCC outputs
> 32-bit code by default, you *must* specify -m64 if you want 64 bit objects.
>
> $ arch
> ppc64
> $ gcc hello.c -o t1
> $ file t1
> t1: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

I stand corrected, I think.  On AMD64 (Opteron) though:

rgb at s00|B:1005>file xmlbenchd
xmlbenchd: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for
GNU/Linux 2.4.0, dynamically linked (uses shared libs), not stripped

from straight gcc build, no -m flags.  In fact, only -O3 period.  I
think (again) that it depends on how the gcc and libraries themselves
were built.  If you build 64 bit architecture a priori, the kernel and
gcc itself and all libraries native 64 bit internal, I think that gcc
will build native 64 bit automagically because otherwise it will appear
to be broken -- if you compile gcc hello.c -o hello it WON'T WORK.  A
kernel build won't work.  Nothing will work.

So I'm guessing that SuSE SLES 9 for the PPC64 is actually a 32 bit
distro, with a 32 bit gcc and 32 bit libraries but with libraries for 64
bit compatibility operation installed so that you're again, basically
cross-compiling for 64 bits.  gcc should compile native/default to
whatever "native" is.

    rgb

-- 
Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb at phy.duke.edu





More information about the Beowulf mailing list