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