[Rd] Building R sources on Windows

Bill Northcott w.northcott at unsw.edu.au
Wed Jul 13 10:17:30 CEST 2005


Following considerable off list discussion, I will post this on the  
list in the hope that it may help others who experience the same  
grief I did getting R sources to build on Windows.

Firstly there is just no way that, starting with a clean version of  
Windows 2003 server, and following the instructions provided in the  
Admin and Installation manual, web sites and various FAQs, I could  
get a working build setup.  I can only conclude that all the users  
actually building R on Windows have some software installed that is  
not in the documentation.

The following recipe does work repeatably for me.

Install the following third party packages as mentioned in the  
install manuals and Duncan Murdoch's Rtools page:
Tcl/tk support
libpng
libjpeg
BLAS (I used ATLAS)
ActiveState PERL
Microsoft HTML Help Workshop
MikTek
Inno Setup 5
iconv.dll
MinGW-4.1.0

Duncan Murdoch's page on using MikTek is good but but more  
complicated than it needs to be.  The only problem with the default e- 
TeX enhanced mode seems to be with the texinfo sources.  So only the  
tex and pdftex commands need to be reset to use e-TeX compatibility  
mode.  latex and pdflatex are only used to process the tex sources  
for the Reference manual and these have no problem with the current  
MikTek defaults.

The issue with MikTek finding the Rd.sty file is more easily fixed by  
minor changes to doc/manual/Makefile.win.
Change lines 21 - 24 of doc/manual/Makefile.win to read:
> RTEX=
> ifeq ($(strip $(MIKTEX)),YES)
> # Setup MikTEX search path
> RTEX=-include-directory=$(RHOME)/share/texmf
> endif
>
> PDFLATEX = pdflatex $(RTEX)
> LATEX = latex $(RTEX)
> PDFTEX = pdftex $(RTEX)
> TEX = tex $(RTEX)

So far this all fairly much as the instructions.

However, I had no joy getting the Rtools package to provide the rest  
of what I needed.  All my build attempts failed with path errors of  
one sort or another.   Instead I used the Msys 1.0.10 package from  
MinGW.  This provides a minimal set of build tools which includes  
everything needed except zip.exe and unzip.exe.  I used the ones from  
Rtools and put them in the msys\1.0\local\bin.

The only remaining problem was that the makeinfo.exe in Msys is too  
old.  So I used the Msys set up to build makeinfo from texinfo-4.7  
sources.  This also needed wget and libiconv, which I also built from  
current sources.  The binaries need to go in msys\1.0\local so that  
they have precedence over the older ones in the msys package.

When this was done I had a totally MinGW build setup with no Cygwin  
binaries and everything understanding the same MinGW path conventions  
ie C:\foo\bar, C:/foo/bar or /c/foo/bar.  I did not need to make any  
modifications to the Windows PATH other than those made automatically  
by the installers for the various packages.

It all works very nicely to build R from sources using 'make  
distribution' as described in the manual.

If anyone would like a copy of the makeinfo binary to save the  
trouble of building it, please email me.

One final note:  If you install the MinGW Msys-DTK rename the perl  
binaries such as perl.exe which it provides.  Otherwise they will be  
used instead of the ActiveState ones and they don't work.

Cheers
Bill Northcott



More information about the R-devel mailing list