rig icon indicating copy to clipboard operation
rig copied to clipboard

Can work without root permission

Open ShixiangWang opened this issue 2 years ago • 10 comments

Hi,

Today I tried to install rim in a HPC without root permission. I found it require sudo to install R release. Could rim work for such case?

Best,

Shixiang

ShixiangWang avatar Apr 12 '22 10:04 ShixiangWang

I agree that this would be great, but unfortunately it is hard, because the Linux builds need to be in /opt. There is no easy way around this currently.

It is worth taking a look at relocating R, though, so I'll keep this open.

gaborcsardi avatar Apr 21 '22 06:04 gaborcsardi

Thanks. :)

Perhaps pull the R and its dependencies from conda ecosystem? I don't if this is easier. Just a thought.

ShixiangWang avatar Apr 21 '22 07:04 ShixiangWang

If you use conda, then you don't need rim, you can just do everything in conda. So we'll not use conda.

gaborcsardi avatar Apr 21 '22 07:04 gaborcsardi

Seems like we only need to rewrite a couple of files:

ubuntu@foo:/opt/R/devel$ ag /opt/R/devel
bin/R
4:R_HOME_DIR=/opt/R/devel/lib/R
5:if test "${R_HOME_DIR}" = "/opt/R/devel/lib/R"; then
19:     if [ -x "/opt/R/devel/${libnn}/R/bin/exec/R" ]; then
20:        R_HOME_DIR="/opt/R/devel/${libnn}/R"
21:     elif [ -x "/opt/R/devel/${libnn_fallback}/R/bin/exec/R" ]; then
22:        R_HOME_DIR="/opt/R/devel/${libnn_fallback}/R"
35:R_SHARE_DIR=/opt/R/devel/lib/R/share
37:R_INCLUDE_DIR=/opt/R/devel/lib/R/include
39:R_DOC_DIR=/opt/R/devel/lib/R/doc

lib/R/bin/R
4:R_HOME_DIR=/opt/R/devel/lib/R
5:if test "${R_HOME_DIR}" = "/opt/R/devel/lib/R"; then
19:     if [ -x "/opt/R/devel/${libnn}/R/bin/exec/R" ]; then
20:        R_HOME_DIR="/opt/R/devel/${libnn}/R"
21:     elif [ -x "/opt/R/devel/${libnn_fallback}/R/bin/exec/R" ]; then
22:        R_HOME_DIR="/opt/R/devel/${libnn_fallback}/R"
35:R_SHARE_DIR=/opt/R/devel/lib/R/share
37:R_INCLUDE_DIR=/opt/R/devel/lib/R/include
39:R_DOC_DIR=/opt/R/devel/lib/R/doc

lib/R/etc/Makeconf
7:# configure  '--prefix=/opt/R/devel' '--enable-R-shlib' '--with-tcltk' '--enable-memory-profiling' '--with-x' '--with-blas' '--with-lapack' 'R_PRINTCMD=/usr/bin/lpr' 'R_PAPERSIZE=letter' 'R_BROWSER=xdg-open' 'R_PDFVIEWER=xdg-open' 'LIBnn=lib'

lib/pkgconfig/libR.pc
1:rhome=/opt/R/devel/lib/R
3:rincludedir=/opt/R/devel/lib/R/include

gaborcsardi avatar Apr 21 '22 09:04 gaborcsardi

Hi, is this feature available now?

h4rvey-g avatar Oct 24 '23 08:10 h4rvey-g

Would like an update on this as well. I also need to install R releases without root permission.

nathan-nguyen-sa avatar Nov 20 '23 19:11 nathan-nguyen-sa

Hey there, would like to add that this would be a great feature for those of us working in HPC or multi-user server environments where it's desirable to have users manage their own R installations. Similar to what's possible with pyenv.

groverj3 avatar Feb 09 '24 19:02 groverj3

To clarify.

  • We could relatively easily implement the use case where admin installs various R versions, and each user can set their own default.
  • It is much harder to implement the use case where users install their own R installations, because our R builds are not self-contained and they are not relocatable. I.e. they require a bunch of system packages, and they have to live in /opt.

gaborcsardi avatar Feb 09 '24 22:02 gaborcsardi

To clarify.

  • We could relatively easily implement the use case where admin installs various R versions, and each user can set their own default.
  • It is much harder to implement the use case where users install their own R installations, because our R builds are not self-contained and they are not relocatable. I.e. they require a bunch of system packages, and they have to live in /opt.

This makes sense. Of course, I respect the work that has already gone into this! Even just having the first scenario as a viable option would be a fantastic enhancement. I don't know how many people care, but there are at least a few of us.

groverj3 avatar Feb 10 '24 00:02 groverj3

For those who struggle to install R without root permission, docker would be a good option, e.g. Rocker project

h4rvey-g avatar Feb 10 '24 01:02 h4rvey-g