Package Development Prerequisites
Overview
There are two main prerequisites for building R packages:
- GNU software development tools including a C/C++ compiler; and
- LaTeX for building R manuals and vignettes.
This article describes how to satisfy these dependencies for Windows, Mac OS X and Debian/Ubuntu Linux.
Windows
The core software development utilities required for R package development can be obtained from the Rtools download on CRAN: https://cran.rstudio.com/bin/windows/Rtools/.
After downloading and installing the version of Rtools appropriate to the version of R you are using, you should also ensure that you've arranged your system PATH as recommended by Rtools (you can choose to do this automatically as part of Rtools installation if you like).
To build manuals and vignettes you'll also need to install the MikTeX LaTeX distribution for Windows which you can download from here: http://miktex.org/download.
Mac OS X
The core software development utilities required for R package development can be obtained by installing the Command Line Tools for XCode. You can do this in one of two ways. Either:
- Download and install XCode from the Mac AppStore: http://itunes.apple.com/us/app/xcode/id497799835?mt=12
- Within XCode go to Preferences : Downloads and install the Command Line Tools
Or alternatively (for a smaller download size):
- Register as an Apple Developer (free) here: https://developer.apple.com/programs/register/
- Download the Command Line Tools for XCode appropriate for the version of OS X you are running from here: https://developer.apple.com/downloads/
To build manuals and vignettes you'll also need to install the MacTeX LaTeX distribution (or another version of LaTeX for the Mac). You can download MacTeX from here: http://www.tug.org/mactex/downloading.html.
Linux
For Debian/Ubuntu, you can install the core software development utilities required for R package development as well as LaTeX by executing:
sudo apt-get install r-base-dev texlive-full
Some packages may require installation of additional R build dependencies. To provide all components needed to build R itself from source you can execute:
sudo apt-get build-dep r-base-core
For other versions of Linux please consult their documentation to determine how to install a basic GNU development tool chain and a LaTeX distribution.
Comments