R-3.2.4源码安装与RStudioServer安装
不同的R版本出现的问题略有不同,本文给出了R-3.2.4源码安装时,一些问题的解决策略!
R-3.2.4安装
step1:下载R-3.2.4.tar.gz
step2:解压
[root@localhost opt]# tar -zxvf R-3.2.4.tar.gz
step3:安装
[root@localhost R-3.2.4]# pwd
/opt/R-3.2.4
[root@localhost R-3.2.4]# ./configure --enable-R-shlib
错误!
configure: error: --with-x=yes (default) and X11 headers/libs are not available
问题解决:(若python已升级至python3.X,则切换至默认python2.7.5的情形下,安装包
切换python版本
[root@localhost opt]# mv /usr/bin/python2.7.5 /usr/bin/python
[root@localhost bin]# mv /usr/bin/python /usr/bin/python2.7.5
[root@localhost bin]# ln -s /usr/local/bin/python3.4 /usr/bin/python
此时,python默认的版本为python3.4
)
[root@localhost R-3.2.4]# yum install libXt-devel
step4:再次安装
(参考:http://www.linuxidc.com/Linux/2015-04/115790.htm)
[root@localhost R-3.2.4]# ./configure --enable-R-shlib
警告!
configure: WARNING: you cannot build info or HTML versions of the R manuals
configure: WARNING: you cannot build PDF versions of the R manuals
configure: WARNING: you cannot build PDF versions of vignettes and help pages
执行:
[root@localhost R-3.2.4]# yum install texinfo.x86_64
[root@localhost R-3.2.4]# ./configure --enable-R-shlib
警告!(已经减少一个!)
configure: WARNING: you cannot build PDF versions of the R manuals
configure: WARNING: you cannot build PDF versions of vignettes and help pages
[root@localhost R-3.2.4]# yum install texlive.x86_64
[root@localhost R-3.2.4]# ./configure --enable-R-shlib
警告!(问题继续再减少)
configure: WARNING: neither inconsolata.sty nor zi4.sty found: PDF vignettes and
package manuals will not be rendered optimally
然后,下载:inconsolata ,解压至/usr/share/texlive/texmf-dist/tex/latex文件下
[root@localhost latex]# pwd
/usr/share/texlive/texmf-dist/tex/latex
texlive 默认安装位置后sty 存放的位置为:/usr/share/texlive/texmf-dist/tex/latex
将上述下载的压缩包整个文件夹解压到 上述目录,需要sudo权限才能移动到该目录,如果命令用的不
好,可以执行
sudo nautilus
在弹出的文件管理器中打开该压缩包拖进该弹出的文件管理器的上述目录下.
然后刷新一下 sty 就好.
sudo mktexlsr
或者
sudo texhash
然后此时执行
[root@localhost R-3.2.4]# ./configure --enable-R-shlib
最后给出的判定
R is now configured for x86_64-pc-linux-gnu
Source directory: .
Installation directory: /usr/local
C compiler: gcc -std=gnu99 -g -O2
Fortran 77 compiler: gfortran -g -O2
C++ compiler: g++ -g -O2
C++ 11 compiler: g++ -std=c++11 -g -O2
Fortran 90/95 compiler: gfortran -g -O2
Obj-C compiler:
Interfaces supported: X11, tcltk
External libraries: readline, zlib, bzlib, lzma, PCRE
Additional capabilities: PNG, NLS
Options enabled: shared R library, shared BLAS, R profiling
Capabilities skipped: JPEG, TIFF, cairo, ICU
Options not enabled: memory profiling
Recommended packages: yes
[root@localhost R-3.2.4]# make
conftest.c:1:17: fatal error: jni.h: No such file or directory
[root@localhost R-3.2.4]# yum install hawtjni-javadoc.noarch
再次运行:
[root@localhost R-3.2.4]# make
问题解决!
[root@localhost R-3.2.4]# make install
R完成安装!
step5:RStudioServer安装
(官网说明)
$ wget https://download2.rstudio.org/rstudio-server-rhel-0.99.893-x86_64.rpm
$ sudo yum install --nogpgcheck rstudio-server-rhel-0.99.893-x86_64.rpm
另外,给出一种更方便快捷的方法。
参考网址:http://www.cnblogs.com/sourceforge/p/RStudio-Server-Setup.html
正文如下:
CentOS 6主机上的RStudio Server安装步骤
1. 安装EPEL库
yum -y install epel-release
2. 安装R
yum install R
3. 安装OpenSSL
yum install openssl098e
4. 下载RStudio Server安装包
wget http://download2.rstudio.org/rstudio-server-0.98.1102-x86_64.rpm
5. 安装RStudio Server
yum install --nogpgcheck rstudio-server-0.98.1102-x86_64.rpm
6. 在rstudio-server组中添加rstudio用户
adduser rstudio passwd rstudio usermod -g rstudio-server rstudio
7. 通过浏览器访问RStudio,访问地址:http://ip:8787,用户名和密码使用刚刚创建的rstudio即可。