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: rJava::.jinit() stalls when installed with gcc 11.2.1 #61

Closed HenrikBengtsson closed 7 months ago

HenrikBengtsson commented 2 years ago

Issue

The following call stalls on C4:

> res <- rJava::.jinit()

but it works on Wynton.

Troubleshooting

It happens in the following step:

debug: xr <- .External(RinitJVM, boot.classpath, parameters)
Browse[2]> 

Session infos

C4

[henrik@c4-dev1 r]$ module show openjdk/1.8.0
-------------------------------------------------------------------------------------------------
   /etc/modulefiles/openjdk/1.8.0.lua:
-------------------------------------------------------------------------------------------------
help([[openjdk: Open Java Development Kit
]])
whatis("Version: 1.8.0")
whatis("Keywords: programming, java")
whatis("URL: https://openjdk.java.net/")
whatis("Description: OpenJDK is a free and open-source implementation of the Java Platform, Standard 
Edition. It is the result of an effort Sun Microsystems began in 2006. Examples: `java -version` and 
`javac -version`.")
setenv("JAVA_HOME","/usr/lib/jvm/java-1.8.0")
prepend_path("PATH","/usr/lib/jvm/java-1.8.0/bin")
prepend_path("LD_LIBRARY_PATH","/usr/lib/jvm/java-1.8.0/lib")
prepend_path("CPATH","/usr/lib/jvm/java-1.8.0/include")

[henrik@c4-dev1 r]$ java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)

[henrik@c4-dev1 r]$ javac -version
javac 1.8.0_322

[henrik@c4-dev1 r]$ command -v java javac
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/java-1.8.0/bin/javac

[henrik@c4-dev1 r]$ 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

Wynton

module show openjdk/1.8.0
-------------------------------------------------------------------------------------------------
   /etc/modulefiles/openjdk/1.8.0.lua:
