RStudio won't open with compiled R 3.5.0 on Linux Mint 18.3

All attempts to upgrade R to 3.5.0 on Linux Mint 18.3 didn't work as (perhaps) there was not this version in the CRAN repository and mirrors, I downloaded and installed 3.5.0 in a directory, and pointed RStudio to it via adding the line export RSTUDIO_WHICH_R=/usr/bin/R in ~/.profile, as advised in https://support.rstudio.com/hc/en-us/articles/200486138-Changing-R-versions-for-RStudio-desktop.

However, RStudio wouldn't use it, complaining:

R Not Found

R shared library (/usr/local/lib/R/lib/libR.so) not found. If this is a custom build of R, was it built with the --enable-R-shlib option?

How do I get RStudio to use this R 3.5.0?

How did you install R on your machine? Did you compile from sources, or obtain a binary from a repository?

If you built it from sources, you'll need to make sure you pass --enable-R-shlib when configuring R. See https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Configuration-options for some more details.

Hi Kevin,

I did everything as advertised but it wouldn’t change the R version — until today! perhaps something got stuck in a cache? Now RStudio is opening with 3.5.0. I swear these damn machines wait until help arrives, then correct themselves and pretend nothing was wrong. It’s crazy-making…. They only do it to annoy, and because they know it teases…. :disappointed_relieved:

Anyway, thanks for responding.

Stuart

Hi again,

Oops! I have to take back that last message. I’m working on two OS and got them confused. R updated to 3.5.0 on my iMac running OS X 10.11.6 and RStudio recognises and uses it on that machine, but not on my Linux laptop running Mint 18.3 — the latter is the problem.

My apologies! I have a lot of things on the go right now.

I downloaded 3.5.0 for Linux Ubuntu (Mint 18 is based on 16.04) and opened it into a directory in /home, then compiled it from that using the enable-R-shlib option. It installed into /usr/local/bin, so I added the export RSTUDIO_WHICH_R=/usr/local/bin/R line to ~/.profile as indicated in https://support.rstudio.com/hc/en-us/articles/200486138-Changing-R-versions-for-RStudio-desktop.

However, Although RStudio can be invoked both from the Applications Menu and the command line, neither will use R 3.5.0 but opens with R 3.4.4.

Sys.getenv("RSTUDIO_WHICH_R") returns /usr/bin/R, which is the location of 3.4.4, so I presume this is overriding the setting in ~.profile.

That seems to be the problem — can I change that?

Stuart

I'm surprised it doesn't work from the command line. What if you launch RStudio with something like:

RSTUDIO_WHICH_R=/path/to/R /usr/lib/rstudio/bin/rstudio

Note that RStudio doesn't read the ~/.profile, so setting RSTUDIO_WHICH_R within there won't help -- typically, you'll have to set this in an application launcher definition. I know GNOME has the notion of desktop entries; e.g.

https://help.gnome.org/admin//system-admin-guide/2.32/menustructure-desktopentry.html.en

I think you can set something like:

Exec=RSTUDIO_WHICH_R=/path/to/R /usr/lib/rstudio/bin/rstudio

Booting RStudio from the command line in Linux with:

RSTUDIO_WHICH_R=/usr/local/bin/R /usr/lib/rstudio/bin/rstudio

brings up the "R Not Found" notice:

  > R shared library (/usr/local/lib/R/lib/libR.so) not found.

If this is a custom build of R, was it built with the
--enable_r_shlib option?

  libR.so isn't there, but libRblas.so and libRlapack.so are there,

built yesterday when I recompiled R 3.5.0, so something must be
wrong with the compilation.

Stuart

Have you tried the normal instructions to update the version?
I did, but to no avail.

It used to work, dunno why not anymore.

Hi Mark,

Yes, I tried, but it wouldn’t update, which is why I compiled it locally. I can use R 3.5.0 outside of RStudio.

Stuart

I have exactly the same problem. The CRAN ubuntu/xenial repositories don't yet have the R files for 3.5.0. (Why? It has been several weeks since R 3.5.0 was released.) So I downloaded R-3.5.0.tar.gz from the CRAN/debian site. I was unable to install this using the Ubuntu software manager. (It kept wanting to reinstall 3.4.4). So I installed from source, using the INSTALL instructions (incluing the --enable-R-shlib option) after unzipping the tar file. The install went without problems (compile and install), and I can run R 3.5.0 from the command line. But RStudio can't find a needed file (/usr/local/lib/R/lib/libR.so), so I can't run R from RStudio. Exactly as stuzog found, libRblas.so and libRlapack.so are there, but not libR.so. So I'm stuck.

If anyone can tell me what I have to do to fix this, I'd appreciate learning how to fix this problem.

Larry Hunsicker

Hi Larry,

This might help you understand why: