[Rd] Change of compiler for Windows build of R

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Aug 14 08:52:28 CEST 2007

The MinGW people have finally released a couple of builds of gcc 4.2.1 
(and finally moved the build of 3.4.5 to release status after 19 months as 

We intend to use gcc 4.2.1 for the binary distribution of R 2.6.0, and 
builds of R-devel are being made with it from now on.  The R-admin manual 
now contains details of the pieces you need, and in due course there will 
be an updated Rtools.exe containing this version.  I've successfully built 
cross-compilers although am unlikely to distribute one for a while.

gcc 4.2.1 is a better check of standards conformance, and you may see 
warnings in packages not present with gcc 3.4.5.  All the CRAN packages 
have been checked, and this showed up some issues with packages which 
deviated markedly from the documented procedures. E.g.

- the C++ compiler is $(CXX), not g++, and $(CXX) is defined in MkRules.

- there is a quirk with dlltool both on Vista and with gcc 4.2.1 on XP
   that needs '--as' included amongst the flags.  The rule in MkRules
   works: several user-written rules do not.

So far we have seen no issues with mixing code compiled with gcc 3.4.5 and 
4.2.1.  There would almost certainly be issues with third-party C++ 
libraries, and might be some with Fortran libraries that use complex 

The advantages of using this port include:

- Vista compatibility out of the box.

- ongoing support.  The main MinGW developer is really targetting gcc
   4.3.0, and these compilers are interim releases with patches backported
   from the gcc trunk.

- More complete C99 features: for example C99 inlining will be supported
   in gcc 4.3.0 (and has already been tested using snapshots).

- integrated F9x support.  F9x is supported 'out of the box', and can now
   consider using F9x code in R.

- OMP and threading support.

R 2.5.1 will not build out of the box with these compilers, but R-patched 
will (for suitable settings in MkRules).

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list