安装 R 语言编译器:
1、下载安装包:wget http://mirror.bjtu.edu.cn/cran/src/base/R-3/R-3.0.1.tar.gz
2、解压文件:tar -zxvf R-3.0.1.tar.gz
3、安装编译环境:
#yum install gcc-gfortran #否则报”configure: error: No F77 compiler found”错误
#yum install gcc gcc-c++ #否则报”configure: error: C++ preprocessor “/lib/cpp” fails sanity check”错误
#yum install readline-devel #否则报”–with-readline=yes (default) and headers/libs are not available”错误
#yum install libXt-devel #否则报”configure: error: –with-x=yes (default) and X11 headers/libs are not available”错误
4、创建安装路径:
mkdir -pv /public/home/R
cd R-3.0.1.tar.gz //进到解压包中
./configure --prefix=/pulic/home/R --enable-R-shlib --
make && make install
5、配置环境变量:
vim ~/.bash_profile #添加到PATH中
PATH=/public/home/R/bin:$PATH
source ~/.bash_profile
6、执行R试下能否正常运行。
评论