一、源码安装
1、下载R 安装包
R-3.0.3.tar.gz https://cran.r-project.org/src/base/R-3/R-3.0.3.tar.gz
2、解压
tar xvf R-3.0.3.tar.gz
3、./configure --enable-R-shlib
cd R-3.0.3
./configure --enable-R-shlib
1)./configure 报错
configure: error: No F77 compiler found
解决方法:
yum install gcc-gfortran
2)./configure 报错
configure: error: --with-readline=yes (default) and headers/libs are not available
解决方法:
yum install readline-devel
3)./configure 报错
configure: error: --with-x=yes (default) and X11 headers/libs are not available
解决方法:
yum install libXt-devel
4)./configure 报错
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
解决方法:
yum install gcc-c++ glibc-headers
5)./configure 报错
whether bzip2 support suffices... configure: error: bzip2 library and headers are required
解决办法
[root@localhost R-3.4.3]# yum search bzip2 ================================= N/S matched: bzip2 ================================== bzip2-devel.i686 : Libraries and header files for apps which will use bzip2 bzip2-devel.x86_64 : Libraries and header files for apps which will use bzip2 bzip2-libs.i686 : Libraries for applications using bzip2 bzip2-libs.x86_64 : Libraries for applications using bzip2 perl-Compress-Raw-Bzip2.x86_64 : Low-level interface to bzip2 compression library bzip2.x86_64 : A file compression utility Name and summary matches only, use "search all" for everything.
checking whether PCRE support suffices... configure: error: pcre >= 8.20 library and headers are required解决方法
环境配置完毕后,可以进行make和安装
make & make install
配置I5的话 大概是15到20分钟。就成功了
编译安装完毕后,进行环境配置。 vim /etc/profile #add R env R_HOME=/usr/local/R-3.4.3 PATH=$PATH:$R_HOME/bin source /etc/profile
再在控制台输入R命令,就显示了
[root@localhost R-3.4.3]# R R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R是自由软件,不带任何担保。 在某些条件下你可以将其自由散布。 用'license()'或'licence()'来看散布的详细条件。 R是个合作计划,有许多人为之做出了贡献. 用'contributors()'来看合作者的详细情况 用'citation()'会告诉你如何在出版物中正确地引用R或R程序包。 用'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或 用'help.start()'通过HTML浏览器来看帮助文件。 用'q()'退出R. >