-------------------------------------------------------------------------------------------------
help([[openjdk: Open Java Development Kit]])
whatis("Version: 1.8.0")
whatis("Keywords: programming, java")
whatis("URL: https://openjdk.java.net/, https://openjdk.java.net/projects/jdk/ (changelog), https://g
ithub.com/openjdk/jdk (source code)")
whatis("Description: OpenJDK is a free and open-source implementation of the Java Platform, Standard 
Edition. It is the result of an effort Sun M\
icrosystems began in 2006.
Examples: `java -version` and `javac -version` (SDK only).
Note: This module loads the Software Development Kit (SDK) version, if available, otherwise the Run-T
ime Environment (JRE).
")
setenv("JAVA_HOME","/usr/lib/jvm/java-1.8.0")
prepend_path("PATH","/usr/lib/jvm/java-1.8.0/bin")
prepend_path("LD_LIBRARY_PATH","/usr/lib/jvm/java-1.8.0/lib")
prepend_path("CPATH","/usr/lib/jvm/java-1.8.0/include")

$ java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)

$ javac -version
javac 1.8.0_322

$ command -v java javac
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/java-1.8.0/bin/javac

$ 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

Weird. when installing R to ~/software/cbi/software/ and then rJava, it works in both versions. But, when installing R to /software/c4/cbi/software/ and then rJava, it stalls with that R installation, but when used with R in ~/software/cbi/software/.

rJava installed with ~/software/cbi/software/R-4.2.0-gcc11

$ module load CBI CBI-prototype r/4.2.0-gcc11
$ R
> R.home()
[1] "/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R"
> install.packages("rJava")
Installing package into '/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11'
(as 'lib' is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rJava_1.0-6.tar.gz'
Content type 'application/x-gzip' length 1047062 bytes (1022 KB)
==================================================
downloaded 1022 KB

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/lib/jvm/java-1.8.0/jre/bin/java'
archiver    : '/usr/lib/jvm/java-1.8.0/bin/jar'
compiler    : '/usr/lib/jvm/java-1.8.0/bin/javac'
header prep.: '/usr/lib/jvm/java-1.8.0/bin/javah'
cpp flags   : '-I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux'
java libs   : '-L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... yes
checking whether -Xrs is supported... yes
checking whether -Xrs will be used... yes
checking whether JVM will be loaded dynamically... no
checking whether JNI programs can be compiled... yes
checking whether JNI programs run... yes
checking JNI data types... ok
checking whether JRI should be compiled (autodetect)... yes
checking whether debugging output should be enabled... no
checking whether memory profiling is desired... no
checking whether threads support is requested... no
checking whether callbacks support is requested... no
checking whether JNI cache support is requested... no
checking whether JRI is requested... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/zzz.R
config.status: creating src/config.h
=== configuring in jri (/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for sys/select.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for sys/select.h... yes
checking Java version... 1.8.0_322
checking Java compatibility version (integer)... 8
checking whether /usr/lib/jvm/java-1.8.0/bin/javah actually works... yes
checking for target flags...  -target 1.4 -source 1.4
checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
checking whether JNI programs can be run... yes
checking JNI data types... ok
checking whether Rinterface.h exports R_CStackXXX variables... yes
checking whether Rinterface.h exports R_SignalHandlers... yes
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating run
config.status: creating src/config.h
** libs
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c Rglue.c -o Rglue.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c arrayc.c -o arrayc.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c callJNI.c -o callJNI.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c callback.c -o callback.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c fields.c -o fields.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c init.c -o init.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c jri_glue.c -o jri_glue.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c loader.c -o loader.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c otables.c -o otables.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c rJava.c -o rJava.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c registration.c -o registration.o
gcc -I"/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c tools.c -o tools.o
gcc -shared -L/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/lib -L/software/c4/cbi/software/gdal-2.4.4/lib -L/software/c4/cbi/software/geos-3.9.1/lib -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o registration.o tools.o -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -L/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/lib -lR
(cd ../jri && make)
make[1]: Entering directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri'
make -C src JRI.jar
make[2]: Entering directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri/src'
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
if [ -n "/usr/lib/jvm/java-1.8.0/bin/javah" ]; then /usr/lib/jvm/java-1.8.0/bin/javah -d . -classpath . org.rosuda.JRI.Rengine; fi
gcc -c -o Rengine.o Rengine.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o Rinit.o Rinit.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
gcc -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
gcc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o  -shared -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/software/c4/cbi/software/gdal-2.4.4/lib -L/software/c4/cbi/software/geos-3.9.1/lib -L/c4/home/henrik/software/cbi/software/R-4.2.0-gcc11/lib64/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n 
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
/usr/lib/jvm/java-1.8.0/bin/jar fc JRI.jar org libjri.so
make[2]: Leaving directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri/src'
rm -f libjri.so
cp src/libjri.so libjri.so
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
make[1]: Leaving directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri'
installing via 'install.libs.R' to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11/00LOCK-rJava/00new/rJava
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location

** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rJava)

The downloaded source packages are in
        '/scratch/henrik/RtmpAk9J0N/downloaded_packages'
> res <- rJava:::.jinit()
TRACKER: Options added: [n=1] 'java.parameters'.
TRACKER: loadedNamespaces() changed: 2 packages loaded ('crayon', 'rJava')
> 

CBI r/4.2.0-gcc11

$ module unload CBI-prototype
$ module load CBI r/4.2.0-gcc11
$ R
> R.home()
[1] "/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R"
> res <- rJava:::.jinit()
TRACKER: Environment variables changed: [n=2] 'COLUMNS', 'LINES'.
TRACKER: Options added: [n=1] 'java.parameters'.
TRACKER: loadedNamespaces() changed: 2 packages loaded ('crayon', 'rJava')

rJava installed with /software/c4/cbi/software/R-4.2.0-gcc11

$ module unload CBI-prototype
$ module load CBI r/4.2.0-gcc11
$ R
> R.home()
[1] "/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R"
> install.packages("rJava")
Installing package into '/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11-sandbox'
(as 'lib' is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rJava_1.0-6.tar.gz'
Content type 'application/x-gzip' length 1047062 bytes (1022 KB)
==================================================
downloaded 1022 KB

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/lib/jvm/java-1.8.0/jre/bin/java'
archiver    : '/usr/lib/jvm/java-1.8.0/bin/jar'
compiler    : '/usr/lib/jvm/java-1.8.0/bin/javac'
header prep.: '/usr/lib/jvm/java-1.8.0/bin/javah'
cpp flags   : '-I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux'
java libs   : '-L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... yes
checking whether -Xrs is supported... yes
checking whether -Xrs will be used... yes
checking whether JVM will be loaded dynamically... no
checking whether JNI programs can be compiled... yes
checking whether JNI programs run... yes
checking JNI data types... ok
checking whether JRI should be compiled (autodetect)... yes
checking whether debugging output should be enabled... no
checking whether memory profiling is desired... no
checking whether threads support is requested... no
checking whether callbacks support is requested... no
checking whether JNI cache support is requested... no
checking whether headless init is enabled... no
checking whether JRI is requested... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/zzz.R
config.status: creating src/config.h
=== configuring in jri (/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for sys/select.h... yes
checking Java version... 1.8.0_322
checking Java compatibility version (integer)... 8
checking whether /usr/lib/jvm/java-1.8.0/bin/javah actually works... yes
checking for target flags...  -target 1.4 -source 1.4
checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
checking whether JNI programs can be run... yes
checking JNI data types... ok
checking whether Rinterface.h exports R_CStackXXX variables... yes
checking whether Rinterface.h exports R_SignalHandlers... yes
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating run
config.status: creating src/config.h
** libs
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c Rglue.c -o Rglue.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c arrayc.c -o arrayc.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c callJNI.c -o callJNI.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c callback.c -o callback.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c fields.c -o fields.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c init.c -o init.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c jri_glue.c -o jri_glue.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c loader.c -o loader.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c otables.c -o otables.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c rJava.c -o rJava.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c registration.c -o registration.o
gcc -I"/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c tools.c -o tools.o
gcc -shared -L/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/lib -L/usr/local/lib64 -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o registration.o tools.o -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -L/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/lib -lR
(cd ../jri && make)
make[1]: Entering directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri'
make -C src JRI.jar
make[2]: Entering directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri/src'
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
if [ -n "/usr/lib/jvm/java-1.8.0/bin/javah" ]; then /usr/lib/jvm/java-1.8.0/bin/javah -d . -classpath . org.rosuda.JRI.Rengine; fi
gcc -c -o Rengine.o Rengine.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o Rinit.o Rinit.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include -I/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/include 
gcc -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
gcc -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
gcc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o  -shared -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/local/lib64 -L/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n 
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
/usr/lib/jvm/java-1.8.0/bin/jar fc JRI.jar org libjri.so
make[2]: Leaving directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri/src'
rm -f libjri.so
cp src/libjri.so libjri.so
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest2.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
make[1]: Leaving directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri'
installing via 'install.libs.R' to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11-sandbox/00LOCK-rJava/00new/rJava
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rJava)

The downloaded source packages are in
        '/scratch/henrik/RtmphCfDqN/downloaded_packages'

> res <- rJava:::.jinit()
## ... STALLS! ...
$ module load CBI-prototype
$ module load CBI r/4.2.0-gcc11
$ R
> R.home()
[1] "/software/c4/cbi/software/R-4.2.0-gcc11/lib64/R"
> res <- rJava:::.jinit()
> 
HenrikBengtsson commented 2 years ago

Installation diff

$ diff -u -w <(sed -E 's#/(c4|software)/.*/R-4.2.0-gcc11#R_HOME#g' a.out) <(sed -E 's#/(c4|software)/.*/R-4.2.0-gcc11#R_HOME#g' b.out) 
--- /dev/fd/63  2022-04-25 13:45:54.001838828 -0700
+++ /dev/fd/62  2022-04-25 13:45:54.001838828 -0700
@@ -1,5 +1,5 @@
 > install.packages("rJava")
-Installing package into '/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11'
+Installing package into '/c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11-sandbox'
 (as 'lib' is unspecified)
 trying URL 'https://cloud.r-project.org/src/contrib/rJava_1.0-6.tar.gz'
 Content type 'application/x-gzip' length 1047062 bytes (1022 KB)
@@ -64,12 +64,13 @@
 checking whether threads support is requested... no
 checking whether callbacks support is requested... no
 checking whether JNI cache support is requested... no
+checking whether headless init is enabled... no
 checking whether JRI is requested... yes
 configure: creating ./config.status
 config.status: creating src/Makevars
 config.status: creating R/zzz.R
 config.status: creating src/config.h
-=== configuring in jri (/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri)
+=== configuring in jri (/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri)
 configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
 checking build system type... x86_64-pc-linux-gnu
 checking host system type... x86_64-pc-linux-gnu
@@ -94,13 +95,6 @@
 checking for sys/time.h... yes
 checking for sys/types.h... (cached) yes
 checking for sys/select.h... yes
-checking for strings.h... yes
-checking for sys/stat.h... yes
-checking for sys/types.h... yes
-checking for unistd.h... yes
-checking for sys/time.h... yes
-checking for sys/types.h... (cached) yes
-checking for sys/select.h... yes
 checking Java version... 1.8.0_322
 checking Java compatibility version (integer)... 8
 checking whether /usr/lib/jvm/java-1.8.0/bin/javah actually works... yes
@@ -116,23 +110,23 @@
 config.status: creating run
 config.status: creating src/config.h
 ** libs
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c Rglue.c -o Rglue.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c arrayc.c -o arrayc.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c callJNI.c -o callJNI.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c callback.c -o callback.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c fields.c -o fields.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c init.c -o init.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c jri_glue.c -o jri_glue.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c loader.c -o loader.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c otables.c -o otables.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c rJava.c -o rJava.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c registration.c -o registration.o
-gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -c tools.c -o tools.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c Rglue.c -o Rglue.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c arrayc.c -o arrayc.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c callJNI.c -o callJNI.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c callback.c -o callback.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c fields.c -o fields.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c init.c -o init.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c jri_glue.c -o jri_glue.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c loader.c -o loader.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c otables.c -o otables.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c rJava.c -o rJava.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c registration.c -o registration.o
+gcc -I"R_HOME/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c tools.c -o tools.o
 gcc -shared -LR_HOME/lib64/R/lib -lR
 (cd ../jri && make)
-make[1]: Entering directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri'
+make[1]: Entering directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri'
 make -C src JRI.jar
-make[2]: Entering directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri/src'
+make[2]: Entering directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri/src'
 /usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
 warning: [options] bootstrap class path not set in conjunction with -source 1.4
 warning: [options] source value 1.4 is obsolete and will be removed in a future release
@@ -140,13 +134,13 @@
 warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
 4 warnings
 if [ -n "/usr/lib/jvm/java-1.8.0/bin/javah" ]; then /usr/lib/jvm/java-1.8.0/bin/javah -d . -classpath . org.rosuda.JRI.Rengine; fi
-gcc -c -o Rengine.o Rengine.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -IR_HOME/lib64/R/include 
-gcc -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -IR_HOME/lib64/R/include 
-gcc -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -IR_HOME/lib64/R/include 
-gcc -c -o Rinit.o Rinit.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -IR_HOME/lib64/R/include 
-gcc -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
-gcc -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -I/software/c4/cbi/software/gdal-2.4.4/include -I/software/c4/cbi/software/geos-3.9.1/include  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
-gcc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o  -shared -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -LR_HOME/lib64/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n 
+gcc -c -o Rengine.o Rengine.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -IR_HOME/lib64/R/include 
+gcc -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -IR_HOME/lib64/R/include 
+gcc -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -IR_HOME/lib64/R/include 
+gcc -c -o Rinit.o Rinit.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -IR_HOME/lib64/R/include 
+gcc -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
+gcc -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
+gcc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o  -shared -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/local/lib64 -LR_HOME/lib64/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n 
 /usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
 warning: [options] bootstrap class path not set in conjunction with -source 1.4
 warning: [options] source value 1.4 is obsolete and will be removed in a future release
@@ -154,7 +148,7 @@
 warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
 4 warnings
 /usr/lib/jvm/java-1.8.0/bin/jar fc JRI.jar org libjri.so
-make[2]: Leaving directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri/src'
+make[2]: Leaving directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri/src'
 rm -f libjri.so
 cp src/libjri.so libjri.so
 /usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
@@ -165,8 +159,16 @@
 Note: examples/rtest.java uses or overrides a deprecated API.
 Note: Recompile with -Xlint:deprecation for details.
 4 warnings
-make[1]: Leaving directory '/scratch/henrik/Rtmp35edTR/R.INSTALL455a6e0ac56d/rJava/jri'
-installing via 'install.libs.R' to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11/00LOCK-rJava/00new/rJava
+/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest2.java
+warning: [options] bootstrap class path not set in conjunction with -source 1.4
+warning: [options] source value 1.4 is obsolete and will be removed in a future release
+warning: [options] target value 1.4 is obsolete and will be removed in a future release
+warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
+Note: examples/rtest2.java uses or overrides a deprecated API.
+Note: Recompile with -Xlint:deprecation for details.
+4 warnings
+make[1]: Leaving directory '/scratch/henrik/RtmpQaBkx7/R.INSTALL5c9d4fb574a5/rJava/jri'
+installing via 'install.libs.R' to /c4/home/henrik/R/x86_64-pc-linux-gnu-library/4.2-CBI-gcc11-sandbox/00LOCK-rJava/00new/rJava
 ** R
 ** inst
 ** byte-compile and prepare package for lazy loading
@@ -174,11 +176,10 @@
 *** installing help indices
 ** building package indices
 ** testing if installed package can be loaded from temporary location
-
 ** checking absolute paths in shared objects and dynamic libraries
 ** testing if installed package can be loaded from final location
 ** testing if installed package keeps a record of temporary installation path
 * DONE (rJava)

 The downloaded source packages are in
-        '/scratch/henrik/RtmpAk9J0N/downloaded_packages'
+        '/scratch/henrik/RtmphCfDqN/downloaded_packages'
HenrikBengtsson commented 2 years ago

I can reproduce this on Wynton too. It appears that installing rJava with scl-devtoolset/11 loaded, cause rJava::.jinit() to stall. It works with scl-devtoolset/{8,9,10}.

HenrikBengtsson commented 2 years ago
[alice@c4-dev2 ~]$ module purge
[alice@c4-dev2 ~]$ module load CBI r/4.1.3

[alice@c4-dev2 ~]$ module load scl-devtoolset/10
[alice@c4-dev2 ~]$ gcc --version | head -1
gcc (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)
[alice@c4-dev2 ~]$ Rscript --vanilla -e "chooseCRANmirror(ind=1)" -e "install.packages('rJava')" &> rJava_R-4.1.3_gcc10.log
[alice@c4-dev2 ~]$ Rscript --vanilla -e "print(rJava::.jinit())"
[1] 0

[alice@c4-dev2 ~]$ module load scl-devtoolset/11
[alice@c4-dev2 ~]$ gcc --version | head -1
gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
[alice@c4-dev2 ~]$ Rscript --vanilla -e "chooseCRANmirror(ind=1)" -e "install.packages('rJava')" &> rJava_R-4.1.3_gcc11.log
[alice@c4-dev2 ~]$ Rscript --vanilla -e "rJava::.jinit()"
... STALLS! ...
[alice@c4-dev2 ~]$ diff -u -w rJava_R-4.1.3_gcc10.log rJava_R-4.1.3_gcc11.log
--- rJava_R-4.1.3_gcc10.log     2022-04-26 19:03:32.000000000 -0700
+++ rJava_R-4.1.3_gcc11.log     2022-04-26 19:01:18.000000000 -0700
@@ -69,7 +69,7 @@
 config.status: creating src/Makevars
 config.status: creating R/zzz.R
 config.status: creating src/config.h
-=== configuring in jri (/scratch/alice/Rtmp79pHYz/R.INSTALL31623e4621f5/rJava/jri)
+=== configuring in jri (/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri)
 configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
 checking build system type... x86_64-pc-linux-gnu
 checking host system type... x86_64-pc-linux-gnu
@@ -123,10 +123,10 @@
 gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c tools.c -o tools.o
 gcc -shared -L/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/lib -L/usr/local/lib64 -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o registration.o tools.o -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -L/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/lib -lR
 (cd ../jri && make)
-make[1]: Entering directory '/scratch/alice/Rtmp79pHYz/R.INSTALL31623e4621f5/rJava/jri'
+make[1]: Entering directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri'
 make -C src JRI.jar
-make[2]: Entering directory '/scratch/alice/Rtmp79pHYz/R.INSTALL31623e4621f5/rJava/jri/src'
-/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../RConsoleOutputStream.java ../RFactor.java ../REXP.java ../Rengine.java ../RList.java ../Mutex.java ../package-info.java ../RMainLoopCallbacks.java ../RVector.java ../RBool.java
+make[2]: Entering directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri/src'
+/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
 warning: [options] bootstrap class path not set in conjunction with -source 1.4
 warning: [options] source value 1.4 is obsolete and will be removed in a future release
 warning: [options] target value 1.4 is obsolete and will be removed in a future release
@@ -140,14 +140,14 @@
 gcc -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
 gcc -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
 gcc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o  -shared -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/local/lib64 -L/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n 
-/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../package-info.java ../RFactor.java ../REXP.java ../RList.java ../Mutex.java ../RVector.java ../RBool.java ../RConsoleOutputStream.java ../Rengine.java ../RMainLoopCallbacks.java
+/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
 warning: [options] bootstrap class path not set in conjunction with -source 1.4
 warning: [options] source value 1.4 is obsolete and will be removed in a future release
 warning: [options] target value 1.4 is obsolete and will be removed in a future release
 warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
 4 warnings
 /usr/lib/jvm/java-1.8.0/bin/jar fc JRI.jar org libjri.so
-make[2]: Leaving directory '/scratch/alice/Rtmp79pHYz/R.INSTALL31623e4621f5/rJava/jri/src'
+make[2]: Leaving directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri/src'
 rm -f libjri.so
 cp src/libjri.so libjri.so
 /usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
@@ -166,7 +166,7 @@
 Note: examples/rtest2.java uses or overrides a deprecated API.
 Note: Recompile with -Xlint:deprecation for details.
 4 warnings
-make[1]: Leaving directory '/scratch/alice/Rtmp79pHYz/R.INSTALL31623e4621f5/rJava/jri'
+make[1]: Leaving directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri'
 installing via 'install.libs.R' to /c4/home/alice/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/00LOCK-rJava/00new/rJava
 ** R
 ** inst
@@ -181,4 +181,4 @@
 * DONE (rJava)

 The downloaded source packages are in
-       ‘/scratch/alice/RtmpzE6b3X/downloaded_packages’
+       ‘/scratch/alice/RtmpvLWjn6/downloaded_packages’
HenrikBengtsson commented 2 years ago

Comparing the above javac difference, they're actually compiling the exact same *.java files, but in different order.

HenrikBengtsson commented 2 years ago

Here's the install log for GCC 11:

[alice@c4-dev2 ~]$ cat rJava_R-4.1.3_gcc11.log
Installing package into ‘/c4/home/alice/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rJava_1.0-6.tar.gz'
Content type 'application/x-gzip' length 1047062 bytes (1022 KB)
==================================================
downloaded 1022 KB

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/select.h... yes
checking Java version... 1.8.0_322
checking Java compatibility version (integer)... 8
checking whether /usr/lib/jvm/java-1.8.0/bin/javah actually works... yes
checking for target flags...  -target 1.4 -source 1.4
checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
checking whether JNI programs can be run... yes
checking JNI data types... ok
checking whether Rinterface.h exports R_CStackXXX variables... yes
checking whether Rinterface.h exports R_SignalHandlers... yes
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating run
config.status: creating src/config.h
** libs
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c Rglue.c -o Rglue.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c arrayc.c -o arrayc.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c callJNI.c -o callJNI.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c callback.c -o callback.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c fields.c -o fields.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c init.c -o init.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c jri_glue.c -o jri_glue.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c loader.c -o loader.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c otables.c -o otables.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c rJava.c -o rJava.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c registration.c -o registration.o
gcc -I"/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include" -DNDEBUG -I. -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -I/usr/local/include   -fpic  -g -O2  -c tools.c -o tools.o
gcc -shared -L/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/lib -L/usr/local/lib64 -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o registration.o tools.o -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -L/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/lib -lR
(cd ../jri && make)
make[1]: Entering directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri'
make -C src JRI.jar
make[2]: Entering directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri/src'
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
if [ -n "/usr/lib/jvm/java-1.8.0/bin/javah" ]; then /usr/lib/jvm/java-1.8.0/bin/javah -d . -classpath . org.rosuda.JRI.Rengine; fi
gcc -c -o Rengine.o Rengine.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include 
gcc -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include 
gcc -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include 
gcc -c -o Rinit.o Rinit.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include -I/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/include 
gcc -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
gcc -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2  -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux  -fpic -I/usr/lib/jvm/java-1.8.0/include -I/usr/lib/jvm/java-1.8.0/include/linux 
gcc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o  -shared -L/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/local/lib64 -L/software/c4/cbi/software/R-4.1.3-gcc8/lib64/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n 
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4  -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
4 warnings
/usr/lib/jvm/java-1.8.0/bin/jar fc JRI.jar org libjri.so
make[2]: Leaving directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri/src'
rm -f libjri.so
cp src/libjri.so libjri.so
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
/usr/lib/jvm/java-1.8.0/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest2.java
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: examples/rtest2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 warnings
make[1]: Leaving directory '/scratch/alice/Rtmp2Vl6DB/R.INSTALL275a6f654458/rJava/jri'
installing via 'install.libs.R' to /c4/home/alice/R/x86_64-pc-linux-gnu-library/4.1-CBI-gcc8/00LOCK-rJava/00new/rJava
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rJava)

The downloaded source packages are in
        ‘/scratch/alice/RtmpvLWjn6/downloaded_packages’
HenrikBengtsson commented 9 months ago

I think this happens also on Ubuntu 22.04 that comes with gcc 11.4:

$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
HenrikBengtsson commented 7 months ago

This has been fixed in rJava 1.0-10 (2023-12-02), so now we can move forward and use a more modern version of GCC than v10 when building R.