【编译R语言】
1、下载安装R语言
# 下载R-3.3.2
$ wget https://cran.r-project.org/src/base/R-3/R-3.3.2.tar.gz
# 安装R-3.3.2
$ tar -zxvf R-3.3.2.tar.gz
$ cd R-3.3.2
# 安装到默认目录下 --perfix=/opt/R 或 /usr/local/lib64/R
$ ./configure --prefix=/opt/R --with-readline=yes --with-x=yes --enable-R-shlib
$ make
$ make install
# 配置R环境变量
$ vim /etc/profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/R/lib64/R/lib/
#或 /usr/local/lib64/R/lib64/R/lib
export PATH=/opt/R/lib64/R/bin:$PATH
# (保存修改:Esc --> Shift+: --> wq)
2、测试R语言是否编译成功
R
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
q()
如果centOS6中依赖版本过低,在R语言编译过程中就会出现各种错误;常见的集中错误及解决方案如下:
Error1:--with-readline=yes (default) and headers/libs are not available
$ yum install readline-devel
Error2:–with-x&#