HenrikBengtsson / CBI-software

A Scientific Software Stack for HPC (CentOS oriented)
https://wynton.ucsf.edu/hpc/software/software-repositories.html
5 stars 2 forks source link

R: Find a more stable JAVA_HOME path #58

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 2 years ago

Find a more stable JAVA_HOME path, i.e. the path with the least version resolution.

HenrikBengtsson commented 2 years ago

Here's an example of the problem:

$ module load r/3.6.3
$ R CMD config --all | grep JAVA
JAVA = /usr/bin/java
JAVAC = /usr/bin/javac
JAVAH = /usr/bin/javah
JAVA_HOME = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre
JAVA_LIBS = -L/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/lib/amd64/server -ljvm
JAVA_CPPFLAGS = -I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/../include -I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/../include/linux

but because Java 1.8.0 has been upgraded since, that JAVA_HOME is non-existing:

$ ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre
ls: cannot access /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre: No such file or directory

Same for R 4.1.0-4.1.2.

However, it seems to have been fixed form 4.1.3:

$ module load CBI r/4.1.3
R CMD config --all | grep JAVA
JAVA = /usr/lib/jvm/java-1.8.0/jre/bin/java
JAVAC = /usr/lib/jvm/java-1.8.0/bin/javac
JAVAH = /usr/lib/jvm/java-1.8.0/bin/javah
JAVA_HOME = /usr/lib/jvm/java-1.8.0
JAVA_LIBS = -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm
JAVA_CPPFLAGS = -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux
HenrikBengtsson commented 2 years ago

Oh, it was fixed in commit f82d1e37 after bringing up the same question in Issue #31. So, already solved.