From ripley at stats.ox.ac.uk  Thu Mar 15 08:11:34 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 15 Mar 2007 07:11:34 +0000 (GMT)
Subject: [Rd] compile 2.4.1 for linux on power cpus
In-Reply-To: <45F8F040.6070907@biostat.ku.dk>
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>
	<45F8F040.6070907@biostat.ku.dk>
Message-ID: <Pine.LNX.4.64.0703150709370.30980@gannet.stats.ox.ac.uk>

On Thu, 15 Mar 2007, Peter Dalgaard wrote:

> 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.

The CC etc forms are preferred, as not all configure scripts use the 
environment CFLAGS.

See the Solaris 64-bit notes in the R-admin manual for proven examples.

>
> 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.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] compile 2.4.1 for linux on power cpus
Prof Brian Ripley