Rev 32581 | Rev 32720 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
R for Windows=============This distribution contains the sources to build a port of R to run on(32-bit) Windows 95, 98, ME, NT4, 2000, XP and 2003 on Intel/clonechips. See the file `README.rw2xxx' for fuller details, including howto install the binary versions.Building From Source on Windows===============================[Some further details, including how to debug, are given in the rw-FAQ.]First collect the tools that you need. There is a `portal' withcurrent links at http://www.murdoch-sutherland.com/Rtools/.Collect the tools-----------------You will need suitable versions of at least make, sh, cat, cp, cut,diff, echo, egrep, expr, grep, ls, mkdir, mv, rm, sed, touch; we usethose from the cygwin distribution(http://www.cygwin.com/mirrors.html) or (gzip, makeinfo, texindex)compiled from the sources. We have packaged a set athttp://www.murdoch-sutherland.com/Rtools/tools.zip.BEWARE: `Native' ports of make are _not_ suitable (including that atthe mingw site). There were also problems with several earlierversions of the cygwin tools and dll. To avoid frustration, pleaseuse our tool set, and make sure it is at the front of your path(including before the Windows system directories). If you are using aWindows shell, type PATH at the prompt to find out.iconv.dll from http://www.murdoch-sutherland.com/Rtools/iconv.dll.Put this in R_HOME/modules at the end of the build.You need a recent version of the Mingw port of gcc fromhttp://sourceforge.net/projects/mingw/. There will be a distributioncalled something like MinGW-3.1.0-1.exe (which is built fromgcc-3.2.3). This needs updating with mingw-runtime >= 3.5 and w32api>= 3.1. The release of gcc-3.3.1 and the release candidates of 3.4.1and 3.4.2 have also been tested successfully.Jan 2005: There is now a release candidate of MinGW-3.2.0: please use that.The Windows port of perl5, available viahttp://www.activestate.com/Products/ActivePerl/.BEWARE: you do need the *Windows* port and not the Cygwin one.zip and unzip from the Info-ZIP project (http://www.info-zip.org andmirrors, and included in our tools.zip).The TclTk support files are inhttp://www.murdoch-sutherland.com/Rtools/R_Tcl.zip: unzip it at thetop level of the R sources: it will add directories $RHOME/Tcl,$RHOME/Tcl/bin, etc.To make compiled html (.chm) files you will need theMicrosoft HTML Help Workshop, currently available for download athttp://msdn.microsoft.com/library/en-us/htmlhelp/html/hwmicrosofthtmlhelpdownloads.aspand http://www.microsoft.com/office/ork/xp/appndx/appa06.htm.(It is not longer documented how not to make .chm files.)You may need this on the same drive as the other tools. (Although wehave successfully used it elsewhere, others have reported problems).All of these need to be installed and in your path, and theappropriate environment variables set. You also need `.' in yourpath. Do not use filepaths with spaces in: you can always use theshort forms (found by dir /x at the Windows command line).Check your path---------------You need the following in your path (with the first two first):.our toolsetmingw\binPerl\binthe latex bin directoryzip.exe, unzip.exe, hhc.exeDo not use spaces nor unnecessary quotes in your PATH variable.Make sure all of the above are before the Windows system directories(especially that containing FIND.EXE).Do not have our toolset and any other version of cygwin1.dll in your path.Building--------You also need the R source (R-2.x.y.tgz).Then: untar R-2.x.y.tgz somewhere (with no spaces in the path names),cd /somewheretar zxvf /path/to/R-2.x.y.tgzcd /somewhere/R-2.x.y/src/gnuwin32BEWARE: do untar the sources rather than use broken tools such asWinZip that don't understand about symbolic links.IMPORTANT: edit MkRules to set the appropriate paths as needed and toset the type(s) of help that you want built. BEWARE: MkRules containstabs and some editors (e.g. WinEdt) silently remove them.Then runmakeNote 1: The file bin/Rchtml.dll is only built if CHM help isspecified in MkRules. Its source is the help directory, and you needthe HTML Help Workshop files to build it. You can justcopy this from a binary distribution.Note 2: we have had reports that earlier versions of Norton Anti-Viruslock up the machine when windres is run, so you may need to disableit. (Norton Anti-Virus 2002 causes no problems.)Note 3: By default Doug Lea's malloc in the file src/gnuwin32/malloc.cis used for R's internal memory allocations. You can opt out of thisby commenting the line LEA_MALLOC=YES in MkRules, in which case themalloc in msvcrt.dll is used. This does work but imposes aconsiderable performance penalty.Note 4: You can run a parallel make by e.g.make -j2but this is only likely to be worthwhile on a dual-processor (orperhaps a hyperthreaded P4) machine with ample (at least 384Mb) ofmemory. On a dual AthlonXP it reduced the build time by about 30%whereas on a single P4HT it reduced it by 10%. Note that this maysometimes stop and have to be restarted.You can test a build by (optionally) building the recommended packages(see below) and running `make check'. You may need to set TMPDIR to(the absolute path to) a suitable temporary directory: the default isc:/TEMP. (Use forward slashes and do not use a path including spaces.)Using ATLAS-----------You can make use of ATLAS (http://math-atlas.sourceforge.net/) fastBLAS libraries by defining USE_ATLAS=YES in MkRules and specifying thepath to the libraries in macro ATLAS_PATH.You will need to build the libraries optimized for your architectureunder the Cygwin compilers.For conveniencemake Rblas-clean Rblaswill re-make the Rblas.dll and so allows experimentation with different BLASconfigurations.Prebuilt Rblas.dll for various Pentium and AthlonXP chips are availablein the windows/contrib/ATLAS area on CRAN.Using K. Goto's BLAS--------------------Another tuned BLAS which is available for some CPUs is by KazushigeGoto. He does not allow redistribution: they are currently availablevia http://www.cs.utexas.edu/users/kgoto/signup_first.html. To makeuse of this, put the DLL somewhere in your path or in R_HOME/bin, andedit MkRules to define USE_GOTO=YES and the name of the DLL (somethinglike libgoto_p4_512-r0.9.dll).Goto's BLAS takes preference over ATLAS, and seems a little faster.However, as it is compiled for MSVC, we have been unable to make itwork for complex arithmetic and so it is only used in for real linearalgebra.Dr Goto supplies DLLs for PIII, P4 and Opteron processors: that forPIIIs runs on AthlonXP as well.Building bitmap device support------------------------------The file bin/Rbitmap.dll is not built automatically: instructions onhow to build it are in the file bitmap/INSTALL.If everything is set up in directory bitmap,make bitmapdllwill work from this directory.Internationalization--------------------This version of R can be built with support for some multibytecharacter sets such as UTF and (some of) those used in Chinese,Japanese and Korean.Define SUPPORT_GUI_MBCS in MkRules to enable support for MBCS in theRGui console, pager, data and script editors (this is based on theJapanization patches by Nakama and Okada).Define SUPPORT_UTF8 in MkRules to enable support in the R engine forUTF-8 character sets. [We need to supply a way to specify such alocale.] This will also handle MBCSs which are strict supersets ofASCII, such as EUC-JP, but not [yet] Japanese in code page 932.If either of these is defined you need the DLL msvcp60.dll to beinstalled. It is on recent versions of Windows, and can be obtainedby an Internet search.Recommended packages====================The recommended packages can be built bymake recommendedand checked bymake check-recommendedIf you are using a cvs/rsync version of the R sources, you need to putthe .tar.gz files for the recommended packages in../library/Recommended, and run `make link-recommended'. If you haversync installed,make rsync-recommendeddoes this from the CRAN master.Building the Manuals====================To make the PDF versions of the manuals you will need pdftex installedand configured to work with a large file: see doc/manual/README. Youalso need texindex (included in our tool set). Then the pdf manualscan be made bymake manualsIf you want to make the info versions (not the Reference Manual), usecd ../../doc/manualmake -f Makefile.win infoTo make DVI versions of the manuals usecd ../../doc/manualmake -f Makefile.win dvi(assuming you have tex and latex installed and in your path).The fptex distribution of TeX (via www.fptex.org) includes a suitableport of pdftex. Please read the section in R-admin.html about how tomake 'refman.pdf' and set the environment variables R_RD4DVI andR_RD4PDF suitably and ensure you have the required fonts installed.By default the manuals are made for the ISO standard a4 paper size.Users living in N. America might want to usecd ../../doc/manualmake -f Makefile.win R_PAPERSIZE=letter pdfor set R_PAPERSIZE in the environment and use make -e, for exampleR_PAPERSIZE=letter make -e manualsSee the R-admin manuals for fuller details.Building the installers=======================See installer/INSTALL. You need to have the files for a complete R build,including bitmap and Tcl/Tk support and the manuals, as well as therecommended packages.Once everything is set upmake distributionmake check-allwill make all the pieces and the installers and put them in thegnuwin32/cran subdirectory, then check the build. This works by buildingall the parts in the sequence:Rpwd.exe (a utility needed in the build)rbuild (the executables, the FAQ docs etc.)rpackage (the base packages)htmldocs (the HTML documentation)bitmapdll (the bitmap support files)recommended (the recommended packages)vignettes (the vignettes in package grid:only need if building from svn checkout)manuals (the PDF manuals)rinstaller (the install program)crandir (the CRAN distribution directory)The parts can be made individually if a full build is not needed, butearlier parts must be built before later ones. (The Makefile doesn'tenforce this dependency---some build targets force a lot ofcomputation even if all files are up to date.) The first four targetsare the default build if just "make" is run.If you want to customize the installation by adding extra packages,replace `make rinstaller' by something likemake rinstaller EXTRA_PKGS='pkg1 pkg2 pkg3'(Note these packages will also be added to the miniR installer.)An alternative way to customize the installer starting with a binarydistribution is given in file installer/INSTALL.Cross-building on ix86 Linux============================You will need i386-mingw32 cross-compilers installed and in your path.There is currently a complete set of tools athttp://www.stats.ox.ac.uk/pub/Rtools/mingw-cross4.tar.bz2(Just unpack this somewhere and put its bin directory in your path.)You will need Perl, zip and unzip installed and makeinfo >= 4.5(part of GNU texinfo).You also need the R source (R-2.x.y.tgz).Then: untar R-2.x.y.tgz somewhere, andcd /somewhere/R-2.x.y/src/gnuwin32Edit MkRules to set BUILD=CROSS and the appropriate paths (includingHEADER) as needed.Edit MkRules to set the type(s) of help that you want built. (You willnot be able to cross-build .chm files, so WINHELP is automatically setto NO.)You also need a working copy of *this version* of R on Linux:uncomment and set R_EXE in MkRules to point to it.Then run `make' (and parallel make works reliably, unlike on Windows).Packages can be made in the same way as natively: see the fileREADME.packages.(It is possible to cross-build the installers using WINE, which weleave as an exercise for the reader.)To distribute a cross-build (or just to transfer it to a Windows machinefor testing) usecd installermake imagedirzip -r9X rw2000.zip rw2000 # or something similarCurrently we have not found a reliable way to convert base to lazy-loadingwhen cross-building, so it is left in the old format.Feedback========Please send comments and bug reports toR-windows@r-project.org