Centos 安装R

时间:2023-03-09 08:12:17
Centos 安装R

1 下载R源代码

原码下载地址
https://cloud.r-project.org/
https://cloud.r-project.org/src/base/R-3/R-3.4.2.tar.gz

2 安装编译环境

yum -y install gcc
yum install glibc-headers
yum install gcc-c++
yum install gcc-gfortran
yum install readline-devel
yum install libXt-devel
yum -y install bzip2-devel

3 安装
在下载的解压文件夹中
./configure(./configure --prefix=指定路径/R --enable-R-shlib #设置工作路径)

cd 解压文件夹中
mkdir /home/aimin/software/R/
./configure --prefix=/home/aimin/software/R/ --enable-R-shlib

# 注意 configure 过程中如果有错误,会给出错误的提示,缺少什么就安装什么;

# 例如: configure: error: zlib library and headers are required
# yum -y install bzip2-devel

#  REF: https://unix.stackexchange.com/questions/343452/how-to-install-r-3-3-1-in-my-own-directory

make    ## Error: No targets specified and no makefile found
make install

4 测试

R