[R] make install libgfortran.so.5: cannot open shared object file: No such file or directory; conftest.c:1:10: fatal error: jni.h: No such file or directory

Rob Kudyba rk3199 @end|ng |rom co|umb|@@edu
Fri Nov 18 22:45:14 CET 2022


On RHEL 8 with GCC 11.2.0 loaded as a module in a non-standard location I'm
the below error with make install. libgfortran.so is definitely in
$LD_LIBRARY_PATH, i.e., /path/to/gcc-11.2/lib64

ls -l /path/to/gcc-11.2/lib64/*fortran.so*
lrwxrwxrwx 1 rk3199 user        20 Mar 24  2022 libgfortran.so ->
libgfortran.so.5.0.0
lrwxrwxrwx 1 rk3199 user        20 Mar 24  2022 libgfortran.so.5 ->
libgfortran.so.5.0.0
-rwxr-xr-x 1 rk3199 user   8595744 Mar 24  2022 libgfortran.so.5.0.0
Here is where the error occurs in make install:
[...]
installing packages ...
  building HTML index ...
/path/to/R-4.2.2/bin/exec/R: error while loading shared libraries:
libgfortran.so.5: cannot open shared object file: No such file or directory
make[2]: *** [install] Error 127
make[2]: Leaving directory `/path/to/R-4.2.2/src/library'
make[1]: *** [install] Error 1
make[1]: Leaving directory `/path/to/rk3199/R-4.2.2/src'
make: *** [install] Error 1


During make I see this error with Java:
configuring Java ...
Java interpreter : /usr/bin/java
Java version     : 1.8.0_161
Java home path   :
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-2.b14.el7.x86_64/jre
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/amd64/server -ljvm
make[2]: Entering directory `/tmp/Rjavareconf.3sImDz'
gcc -I"/path/to/R-4.2.2/include" -DNDEBUG   -I/usr/local/include   -fpic
 -O3 -march=native -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]: *** [conftest.o] Error 1
make[2]: Leaving directory `/tmp/Rjavareconf.3sImDz'
Unable to compile a JNI program

JAVA_HOME        :
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-2.b14.el7.x86_64/jre
Java library path:
JNI cpp flags    :
JNI linker flags :
Updating Java configuration in /path/to/R-4.2.2
Done.

That seems a little more straight forward in that our Java 1.7.0 nor 1.8.0
have a jni.h file. Looks like we'd need the devel package installed.

Thanks for any suggestions for the former.

	[[alternative HTML version deleted]]



More information about the R-help mailing list