在RHEL 7.5上安装R serve

时间:2018-08-06 14:39:05

标签: r rhel7

使用以下命令在RHEL 7.5(maipo)中安装R 3.4.1

wget https://cran.r-project.org/src/base/R-3/R-3.4.1.tar.gz
tar xvzf R-3.4.1.tar.gz
cd R-3.4.1
yum groupinstall "Development Tools"
yum install ncurses-devel zlib-devel texinfo gtk+-devel gtk2-devel qt-devel tcl-devel tk-devel kernel-headers kernel-devel readline-devel
yum install bzip2-devel
yum install xz xz-devel
yum -y install libcurl libcurl-devel
yum install java-1.8.0-openjdk-devel
yum install gsl-devel
yum install openssl-devel
yum install libcurl-devel
yum install pulseaudio-libs-devel
yum install python-devel
yum install glibc-static
yum install glibc-devel
yum install libbz2-dev
yum install zlib-devel glibc
./configure --enable-R-shlib --with-readline=no --with-x=no
make
make install

然后我尝试安装Rserve 通过install.packages(“ Rserve”) 报告如下

sha1.o standalone.o tls.o ulog.o utils.o websockets.o winembed.o -lssl -lcrypto -ldl -lcrypt -L/usr/local/lib64/R/lib -lR
/bin/ld: cannot find -lR
collect2: error: ld returned 1 exit status
make: *** [Rserve.so] Error 1
ERROR: compilation failed for package ‘Rserve’
* removing ‘/usr/local/lib64/R/library/Rserve’

有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

不是答案,但很想发表评论:

我尝试使用以下Docker文件重现此内容:

FROM centos:7.5.1804

RUN yum -y groupinstall "Development Tools" \
 && yum -y install ncurses-devel zlib-devel texinfo gtk+-devel gtk2-devel qt-devel \
                   tcl-devel tk-devel readline-devel bzip2-devel xz xz-devel \
                   libcurl libcurl-devel java-1.8.0-openjdk-devel gsl-devel \
                   openssl-devel libcurl-devel pulseaudio-libs-devel python-devel \
                   glibc-static glibc-devel libbz2-dev zlib-devel glibc

RUN yum -y install wget \
 && wget https://cran.r-project.org/src/base/R-3/R-3.4.1.tar.gz \
 && tar xvzf R-3.4.1.tar.gz \
 && cd R-3.4.1 \
 && ./configure --enable-R-shlib --with-readline=no --with-x=no \
 && make \
 && make install

RUN Rscript -e 'install.packages("Rserve", repo="https://cloud.r-project.org/")'

但是,为我创建了libR,并且构建了Docker映像也没有问题:

$ docker run --rm centos-r ls /usr/local/lib64/R/lib
libR.so
libRblas.so
libRlapack.so

一些其他想法:

  • 您确定使用了刚解压缩的源目录吗?
  • 您不能简单地使用EPEL提供的R包吗?
  • 按照RStudio中的安装说明进行操作:

    • 启用EPEL
    • yum-builddep R
    • ./configure --enable-R-shlib ...