[R-SIG-Mac] 64-bit R compiling problem on Leopard

Simon Urbanek simon.urbanek at r-project.org
Thu Dec 13 18:59:20 CET 2007


On Dec 13, 2007, at 12:18 PM, Prof Brian Ripley wrote:

> On Thu, 13 Dec 2007, Simon Urbanek wrote:
>
>> Hi Herve,
>>
>> On Dec 12, 2007, at 7:06 PM, Herve Pages wrote:
>>
>>> Simon Urbanek wrote:
>>> [...]
>>>>
>>>> FWIW: dual 32-bit and 64-bit binaries of current R 2.6.1 patched
>>>> and R-
>>>> devel for Leopard are available from
>>>> http://r.research.att.com/
>>>> They support all four architectures. To start 64-bit Intel R use  
>>>> R --
>>>> arch=x86_64, for 64-bit ppc it is R --arch=ppc64.
>>>
>>> We are trying to help some Bioconductor users to use these nightly
>>> builds in 64-bit mode.
>>>
>>> I noticed that when I start them with R --arch=x86_64,
>>> 'sessionInfo()' and 'version' still report i386 (this is with the
>>> latest R-2.6-branch r R-devel builds for Leopard available at http://r.research.att.com/)
>>> .
>>>
>>
>> Yes - the platform is always i386 or powerpc since Mac OS X  
>> identifies
>> as such (there is no 64-bit only Mac OS X).
>
> I don't think so.  The R.version setting is coming from what  
> configure identifies as the value: e.g. the 'arch' value is that of  
> the C macro R_CPU.  The configure support files in R-devel have been  
> updated, and do give x86_64 using a 64-bit compiler on iMac/Leopard.

Not for me (tonight's R-devel build):

 > R.version
                _
platform       i386-apple-darwin9.1.0
arch           i386
os             darwin9.1.0
system         i386, darwin9.1.0
status         Under development (unstable)
major          2
minor          7.0
year           2007
month          12
day            12
svn rev        43668
language       R
version.string R version 2.7.0 Under development (unstable)  
(2007-12-12 r43668)

 > .Platform$r_arch
[1] "x86_64"

 > .Machine$sizeof.pointer
[1] 8


AFAICS R_CPU comes from host_cpu which is always i386 or powerpc for  
Darwin:
In config.guess for Darwin: UNAME_PROCESSOR=`uname -p` and Mac OS X  
always reports i386 or powerpc, never anything else. This is different  
from Linux where the kernel will use x86_64 if in 64-bit mode.

As I was saying, we would have to override the platform string (and we  
can), but the official platform is i386-apple-darwin.

A possible work-around would be to modify R_CPU according to the  
compiler (which is what you were suggesting I presume) after we have  
run the checks on the compiler, but we don't do that right now (AFAICS).

Now for something related - right now it is a bit tedious to specify  
the 64-bit builds, because it means to essentially set all compilers  
to custom values. A convenient solution would be to invert the above  
and modify the compilers automatically if host_cpu is set manually to  
a 64-bit CPU (this is what some projects do e.g. GMP) basically by  
appending -arch x86_64 or -arch ppc64 to all compilers. I'm not 100%  
convinced of the usefulness, but it is a solution ...

Cheers,
Simon



> I don't have a ppc Mac, so not know (nor care) what the value is  
> there.
> [...]
>
>
> -- 
> 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
>
>



More information about the R-SIG-Mac mailing list