[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.6 Sub-architectures

Some platforms can support closely related builds of R which can share all but the executables and dynamic objects. Examples include builds under Solaris for different chips (in particular, 32- and 64-bit builds), 64- and 32- bit builds on `x86_64' Linux and different CPUs (e.g. `ppc', `i386' and `x86_64') under (Mac) OS X >= 10.4.

R supports the idea of architecture-specific builds, specified by adding `r_arch=name' to the configure line. Here name can be anything non-empty, and is used to name subdirectories of `lib', `etc', `include' and the package `libs' subdirectories. Example names from other systems are the use of `sparcv9' on Sparc Solaris and `32' by gcc on `x86_64' Linux.

If you have two or more such builds you can install them over each other (and for 32/64-bit builds on one architecture, one build can be done without `r_arch'). The space savings can be considerable: on `x86_64' Linux a basic install (without debugging symbols) took 63Mb, and adding a 32-bit build added 6Mb. If you have installed multiple builds you can select which build to run by

 
R --arch=name

and just running `R' will run the last build that was installed.

R CMD INSTALL will detect if more than one build is installed and try to install packages with the appropriate library objects for each. This will not be done if the package has an executable configure script or a `src/Makefile' file. In such cases you can install for extra builds by

 
R --arch=name CMD INSTALL --libs-only pkg1 pkg2

If you want to mix sub-architectures compiled on different platforms (for example `x86_64' Linux and `i686' Linux), it is wise to use explicit names for each, and you may also need to set `libdir' to ensure that they install into the same place.

When sub-architectures are used the version of Rscript in e.g. `/usr/bin' will be the last installed, but architecture-specific versions will be available in e.g. `/usr/lib64/R/bin/exec${R_ARCH}'. Normally all installed architectures will run on the platform so the architecture of Rscript itself does not matter. The executable Rscript will run the R script, and at that time the setting of the R_ARCH environment variable determines the architecture which is run.

When running post-install tests with sub-architectures, use

 
R --arch=name CMD make check[-devel|all]

to select a sub-architecture to check.

Sub-architectures are also used on Windows, but by selecting executables within the appropriate `bin' directory, `R_HOME/bin/i386' or `R_HOME/bin/x64'. For backwards compatibility with R < 2.12.0, there are executables `R_HOME/bin/R.exe' or `R_HOME/bin/Rscript.exe': these will run an executable from one of the subdirectories, which one being taken first from the R_ARCH environment variable, then from the `--arch' command-line option(6) and finally from the installation default (which is 32-bit for a combined 32/64 bit R installation).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by root on April, 26 2012 using texi2html 1.76.