error while loading shared libraries: libR.so

Hi,

I installed RStudio server on a CentOS7 machine with R using precompiled version provided by RStudio. Originally I ried installing R from source, but then found the precompiled version (R-4.0.3-1-1.x86_64) which I installed. R is working and I have packages installed (including tidiverse)

However, I cannot get the server to work because unfortunately, when running the following command I get an error

> sudo rstudio-server verify-installation
/usr/lib/rstudio-server/bin/rsession: error while loading shared libraries: libR.so: cannot open shared object file: No such file or directory

I have spent hours trying to figure out what's wrong, but all the options I see are related to the source version which needs to be compiled (i.e. --enable-R-shlib which I don't have as an option when using precompiled)

This is not helping...

I really don't know how to fix this. I reinstalled the server but the problem stays, it seems I just dont have this shared library...

PJ

I would try compiling R from source, with ./configure --enable-R-shlib, I have never used RHEL based Linux distributions but in case it helps, these would be the steps for Debian based OS'.

sudo apt-get install -y gfortran libreadline6-dev libx11-dev libxt-dev \
                               libpng-dev libjpeg-dev libcairo2-dev xvfb \
                               libbz2-dev libzstd-dev liblzma-dev \
                               libcurl4-openssl-dev \
                               texinfo texlive texlive-fonts-extra \
                               screen wget libpcre2-dev
cd /usr/local/src
sudo wget https://cran.rstudio.com/src/base/R-4/R-4.0.5.tar.gz
sudo su
tar zxvf R-4.0.3.tar.gz
cd R-4.0.5
./configure --enable-R-shlib #--with-blas --with-lapack
make
make install
cd ..
rm -rf R-4.0.5*
exit
cd

Hi,

Thanks for the quick reply
I have tried this but I'm on CentOS7 and trying to install R from source did not work unfortunately.

I have installed it successfully on another similar machine and it's working perfectly, but somehow I did mess things up I can't get this to work anymore regardless of un- or reinstalling so I suspect that somewhere a setting got messed up ...

Hopefully someone else has some more ideas...

PJ

It should work since R is compatible with RHEL, maybe if you share the specific error message you get someone could figure out what the problem is.

Hi,

Yea the only message I get is the one you can see in my first post. Unfortunately, the path to the missing library file (libR.so) is not set, so I have no clue how to start fixing this. There is a libR.so file in my standard R library (/opt/R/4.0.2/lib/R/lib) but that does not seem to be enough...

Thanks again for thinking out loud and trying to give tips

PJ

Maybe I misunderstood your previous comment, just to clarify, do you have successfully compiled R from source with the --enable-R-shlib option and RStudio Server still doesn't work?

Hi,

Yes I did manage to compile the latest version with --enable-R-shlib and still no luck ...

Do you change LD_LIBRARY_PATH in your profile scripts? Can you try with rsession-no-profile=1 ​ in rserver.conf ?

Hi,

Thanks for the tip, but unfortunately it's giving me an error again:

> sudo rstudio-server verify-installation
Error reading /etc/rstudio/rserver.conf: unrecognised option 'rsession-no-profile'

conf file

# Server Configuration File

rsession-no-profile=1
rsession-which-r=/opt/R/4.0.5/

PJ

That is surprising. Which version of RStudio Server Pro are you using?

Hi,

I'm not using the pro version, just the basic one. Sorry for the confusion...

PJ

Ok. That explains the error message. So we have viewer tools to work with ...

So your R version is installed in /opt/R/4.0.5/. I assume that /opt/R/4.0.5/lib/R/lib/libR.so exists. What is the output of

ldd /opt/R/4.0.5/lib/R/lib/libR.so

? Are there any missing libraries?

Hi,

It is complicated, since I have installed multiple versions of R in different ways to try and solve this issue.

R 4.0.5 - installed by compiling from source

> ldd /opt/R/4.0.5/lib/R/lib/libR.so
ldd: /opt/R/4.0.5/lib/R/lib/libR.so: No such file or directory

> ls /opt/R/4.0.5
bin  lib64  share

> ldd /opt/R/4.0.5/lib64/R/lib/libR.so
        linux-vdso.so.1 =>  (0x00007ffee34d8000)
        libRblas.so => /usr/lib64/R/lib/libRblas.so (0x00007f33ee37a000)
        libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f33ee058000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f33edd56000)
        libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f33edb1a000)
        libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f33ed8a3000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f33ed67d000)
        libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f33ed46d000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f33ed257000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f33ed04f000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f33ece4b000)
        libicuuc.so.50 => /lib64/libicuuc.so.50 (0x00007f33ecad2000)
        libicui18n.so.50 => /lib64/libicui18n.so.50 (0x00007f33ec6d3000)
        libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f33ec4ad000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f33ec291000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f33ebec3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f33f0f07000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f33ebcad000)
        libicudata.so.50 => /lib64/libicudata.so.50 (0x00007f33ea6da000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f33ea3d2000)

R 4.0.3 - installed from precompiled version

> ldd /opt/R/4.0.3/lib/R/lib/libR.so
        linux-vdso.so.1 =>  (0x00007ffe45f93000)
        libRblas.so => /usr/lib64/R/lib/libRblas.so (0x00007f8ff4602000)
        libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f8ff42e0000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f8ff3fde000)
        libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f8ff3da2000)
        libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f8ff3b5c000)
        libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f8ff38e5000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f8ff36bf000)
        libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f8ff34af000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f8ff3299000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f8ff3091000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f8ff2e8d000)
        libicuuc.so.50 => /lib64/libicuuc.so.50 (0x00007f8ff2b14000)
        libicui18n.so.50 => /lib64/libicui18n.so.50 (0x00007f8ff2715000)
        libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f8ff24ef000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8ff22d3000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f8ff1f05000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f8ff7191000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8ff1cef000)
        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f8ff1ac5000)
        libicudata.so.50 => /lib64/libicudata.so.50 (0x00007f8ff04f2000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8ff01ea000)

I tried setting either version as the standard one in the Server Configuration File though I get the same message...

PJ

How are you actually enabling these different R versions? Above you mentioned rsession-which-r=/opt/R/4.0.5/ in rserver.conf. Have you tried setting that variable to full path of the actual R binary, i.e. something like /opt/R/4.0.5/lib64/R/bin/R? Or to add the right R to the front of the PATH?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.