Tuesday, December 11, 2007

Prepare your system to build R package under Windows

I have documented the steps to build R package here. The official reference is here. The most useful reference is here.

Since the release of R_2.6.0, R development team has announced some changes in building R package. The most known change is that a package developer has to use newer version of gcc (gcc_4.2.x). But for some reason gcc_4.2.x was never available for Window users through MinGW. However, Murdoch-Sutherland nicely updated Rtools for Windows users which of course, included gcc_4.2.x. The steps to prepare your system to make R pakcage is easier now.

Getting Started: Installing Necessary Software.

  • The R software: Install full package of R.
  • The minimal set of Unix utilities & Compilers (Perl & MinGW): Now all in R tools.
  • Microsoft html compiler.
  • A TeX system (MikTex): If you have another TeX system in your PC. You can ignore this step.
Change your PATH "environmental variable"
Rtools installation has the option to change this for you. All you need to add by yourself is the following red-fonted paths:
c:\Program Files\R\bin;C:\Program Files\HTML Help Workshop;c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin;C:\Program Files\MiKTeX 2.7\miktex\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
The first 6 paths are required paths. To see if you do everything properly, click "start" --> "run" and type "cmd." You will see a windows command console pumps out. Then you type followings:
  • gcc --help
  • perl --help
  • TeX --help
  • R CMD --help
For each, you should see a list of description. If not, something is wrong.

1 comment:

Yu-Sung Su said...

I have a blog entry for the updated procedure to build R pacakage.

http://yusung.blogspot.com/2007/12/prepare-your-system-to-build-r-under.html