Git Product home page Git Product logo

Comments (6)

gaborcsardi avatar gaborcsardi commented on August 22, 2024 1

Yes, #66 is basically what you want, multiple user libraries for the same R version. We'll have that soon.

from rig.

lazappi avatar lazappi commented on August 22, 2024 1

I have only started using it but works perfectly so far (I like the menu bar app as well) 🎉! Thanks for working on this so quickly.

from rig.

gaborcsardi avatar gaborcsardi commented on August 22, 2024

Unfortunately it is not that simple, because all shared libraries are hard-wired to link to the original installation:

❯ otool -L /Library/Frameworks/R.framework/Versions/4.1/Resources/library/stats/libs/stats.so
/Library/Frameworks/R.framework/Versions/4.1/Resources/library/stats/libs/stats.so:
	stats.so (compatibility version 0.0.0, current version 0.0.0)
	/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib (compatibility version 4.1.0, current version 4.1.3)
	/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib (compatibility version 0.0.0, current version 0.0.0)
	/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0)
	/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
	/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libR.dylib (compatibility version 4.1.0, current version 4.1.3)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1673.126.0)

This is even true for non-base CRAN packages:

❯ R-4.1 -q -e '.libPaths()[1]'
> .libPaths()[1]
[1] "/Users/gaborcsardi/Library/R/x86_64/4.1/library"

❯ otool -L /Users/gaborcsardi/Library/R/x86_64/4.1/library/filelock/libs/filelock.so
/Users/gaborcsardi/Library/R/x86_64/4.1/library/filelock/libs/filelock.so:
	filelock.so (compatibility version 0.0.0, current version 0.0.0)
	/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libR.dylib (compatibility version 4.1.0, current version 4.1.2)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1853.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

So you would need to modify these paths using install_name_tool for every shared lib in base R, and then also after every single package installation.

OTOH, you don't need two separate R installations if the only difference is in the user package libraries. You can modify R_LIBS_USER in .Renviron to switch between two user libraries.

from rig.

lazappi avatar lazappi commented on August 22, 2024

Thanks, I would not have worked that out! I know that you can use .Renviron but I have found that to be more work in the past, particularly when using RStudio. I had a similar setup with two R installations that worked fine with the rswitch tool. I was hoping to be able to do the same thing here but maybe the extra things you have built around the installation make that impossible and I should just go back to what I had before.

from rig.

gaborcsardi avatar gaborcsardi commented on August 22, 2024

FYI: the pre-release at https://github.com/r-lib/rig/releases/tag/v0.3.1pre now supports multiple libraries and switching between them. This is currently an experimental feature and it might change in the future. Feedback is welcome.

from rig.

gaborcsardi avatar gaborcsardi commented on August 22, 2024

I am going to close this now. If we need more features related to this we'll create new issues.

from rig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.