[Rd] compile 2.4.1 for linux on power cpus

Peter Dalgaard p.dalgaard at biostat.ku.dk
Thu Mar 15 08:05:36 CET 2007


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.



More information about the R-devel mailing list