wget https://mirror.lzu.edu.cn/CRAN/src/base/R-4/R-4.1.0.tar.gz
tar -zxvf R-4.1.0.tar.gz
cd R-4.1.0
./configure --prefix=/opt/R-4.1.0 --enable-R-shlib
make
make install
(1)报错:configure: error: --with-readline=yes (default) and headers/libs are not available
错误描述:–with-readline=yes(默认)和头文件/库不可用
解决办法:安装头文件和库,记得连续选中Y,否则该错误无法避免
yum install readline-devel
(2)报错:configure: error: --with-x=yes (default) and X11 headers/libs are not available
解决办法:安装头文件和库,记得连续选中Y,否则该错误无法避免
yum install libXt-devel
(3)报错:configure: error: zlib library and headers are required
错误描述:需要zlib库
原因:缺少zlib或者zlib版本过低 a.查找系统是否存在zlib
find / -name zlib
b.解决办法:安装编译zlib
wget http://www.zlib.net/fossils/zlib-1.2.8.tar.gz
tar xzvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/opt/packages
make && make install
(7)报错:configure: error: libcurl >= 7.28.0 library and headers are required with support for https ##需要安装curl
yum install openssl* ##需要支持ssl服务
cd /opt
wget https://curl.se/download/curl-7.47.1.tar.gz
tar zxvf curl-*
./configure --prefix=/opt/curl
make
make install
要在环境变量中加上curl的bin路径 (8) 报错:onfigure: error: libcurl >= 7.28.0 library and headers are required with support for https
wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1u.tar.gz
./config --prefix=/opt/openssl
make
make install
添加到环境变量 Centos7.6最终执行:
./configure --prefix=/opt/R --enable-R-shlib --with-pcre1
make
make install
Centos7.9最终执行:
编译时候缺失一个依赖,在安装时进行指定
./configure --prefix=/opt/R --enable-R-shlib --with-pcre1 LDFLAGS="-L/opt/zlib-1.2.8/lib"
make
make install