Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r: error while loading shared libraries: libR.so: cannot open shared object file: No such file or directory #538

Open
ChillyMomo709 opened this issue Feb 6, 2024 · 1 comment

Comments

@ChillyMomo709
Copy link

ChillyMomo709 commented Feb 6, 2024

Hi all,

I got an issue with installing packages in rocker/rstudio:4.3.1

install2.r --deps NA --error --skipinstalled --ncpus -1 BiocManager rstudioapi remotes languageserver aws.s3 usethis
r: error while loading shared libraries: libR.so: cannot open shared object file: No such file or directory
ERROR: process "/bin/sh -c /install_scripts/setup_r.sh" did not complete successfully: exit code: 127

Dockerfile

FROM rocker/rstudio:4.3.1

ENV \
    # R repositories and versions \
    CRAN_REPO="https://packagemanager.posit.co/cran/__linux__/jammy/2024-02-01/" \
    BIOC_REPO="https://ftp.gwdg.de/pub/misc/bioconductor/" \
    BIOC_VERSION="3.18" \

COPY ./install_scripts/setup_r.sh /install_scripts/setup_r.sh
RUN /install_scripts/setup_r.sh

install_scripts/setup_r.sh

#!/bin/bash
# setup R and install Bioconductor

set -e # exit script on error (non-zero exit status)
set -x # print command trace
set -u # exit when undeclared variables are used

# build ARGs
NCPUS=${NCPUS:--1}

# set the RStudio Package Manager repositories for CRAN (overrides CRAN set
# by rocker) and bioconductor and increase download timeout
echo "options(repos = c(CRAN = '${CRAN_REPO}'), BioC_mirror = '${BIOC_REPO}',
      download.file.method = 'libcurl', timeout = 600)" >> \
          ${R_HOME}/etc/Rprofile.site

# update all base R packages
/usr/local/lib/R/site-library/littler/examples/update.r --ncpus ${NCPUS:--1}

# setup bioconductor
install2.r --deps "NA" --error --skipinstalled --ncpus ${NCPUS:--1} \
    BiocManager \
    rstudioapi \
    remotes \
    languageserver \
    aws.s3 \
    usethis
@YStrauchP4
Copy link

Hi!
I stumbled upon the same issue.
Judging from https://forum.posit.co/t/error-while-loading-shared-libraries-libr-so/101389/2, it appears the pre-compiled package provided by posit's CRAN didn't have the --enable-R-shlib flag set during compilation.

A quick workaround is to install from source, which works for me. I'm using specifically

install.packages('littler', repos='https://cran.r-project.org')

but I'm sure there are other, better ways to solve this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants