From simon.urbanek at r-project.org  Fri Aug 28 17:55:51 2009
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Fri, 28 Aug 2009 11:55:51 -0400
Subject: [Rd] ARM v7/Linux Port/cross-compile?
In-Reply-To: <20090828151853.GB32127@piskorski.com>
References: <A5DA4C50-9D36-4C77-8D40-AEE632FBD939@r-project.org>
	<20090828151853.GB32127@piskorski.com>
Message-ID: <2E0C743D-C76A-42EF-84AE-0C5CA5232C90@r-project.org>

On Aug 28, 2009, at 11:18 , Andrew Piskorski wrote:

> On Thu, Aug 27, 2009 at 06:36:38PM -0400, Simon Urbanek wrote:
>
>> It was fairly straight-forward to build R (like any other cross-
>> compilation). The tricky part is to install packages (if you are  
>> truly
>> cross-compiling on another architecture) which I solved by using  
>> multi-
>> arch R (which contains both arm and the host architecture) and cross-
>> compiling only the binaries (i.e. only packages with native code).
>
> Simon, could you provide any links to more detailed info on how you  
> did that, please?  E.g., how did you detect whether a package  
> contains binaries (native code) or not?  What exactly is a multi- 
> arch R and how did you build it?
>

See "R Installation and Administration" (R-admin) section 2.5 Sub- 
architectures.

You can build R that has binaries for both 32-bit and 64-bit simply by  
setting r_arch (we use that for quite a while on OS X to build for  
PPC, Intel - both 32 and 64-bit). Subsequently all packages will be  
build for all architectures by default, so there is nothing you have  
to do (except if the packages uses configure script in which case you  
have to install it subsequently with --libs-only for additional  
architectures - see R-admin 2.5 again. This is easy to spot since the  
installed package will have only one directory in "libs").


> I often need to build R packages for both x86 32 and 64 bit.  
> Currently, I build both R and all the packages twice in two entirely  
> separate directory trees, which is both annoying, and overkill for  
> all the R-code-only packages.  It sounds like you know a better way...
>

Yes, the above :).

Cheers,
Simon



[Rd] ARM v7/Linux Port/cross-compile?
Simon Urbanek