在Linux下,最新版R源碼安裝會遇到多個錯誤異常警告,很多時候大家會選擇忽略並完成安裝,但在使用中,在某些問題上會出現意想不到的問題。現整理完整安裝攻略如下:
step0:下載R安裝包 R-3.2.2.tar.gz
step1:
[root@localhost Downloads]# tar xvf R-3.2.2.tar.gz #解壓
step2:
[root@localhost R-3.2.2]# cd R-3.2.2
[root@localhost R-3.2.2]# ./configure --enable-R-shlib
configure: error: No F77 compiler found #錯誤描述
[root@localhost R-3.2.2]# yum install gcc-gfortran #解決方案
Complete!
step3:
[root@localhost R-3.2.2]# ./configure --enable-R-shlib
configure: error: in `/home/yuanmin/Downloads/R-3.2.2': #錯誤描述
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
[root@localhost R-3.2.2]# yum install gcc-c++ glibc-headers #解決方案
Complete!
step4:
[root@localhost R-3.2.2]# ./configure --enable-R-shlib
configure: error: --with-readline=yes (default) and headers/libs are not available #錯誤描述
[root@localhost R-3.2.2]# yum install readline-devel #解決方案
Complete!
step5:
[root@localhost R-3.2.2]# ./configure --enable-R-shlib
configure: error: --with-x=yes (default) and X11 headers/libs are not available #錯誤描述
[root@localhost R-3.2.2]# yum install libXt-devel #解決方案
Complete!
step6:
[root@localhost R-3.2.2]# make
*** Cannot find any Java interpreter #錯誤描述
*** Please make sure 'java' is on your PATH or set JAVA_HOME correspondingly
make[1]: [stamp-java] Error 1 (ignored)
make[1]: Leaving directory `/home/yuanmin/Downloads/R-3.2.2'
[root@localhost R-3.2.2]# yum search java #尋找相關外掛程式
[root@localhost R-3.2.2]# yum install java_cup.x86_64 #解決方案
Complete!
step7:
[root@localhost R-3.2.2]# make
[root@localhost R-3.2.2]# make install
--------------------------
安裝完成。