-
Notifications
You must be signed in to change notification settings - Fork 30
/
020_install.Rmd
executable file
·55 lines (30 loc) · 1.07 KB
/
020_install.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Installation
Before developing with Rcpp, you need to install a C++ compiler.
## Install C++ compiler
### Windows
Install [Rtools](https://cran.r-project.org/bin/windows/Rtools/index.html).
### Mac
Install Xcode command line tools. Execute the command `xcode-select --install` on Terminal.
### Linux
Install gcc and related packages.
In Ubuntu Linux, execute the command `sudo apt-get install r-base-dev` on Terminal.
## Using other compilers installed by yourself
If you installed other compiler (g++, clang++) different from above, create the following file under the user's home directory. Then set environment variables in the file.
**Linux, Mac**
- `.R/Makevars`
**Windows**
- `.R/Makevars.win`
**Example settings of environmental variables**
```
CC=/opt/local/bin/gcc-mp-4.7
CXX=/opt/local/bin/g++-mp-4.7
CPLUS_INCLUDE_PATH=/opt/local/include:$CPLUS_INCLUDE_PATH
LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH
CXXFLAGS= -g0 -O2 -Wall
MAKE=make -j4
```
## Install Rcpp
You can install Rcpp by executing the following code.
```r
install.packages("Rcpp")
```