From p.dalgaard at biostat.ku.dk  Thu Mar 15 08:05:36 2007
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Thu, 15 Mar 2007 08:05:36 +0100
Subject: [Rd] compile 2.4.1 for linux on power cpus
In-Reply-To: <45F83A25.0211.007B.0@mrl.ubc.ca>
References: <45F7CB380200007B0004C384@mail.mrl.ubc.ca>	<45F7D4C20200007B0004C3BF@mail.mrl.ubc.ca>
	<45F7D4C2.0211.007B.0@mrl.ubc.ca><45F7D4C2.0211.007B.0@mrl.ubc.ca>
	<45F85C4D.9080005@biostat.ku.dk>
	<45F80DF7.0211.007B.0@mrl.ubc.ca><45F80DF7.0211.007B.0@mrl.ubc.ca>
	<45F88D63.2000704@biostat.ku.dk> <45F83A25.0211.007B.0@mrl.ubc.ca>
Message-ID: <45F8F040.6070907@biostat.ku.dk>

Andrew Ferris wrote:
> Peter,
>
> First off, as you may have guessed, I don't compile many 64 bit programs so thanks again for the help. I'll revert back to powerpc64-unknown-linux-gnu which is the default for -build and -host.
>
> Here's the gcc information
> [hostname]:/ # which gcc
> /usr/bin/gcc
> [hostname]:/ # gcc -dumpmachine
> powerpc64-suse-linux
>
> From looking at the GNU documentation for GCC  - IBM RS/6000 and PowerPC Options, I see that it mentions this option:
>
> -m64
>     
> Generate code for 32-bit or 64-bit environments of Darwin and SVR4 targets (including GNU/Linux). The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any PowerPC variant. The 64-bit environment sets int to 32 bits and long and pointer to 64 bits, and generates code for PowerPC64, as for -mpowerpc64. 
>
> So would some compiler flags such as these work:
>
> 'CC=gcc -m64' 'CXX=g++ -m64' 'FC=gfortran -mc64' 'F77=gfortran -m64' 'LDFLAGS=-L/lib64'
>   
>

That's likely. Or use CFLAGS=-m64, and FFLAGS, CXXFLAGS similarly.

I'd try compiling a simple hello.c program first. Try e.g. "gcc -m64 
hello.c" and see what "file a.out" has to say about the result.

You may also find yourself having to install a number of packages  with 
names like foo-64bit_xx.yy to get 64bit C libraries, but configure 
should tell you about any missing bits in due course, once you have it 
convinced not to build for 32bit.



[Rd] compile 2.4.1 for linux on power cpus
Peter Dalgaard