It is simple to build R and R packages for Microsoft Windows from an ix86 Linux machine. This is very useful to package developers who are familiar with Unix tools and feel that widespread dissemination of their work is important. The resulting R binaries and binary library packages require only a minimal amount of work to install under Microsoft Windows. While testing is always important for quality assurance and control, we have found that the procedure usually results in reliable packages.

Instructions on cross-building come with the R source [1] in files such as INSTALL, readme.package, and Makefile under the directory src/gnuwin32/. However, it took us a substantial amount of time to get things worked out, and we thought it might be useful to share our experience by by presenting an explicit example. In this document, we intended to automate and illustrate steps for obtaining, installing, and using the cross-compilation tools. hoping that it might save people’s time.

These steps have been put into a Makefile, which accompanies this document, for automating the process. The Makefile is available from the contributed documentation area on Comprehensive R Archive Network (CRAN). The current version has been tested with R-2.1.0.

For the impatient and trusting, if a current version of Linux R is in the search path, then make CrossCompileBuild will run all Makefile targets described up to the section, Building R Packages and Bundles. This assumes: (1) you have the Makefile in a directory RCrossBuild (empty except for the makefile), and (2) that ./RCrossBuild is your current working directory. After this, one should manually set up the packages of interest for building, though the makefile will still help with many important steps. We describe this in detail in the section on Building R Packages and Bundles.

Setting up the Build area
We first create a separate directory for R cross-building, say RCrossBuild and will put the Makefile into this directory. From now on this directory is stored in the environment variable $RCB. Make sure the file name is Makefile, unless you are familiar with using the make program with other control file names.

Download pdf Building Microsoft Windows Versions of R and R packages under Intel Linux