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?

I was working for weeks in the latest Rstudio running on the latest R base 4.2.1 on Linux Mint 20.0 Ulyana (Ubuntu Focal) all updated, during those weeks I occasionally rebooted the system and all was good. Yesterday the power went down and I booted back on R would give me this R not found window: "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?"

mint@harwester:~$ whereis libR.so
libR: /usr/lib/libR.so

There are several identical topics discussed and closed already on https://community.rstudio.com/, however, none of the solutions helped me so far, perhaps I'm just overlooking something. I guess force move libR.so will just create yet another problem. And as of was R built with the --enable-R-shlib option? I don't know, can it just be overwritten to enable it?

Probably the easiest way to address this is uninstall and reinstall R

No, it's not that easy. I simply copy paste the libR.so into R shared library, but still can't run R:

R Session Startup Failure Report

RStudio Version

RStudio 2022.07.2+576, "Spotted Wakerobin" (e7373ef8, 2022-09-06) for Ubuntu Bionic

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

Error message

[No error available]

Process Output

The R session exited with code 2.

Error output:

unable to initialize the JIT


Standard output:

[No output emitted]

Logs

/home/mint/.local/share/rstudio/log/rsession-mint.log

2022-09-30T18:34:42.787742Z [rsession-mint] ERROR R SUICIDE: unable to initialize the JIT; LOGGED FROM: void {anonymous}::rSuicide(const string&) src/cpp/session/SessionMain.cpp:1237
2022-09-30T18:46:05.581321Z [rsession-mint] ERROR R SUICIDE: unable to initialize the JIT; LOGGED FROM: void {anonymous}::rSuicide(const string&) src/cpp/session/SessionMain.cpp:1237
2022-09-30T18:46:05.581321Z [rsession-mint] ERROR R SUICIDE: unable to initialize the JIT; LOGGED FROM: void {anonymous}::rSuicide(const string&) src/cpp/session/SessionMain.cpp:1237

and when trying to reinstall R and do make after extracting the tarball I get this:

make[1]: Entering directory '/home/mint/R-4.2.1'
configuring Java ...
Java interpreter : /usr/bin/java
Java version : 11.0.16
Java home path : /usr/lib/jvm/java-11-openjdk-amd64
Java compiler : not present
Java headers gen.:
Java archive tool:

trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.t7k24u'
gcc -I"/home/mint/R-4.2.1/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
1 | #include <jni.h>
| ^~~~~~~
compilation terminated.
make[2]: *** [/home/mint/R-4.2.1/etc/Makeconf:168: conftest.o] Error 1
make[2]: Leaving directory '/tmp/Rjavareconf.t7k24u'
Unable to compile a JNI program

JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /home/mint/R-4.2.1
Done.

make[1]: Leaving directory '/home/mint/R-4.2.1'

after installing

$ sudo apt install default-jdk

i can completely remove and successfully reinstall R base 4.2.1 from tarball and as instructed by r-project.org, but I still get the same unable to initialize the JIT error even though I uninstalled and reinstalled also the Rstudio too. Resetting RStudio desktop's state as described here didn't help either.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.