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 installed in home dir breaks Singularity containers #43

Open
varshini712 opened this issue Mar 3, 2020 · 2 comments
Open

R installed in home dir breaks Singularity containers #43

varshini712 opened this issue Mar 3, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@varshini712
Copy link
Collaborator

We recently had errors with the deconstructSigs Singularity container deconstructSigs-1.8.0.simg:

Loading required package: GenomicRanges
Error: package or namespace load failed for ‘GenomicRanges’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 namespace ‘XVector’ 0.18.0 is being loaded, but >= 0.19.8 is required
Error: package ‘GenomicRanges’ could not be loaded
Execution halted

It turns out that R was discovering two installations of the XVector library:

> installed.packages()[c(41, 117),]
        Package   LibPath
XVector "XVector" "/gpfs/home/vasudv02/R/x86_64-pc-linux-gnu-library/3.4"
XVector "XVector" "/conda/lib/R/library"
        Version  Priority
XVector "0.18.0" NA
XVector "0.20.0" NA
        Depends
XVector "R (>= 2.8.0), methods, BiocGenerics (>= 0.19.2), S4Vectors (>=\n0.15.14), IRanges (>= 2.9.18)"
XVector "R (>= 2.8.0), methods, BiocGenerics (>= 0.19.2), S4Vectors (>=\n0.17.24), IRanges (>= 2.13.16)"
        Imports
XVector "methods, zlibbioc, BiocGenerics, S4Vectors, IRanges"
XVector "methods, utils, zlibbioc, BiocGenerics, S4Vectors, IRanges"
        LinkingTo            Suggests                              Enhances
XVector "S4Vectors, IRanges" "Biostrings, drosophila2probe, RUnit" NA
XVector "S4Vectors, IRanges" "Biostrings, drosophila2probe, RUnit" NA
        License        License_is_FOSS License_restricts_use OS_type MD5sum
XVector "Artistic-2.0" NA              NA                    NA      NA
XVector "Artistic-2.0" NA              NA                    NA      NA
        NeedsCompilation Built
XVector "yes"            "3.4.2"
XVector "yes"            "3.4.1"

The version 0.18.0 of the library was in the user home directory /gpfs/home/vasudv02/R/x86_64-pc-linux-gnu-library/3.4. This conflicted with the conda-installed version 0.20.0 that was meant to be used inside the container, causing the error shown.

The solution in this case was to remove the user installation directory for R. However, it is expected that any user with an R installation that happens to coincide with the version of R inside the container might end up with the same problem. We need to figure out a way to prevent user home directory R installed libraries from being used inside Singularity containers. Note that by default, Singularity mounts the user's home directory inside the container, and by default R will look for libraries in the user home directory. So we might need to figure out if its possible to disable this feature or find some other work-around.

@varshini712 varshini712 added the bug Something isn't working label Mar 3, 2020
@stevekm
Copy link
Member

stevekm commented Mar 3, 2020

There might be some R environment variables that you could set in order to prevent it from picking up the user home dir for libraries. However that would require rebuilding the images which is also having issues.

@stevekm
Copy link
Member

stevekm commented Mar 3, 2020

There are some commands you can use within R to dictate where libraries get loaded from but I'm not sure if those changes are permanent, they might just be for that single R session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants