Rtools42 for Windows

Rtools is a toolchain bundle used for building R packages from source (those that need compilation of C/C++ or Fortran code) and for build R itself. Rtools42 is used for R 4.2.x and currently for R-devel, the development version of R since revision 81360.

Rtools42 consists of Msys2 build tools, GCC 10/MinGW-w64 compiler toolchain and libraries and QPDF. Rtools42 supports 64-bit Windows and UCRT as the C runtime. The code compiled by earlier versions of Rtools is incompatible and has to be recompiled with Rtools42 for use in R packages. Switching to UCRT allows to use UTF-8 as the native encoding on Windows.

Installing Rtools42

Rtools42 is only needed for installation of R packages from source or building R from source. R can be installed from the R binary installer and by default will install binary versions of CRAN packages, which does not require Rtools42.

Moreover, online build services are available to check and build R packages for Windows, for which again one does not need to install Rtools42 locally. The Winbuilder check service uses identical setup as the CRAN incomming packages checks and has already all CRAN and Bioconductor packages pre-installed.

Rtools42 may be installed from the Rtools42 installer. It is recommended to use the defaults, including the default installation location of C:\rtools42.

When using R installed by the installer, no further setup is necessary after installing Rtools42 to build R packages from source. When using the default installation location, R and Rtools42 may be installed in any order and Rtools42 may be installed when R is already running.

Additional information

A detailed tutorial on how to build R and packages using Rtools42 for R package authors and R developers is available for R-4.2.x and R-devel.

From the user perspective, Rtools42 is almost the same as Rtools4. Both include Msys2 build tools.

Unlike Rtools4

Rtools42 re-use the installer code (only with minor modifications) from Rtools4.

Sources are available for the toochain tarballs and the Rtools42 installer.