Rev 6668 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
Building from a source-code library under Windows=================================================If your package has neither C nor Fortran source, see `Simple ports'at the bottom of this file.First collect the tools that you need.We recommend that you use the mingw32 port of gcc-2.95.2 by Mumit Khanfrom ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32. You willalso need suitable versions of make, sh, rm, sed, awk, mkdir, echo, cpand cat; we have packaged a set atCRAN/bin/windows/windows-NT/base/etc/tools.zip extracted from thecygwin distribution (http://sourceware.cygnus.com/cygwin and severalmirrors). To avoid past problems on some versions of Windows 95, weuse the cygwin ld contained in that set, which must be before themingw32 one in your path. (We have no way of knowing if this is stillnecessary.)It is also possible to use earlier mingw32 compilers or cygwin-b20.1with the --no-cygwin flag, but we suggest you do so only if you have aworking setup from building earlier versions of R. We have alsosuccessfully used the variant of mingw32 that uses the MSVCRT run-timesystem (under gcc-2.95.x but not earlier versions), and in the case ofthe mclust library found this more successful that the standardversion. Be aware that not all Windows machines have MSVCRT.DLLinstalled.(If you want to use cygwin, we suggest you upgrade to gcc-2.95.2 byinstalling the files gcc-2.95.2-cygb20.tar.gz andgcc-2.95.2-mingw-extra.tar.gz fromftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin32.)perl5, available via http://www.perl.com/CPAN/ports.groff, available at http://www.itribe.net/virtunix/groff-1.10nt.zip.If you want to make compiled html (.chm) files you will need theMicrosoft HTML Help Workshop, available for download athttp://msdn.microsoft.com/workshop/author/htmlhelp.If you want to make Window help files you will need hcrtf.exe from aWindows compiler installation (this is available for download atftp://ftp.microsoft.com/support/MSLFILES/HCWSETUP.EXE), or hcp505.exeFor large packages it is helpful to make zipped help files: for thatyou need zip from the Info-ZIP project(ftp://ftp.cdrom.com/pub/infozip/Info-ZIP.html and mirrors).All of these need to be installed and in your path, and theappropriate environment variables set. Edit MkRules to set target andthe appropriate paths as needed. Thencd RHOME\src\gnuwin32and runmake libR.awhich may take several minutes. (We have seen times from 30 secs to 20minutes depending on processor speed, RAM, disk speed andcompiler. Using a network file system is likely to take longer.) Thisonly needs to be done once for each R release.For each package you want to install, unpack it to a directory, saymypkg, in RHOME\src\library, and runcd RHOME\src\gnuwin32make pkg-mypkgThe Makefiles can be customized: in particular the name of the DLL canbe set (see the line integrate-DLLNM=adapt), the compile flags canbe set (see the examples in MakeDll) and the types of help (if any) to begenerated can be chosen (variables HELP and WINHELP).Using zipped help files=======================You will need zip installed, of course. Just runmake ziponly-mypkgafter building mypkg. Target `ziphelp-mypkg' will make the zip filesbut not remove the separate files: this can be used for testing.Checking packages=================The equivalent of `R CMD check mypkg' on Unix ismake pkgcheck-mypkgThis runs all the examples in the help files. If you need to increasethe heap size or the number of cons cells (e.g. for lme and nlme) useenvironmental variables to do so.Debugging=========See the RW-FAQ.Using Visual C++================You may if you prefer use Visual C++ to make the DLLs (unless they useFortran source!). First build the import library R.lib bylib /def:R.exp /out:Rdll.libThen you can compile the objects and build the DLL bycl /MT /Ox /D "WIN32" /c *.clink /dll /out:mypkg.dll *.obj Rdll.lib(at least under VC++ 4.2 and 6.0). If the C sources use R header files youwill need to arrange for these to be searched, perhaps by/I ..\..\..\includeIf you build a debug version of the DLL in the developmentenvironment, you can debug the DLL code there just by setting theexecutable to be debugged to the full path to the R front-end.Simple Ports============If your package has neither C nor Fortran source, several steps canbe omitted.You will needsuitable versions of make, sh, rm, sed, awk, mkdir, echo, cp and cat;we have packaged a set at bin/windows/windows-NT/etc/tools.zipperl5, available via http://www.perl.com/CPAN/ports.groff, available at http://www.itribe.net/virtunix/groff-1.10nt.zip.All of these need to be installed and in your path, and theappropriate environment variables set.For each package you want to install, unpack it to a directory, saymypkg, in RHOME\src\library, and runcd RHOME\src\gnuwin32make pkg-mypkgIf you have a Unix/Linux box, it will suffice to zip up the Unix installationof the package. Install the package, thencd `R RHOME`/libraryzip -rl /dest/mypkg.zip mypkg(the -l flag converts to CRLF line endings: it is not absolutely necessarybut users may want to read the information files in a Windows editor).zip is often installed on Linux machines, and sources and binaries forUnix boxes are available via the Info-Zip site given above.Feedback========Please send comments and bug reports to (preferably both of)Guido Masarotto <guido@hal.stat.unipd.it>Brian Ripley <ripley@stats.ox.ac.uk>