1、yum install -y  readline-devel  gcc*  libXt-devel   openssl*
2、下载编译安装zlib
   wget http://ncu.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
   tar -zxvf zlib-1.2.8.tar.gz
   cd zlib-1.2.8
   ./configure --prefix=/opt/zlib-1.2.8
   make && make install
    在/etc/profile文件中添加:
    LIBRARY_PATH=/usr/local/zlib/lib/:$LIBRARY_PATH
    export  LIBRARY_PATH
    LD_LIBRARY_PATH=/usr/local/zlib/lib/:$LD_LIBRARY_PATH
    export  LD_LIBRARY_PATH
    C_INCLUDE_PATH=/usr/local/zlib/include/:$C_INCLUDE_PATH
    export C_INCLUDE_PATH
3、下载编译安装bzip2
   wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
   tar -zxvf bzip2-1.0.6.tar.gz
   cd bzip2-1.0.6
   make -f Makefile-libbz2_so
   make clean
   make
   make install PREFIX=/opt/bzip2-1.0.6
   在/etc/profile文件中添加: export PATH=/opt/bzip2-1.0.6/bin:$PATH
4、下载编译安装xz
   wget http://tukaani.org/xz/xz-5.2.2.tar.gz
   tar xzvf xz-5.2.2.tar.gz
   cd xz-5.2.2
   ./configure --prefix=/opt/xz-5.2.2
   make -j3 & make install
5、下载编译安装pcre
   wget http://fossies.org/linux/misc/pcre-8.39.tar.gz
   tar -zxvf pcre-8.39.tar.gz
   cd pcre-8.39
   ./configure --prefix=/opt/pcre-8.39 --enable-utf8
   make & make instal
6、下载编译安装curl
   wget https://curl.haxx.se/download/curl-7.51.0.tar.gz
   tar zxvf curl-7.51.0.tar.gz
   cd curl-7.51.0
   ./configure --prefix=/opt/curl-7.51.0
   make && make install
   
   export PATH=/opt/curl-7.51.0/bin:$PATH
   export PATH=/opt/R/bin:$PATH
   source /etc/profile

7、更新链接lib库和PATH路径
    echo /opt/xz-5.2.2/lib >> /etc/ld.so.conf
    echo /opt/pcre-8.39/lib >> /etc/ld.so.conf
    echo "export LD_LIBRARY_PATH=/opt/curl-7.51.0/lib:$LD_LIBRARY_PATH">> /root/.bashrc
    source /root/.bashrc
    
8、安装R程序
    wget  https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/base/R-3/R-3.3.2.tar.gz
    tar -zxvf R-3.3.1.tar.gz
    cd R-3.3.1
    ./configure --enable-R-shlib --prefix=/opt/R --with-x=no   LDFLAGS="-L/opt/zlib-1.2.8/lib -L/opt/bzip2-1.0.6/lib -L/opt/xz-5.2.2/lib  -L/opt/pcre-8.39/lib -L/opt/curl-7.51.0/lib" CPPFLAGS="-I/opt/zlib-1.2.8/include -I/opt/bzip2-1.0.6/include -I/opt/xz-5.2.2/include -I/opt/pcre-8.39/include -I/opt/curl-7.51.0/include"
    ldconfig
    mv  /opt/bzip2-1.0.6/lib/libbz2.a   /tmp
    make
    mv  /tmp/libbz2.a                  /opt/bzip2-1.0.6/lib
    make     install