Skip to content

how to compile R for use with binary CRAN packages

3 messages · Tobias Verbeke, Brian Ripley, Simon Urbanek

#
Dear list, 

The build page at

http://r.research.att.com/building.html

explicitly mentions

<quote>
Note that your binary will require you to install all packages from sources. 
</quote>

Is there any documentation on how to compile R from source
in such a way that one can install binary packages from CRAN? 

I have read

http://cran.r-project.org/doc/manuals/R-admin.html#OS-X

but may have overlooked any specific pointers.

Many thanks in advance for your help.

Best,
Tobias

P.S. target R version currently is R 2.15.3 but if R 3.0.0 
would make this easier, then that is a sufficient reason to
move to R 3.0.0.
#
On 28/04/2013 18:43, Tobias Verbeke wrote:
Why do you want to do that?  If you modify the sources binary packages 
may not longer work ....

No guarantees, but

- do this for the version of R you currently have installed.

- configure R with --with-aqua, --enable-R-framework (which are the 
default, AFAIR).

- install it to the framework.

Then the version you built should be the one used by 'R' and 'R.app': 
try it at the command-line.

The default option("pkgType") will be "source", but you will be able to 
use options(pkgType="mac.binary") (3.0.0) or "mac.binary.leopard" 
(2.15.3).  To set the default during compilation, define 
PLATFORM_PKGTYPE when building src/main/platform.c
#
On Apr 29, 2013, at 5:04 AM, Prof Brian Ripley wrote:

            
The actual flags used to build the current CRAN binary are in

https://svn.r-project.org/R-dev-web/trunk/QA/Simon/R-build/conf.snowleopard-x86_64

If you want to replicate the CRAN build (requires Mac OS X 10.6), you can set it up with:

mkdir /Builds
cd /Builds
svn co https://svn.r-project.org/R-dev-web/trunk/QA/Simon/R-build nightly
make

cd /Builds/nightly
## put your favorite R sources here - either using svn or unpacking a tar ball - let's say it's R-3.0.0
./release R-3.0.0

If all went well you'll have everything built, installed, packages and tar balls in
deploy/snowleopard/R-3.0.0

In order to match the R capabilities that we supply on CRAN you'll also need quite a few static libraries like fontconfig, freetype, cairo etc.

Cheers,
Simon