Error when installing RJDBC / odbc packages on RStudio Server AWS - r

I am trying to install the RJDBC and odbc packages on my instance of RStudio server, which is running on AWS:
> Sys.info()
sysname release version
"Linux" "4.14.104-78.84.amzn1.x86_64" "#1 SMP Mon Mar 4 19:19:37 UTC 2019"
nodename machine login
"ip-10-0-0-170" "x86_64" "unknown"
user effective_user
"rstudio" "rstudio"
I get the same error with both installs. All other packages install without issues
I thought it may be to do with the drivers, so i downloaded them from this link: https://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html#download-jdbc-driver. But I still get the same error
The error message is printed below:
Installing package into ‘/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.4’ (as ‘lib’ is
unspecified) also installing the dependency ‘rJava’
trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-10.tar.gz'
Content type 'application/x-gzip' length 672577 bytes (656 KB)
================================================== downloaded 656 KB
trying URL 'https://cran.rstudio.com/src/contrib/RJDBC_0.2-7.1.tar.gz'
Content type 'application/x-gzip' length 16841 bytes (16 KB)
================================================== downloaded 16 KB
installing source package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked checking for gcc... gcc -m64 -std=gnu99 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
-m64 -std=gnu99 accepts -g... yes checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed checking how to run the C
preprocessor... gcc -m64 -std=gnu99 -E checking for grep that handles
long lines and -e... /bin/grep checking for egrep... /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 -m64 -std=gnu99 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/bin/java' archiver : '/usr/bin/jar' compiler :
'/usr/bin/javac' header prep.: '/usr/bin/javah' cpp flags :
'-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux' java
libs : '-L/usr/lib/jvm/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 JNI
programs can be compiled... 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 (/tmp/RtmpYw2al0/R.INSTALL1d6d38609879/rJava/jri) configure: running
/bin/sh ./configure --disable-option-checking '--prefix=/usr/local'
--cache-file=/dev/null --srcdir=. checking build system type... x86_64-unknown-linux-gnu checking host system type...
x86_64-unknown-linux-gnu checking for gcc... gcc -m64 -std=gnu99
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 -m64 -std=gnu99 accepts -g...
yes checking for gcc -m64 -std=gnu99 option to accept ISO C89... none
needed checking how to run the C preprocessor... gcc -m64 -std=gnu99
-E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files...
yes checking Java version... 1.7.0_201 checking whether /usr/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 -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Rglue.c -o Rglue.o Rglue.c:860:13: warning: ‘new_jrectRef’ defined but not used
[-Wunused-function] static SEXP new_jrectRef(JNIEnv *env, jobject a,
const char *sig, SEXP dim ) {
^~~~~~~~~~~~ gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c arrayc.c -o arrayc.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c callJNI.c -o callJNI.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c callback.c -o callback.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c fields.c -o fields.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c init.c -o init.o init.c: In function ‘RinitJVM_real’: init.c:274:28: warning: unused
variable ‘add_xrs’ [-Wunused-variable]
int len = LENGTH(e), add_xrs = 1, joi = 0;
^~~~~~~ gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c jri_glue.c -o jri_glue.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c loader.c -o loader.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c otables.c -o otables.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c rJava.c -o rJava.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I.
-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c tools.c -o tools.o gcc -m64 -std=gnu99 -shared -L/usr/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 tools.o
-L/usr/lib/jvm/jre/lib/amd64/server -ljvm -L/usr/lib64/R/lib -lR (cd ../jri && make) make[1]: Entering directory
/tmp/RtmpYw2al0/R.INSTALL1d6d38609879/rJava/jri' make -C src JRI.jar
make[2]: Entering directory
/tmp/RtmpYw2al0/R.INSTALL1d6d38609879/rJava/jri/src' /usr/bin/javac
-target 1.4 -source 1.4 -d . ../package-info.java ../RFactor.java ../REXP.java ../Rengine.java ../RList.java ../Mutex.java
../RConsoleOutputStream.java ../RMainLoopCallbacks.java
../RVector.java ../RBool.java warning: [options] bootstrap class path
not set in conjunction with -source 1.4 1 warning if [ -n
"/usr/bin/javah" ]; then /usr/bin/javah -d . -classpath .
org.rosuda.JRI.Rengine; fi gcc -m64 -std=gnu99 -c -o Rengine.o
Rengine.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/include/R -I/usr/include/R gcc -m64 -std=gnu99 -c -o jri.o jri.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/include/R -I/usr/include/R gcc -m64 -std=gnu99 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK
-DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/include/R -I/usr/include/R gcc -m64 -std=gnu99 -c -o Rinit.o Rinit.c -g -Iinclude
-DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/include/R -I/usr/include/R gcc -m64 -std=gnu99 -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux gcc -m64 -std=gnu99 -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux rjava.c: In function ‘RJava_request_lock’: rjava.c:22:3: warning: ignoring return value of
‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rjava.c: In function
‘RJava_clear_lock’: rjava.c:30:3: warning: ignoring return value of
‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rjava.c: In function
‘RJava_request_callback’: rjava.c:39:3: warning: ignoring return value
of ‘write’, declared with attribute warn_unused_result
[-Wunused-result] write(ipcout, buf, sizeof(ptrlong) * 3);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rjava.c: In function
‘RJava_init_ctrl’: rjava.c:51:3: warning: ignoring return value of
‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rjava.c:52:3: warning: ignoring
return value of ‘read’, declared with attribute warn_unused_result
[-Wunused-result] read(resin, buf, sizeof(ptrlong) * 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc -m64 -std=gnu99 -o libjri.so
Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared
-L/usr/lib/jvm/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/local/lib64 -L/usr/lib64/R/lib -lR -ltre -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n gcc: error: libgomp.spec: No such file or directory make[2]: * [libjri.so] Error 1 make[2]:
Leaving directory
/tmp/RtmpYw2al0/R.INSTALL1d6d38609879/rJava/jri/src' make[1]: ***
[src/JRI.jar] Error 2 make[1]: Leaving directory
/tmp/RtmpYw2al0/R.INSTALL1d6d38609879/rJava/jri' make: * [jri]
Error 2 ERROR: compilation failed for package ‘rJava’
removing ‘/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.4/rJava’ Warning in install.packages : installation of package ‘rJava’ had
non-zero exit status ERROR: dependency ‘rJava’ is not available for
package ‘RJDBC’
removing ‘/home/rstudio/R/x86_64-redhat-linux-gnu-library/3.4/RJDBC’ Warning in install.packages : installation of package ‘RJDBC’ had
non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpSo7Mm5/downloaded_packages’

Related

R - Installing package "xlsx"

I'm trying to install the package "xlsx" in RStudio. I am using Ubuntu 20.04 and I am new to programming. I uses the code
install.packages("xlsx")
While the installation process I got warnings:
warning: [options] bootstrap class path not set in conjunction with -source 6
warning: [options] source value 6 is obsolete and will be removed in a future release
warning: [options] target value 1.6 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
After that some things are not found:
/usr/bin/ld: -lpcre2-8 kann nicht gefunden werden
/usr/bin/ld: -llzma kann nicht gefunden werden
/usr/bin/ld: -lbz2 kann nicht gefunden werden
/usr/bin/ld: -lz kann nicht gefunden werden
And the installation process stopps.
The whole code is here:
install.packages("xlsx")
Installiere Paket nach ‘/home/carla/R/x86_64-pc-linux-gnu-library/4.1’
(da ‘lib’ nicht spezifiziert)
installiere auch Abhängigkeiten ‘rJava’, ‘xlsxjars’
versuche 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
versuche URL 'https://cloud.r-project.org/src/contrib/xlsxjars_0.6.1.tar.gz'
Content type 'application/x-gzip' length 9477071 bytes (9.0 MB)
==================================================
downloaded 9.0 MB
versuche URL 'https://cloud.r-project.org/src/contrib/xlsx_0.6.5.tar.gz'
Content type 'application/x-gzip' length 489493 bytes (478 KB)
==================================================
downloaded 478 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/default-java/bin/java'
archiver : '/usr/lib/jvm/default-java/bin/jar'
compiler : '/usr/lib/jvm/default-java/bin/javac'
header prep.: ''
cpp flags : '-I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux'
java libs : '-L/usr/lib/jvm/default-java/lib/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 (/tmp/Rtmpbi2fIb/R.INSTALLaa4513637492/rJava/jri)
configure: running /bin/bash ./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... 11.0.14.1
checking Java compatibility version (integer)... 11
checking whether actually works... no
checking whether javah was replaced by javac -h... yes
checking for target flags... -h . -target 1.6 -source 1.6
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"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Rglue.c -o Rglue.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrayc.c -o arrayc.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c callJNI.c -o callJNI.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c callback.c -o callback.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fields.c -o fields.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c jri_glue.c -o jri_glue.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c loader.c -o loader.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c otables.c -o otables.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c rJava.c -o rJava.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c registration.c -o registration.o
gcc -I"/usr/share/R/include" -DNDEBUG -I. -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c tools.c -o tools.o
gcc -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -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/default-java/lib/server -ljvm -L/usr/lib/R/lib -lR
(cd ../jri && make)
make[1]: Verzeichnis „/tmp/Rtmpbi2fIb/R.INSTALLaa4513637492/rJava/jri“ wird betreten
make -C src JRI.jar
make[2]: Verzeichnis „/tmp/Rtmpbi2fIb/R.INSTALLaa4513637492/rJava/jri/src“ wird betreten
/usr/lib/jvm/default-java/bin/javac -h . -target 1.6 -source 1.6 -d . ../package-info.java ../RFactor.java ../REXP.java ../Rengine.java ../RList.java ../Mutex.java ../RConsoleOutputStream.java ../RMainLoopCallbacks.java ../RVector.java ../RBool.java
warning: [options] bootstrap class path not set in conjunction with -source 6
warning: [options] source value 6 is obsolete and will be removed in a future release
warning: [options] target value 1.6 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 warnings
if [ -n "" ]; then -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 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -I/usr/share/R/include -I/usr/share/R/include
gcc -c -o jri.o jri.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -I/usr/share/R/include -I/usr/share/R/include
gcc -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -I/usr/share/R/include -I/usr/share/R/include
gcc -c -o Rinit.o Rinit.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -I/usr/share/R/include -I/usr/share/R/include
gcc -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux
gcc -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -g -O2 -fdebug-prefix-map=/build/r-base-lENDSu/r-base-4.1.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -fpic -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux
gcc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/lib/jvm/default-java/lib/server -ljvm -Wl,--export-dynamic -fopenmp -Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/lib/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n
/usr/bin/ld: -lpcre2-8 kann nicht gefunden werden
/usr/bin/ld: -llzma kann nicht gefunden werden
/usr/bin/ld: -lbz2 kann nicht gefunden werden
/usr/bin/ld: -lz kann nicht gefunden werden
collect2: error: ld returned 1 exit status
make[2]: Verzeichnis „/tmp/Rtmpbi2fIb/R.INSTALLaa4513637492/rJava/jri/src“ wird verlassen
make[2]: *** [Makefile.all:37: libjri.so] Fehler 1
make[1]: *** [Makefile.all:19: src/JRI.jar] Fehler 2
make[1]: Verzeichnis „/tmp/Rtmpbi2fIb/R.INSTALLaa4513637492/rJava/jri“ wird verlassen
make: *** [Makevars:14: jri] Fehler 2
ERROR: compilation failed for package ‘rJava’
* removing ‘/home/carla/R/x86_64-pc-linux-gnu-library/4.1/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
ERROR: dependency ‘rJava’ is not available for package ‘xlsxjars’
* removing ‘/home/carla/R/x86_64-pc-linux-gnu-library/4.1/xlsxjars’
Warning in install.packages :
installation of package ‘xlsxjars’ had non-zero exit status
ERROR: dependencies ‘rJava’, ‘xlsxjars’ are not available for package ‘xlsx’
* removing ‘/home/carla/R/x86_64-pc-linux-gnu-library/4.1/xlsx’
Warning in install.packages :
installation of package ‘xlsx’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpYSDmLA/downloaded_packages’
I tried to first install "rJava" but there were also the same warnings and it stopped at the same part.
And now I don't know what to do, maybe some of you can help me?

Can't install package lwgeom in R 3.5.2

I'm trying to install, in R 3.5.2 (under Debian 9), package lwgeom, which is a dependency of sf, which is a dependency of spider, the final desired package. But I got a few errors:
> install.packages('lwgeom',depend=T)
Installing package into ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘sf’
trying URL 'https://cloud.r-project.org/src/contrib/sf_0.7-2.tar.gz'
Content type 'application/x-gzip' length 8330773 bytes (7.9 MB)
==================================================
downloaded 7.9 MB
trying URL 'https://cloud.r-project.org/src/contrib/lwgeom_0.1-5.tar.gz'
Content type 'application/x-gzip' length 439764 bytes (429 KB)
==================================================
downloaded 429 KB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.1.2
checking GDAL version >= 2.0.0... yes
checking for gcc... gcc -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... 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 gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/2.1/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: pkg-config proj exists, will use it
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
configure: PROJ: 4.9.3
checking for pj_init_plus in -lproj... yes
checking PROJ: epsg found and readable... yes
checking PROJ: conus found and readable... yes
checking for geos-config... /usr/local/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.7.1
checking GEOS version >= 3.4.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/usr/local/lib -lgeos_c... yes
configure: Package CPP flags: -I/usr/include/gdal -I/usr/local/include
configure: Package LIBS: -lproj -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bbox.cpp -o bbox.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal.cpp -o gdal.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_geom.cpp -o gdal_geom.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_read.cpp -o gdal_read.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_utils.cpp -o gdal_utils.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_write.cpp -o gdal_write.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geos.cpp -o geos.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c hex.cpp -o hex.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c polygonize.cpp -o polygonize.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c proj.cpp -o proj.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c raster2sf.cpp -o raster2sf.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c sfg.cpp -o sfg.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c signed_area.cpp -o signed_area.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c stars.cpp -o stars.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c wkb.cpp -o wkb.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-z,relro -o sf.so RcppExports.o bbox.o gdal.o gdal_geom.o gdal_read.o gdal_utils.o gdal_write.o geos.o hex.o polygonize.o proj.o raster2sf.o sfg.o signed_area.o stars.o wkb.o -lproj -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c -L/usr/lib/R/lib -lR
installing to /home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
in method for ‘dbWriteTable’ with signature ‘"PostgreSQLConnection","character","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘dbDataType’ with signature ‘"PostgreSQLConnection","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘coerce’ with signature ‘"Spatial","sf"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"Spatial","sfc"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sf","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sfc","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"XY","Spatial"’: no definition for class “Spatial”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so':
/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so: undefined symbol: GEOSFrechetDistanceDensify_r
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/lwgeom’
Warning in install.packages :
installation of package ‘lwgeom’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmptKPuTu/downloaded_packages’
The lines with errors are:
in method for ‘dbWriteTable’ with signature ‘"PostgreSQLConnection","character","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘dbDataType’ with signature ‘"PostgreSQLConnection","sf"’: no definition for class “PostgreSQLConnection”
I installed the packages RSQLite and RPostgreSQL, but this didn't solved it.
in method for ‘coerce’ with signature ‘"Spatial","sf"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"Spatial","sfc"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sf","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sfc","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"XY","Spatial"’: no definition for class “Spatial”
I have no idea how to solve these, but I have the following packages installed in Debian:
libgdal-dev is already the newest version (2.1.2+dfsg-5).
libgeos-dev is already the newest version (3.5.1-3).
libproj-dev is already the newest version (4.9.3-1).
libudunits2-dev is already the newest version (2.2.20-1+b1).
The last important error:
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
But if I try to install sf, I got the following error:
> install.packages('sf',depend=T)
Installing package into ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘tmaptools’, ‘lwgeom’, ‘mapview’, ‘stars’, ‘tmap’
trying URL 'https://cloud.r-project.org/src/contrib/tmaptools_2.0-1.tar.gz'
Content type 'application/x-gzip' length 84292 bytes (82 KB)
==================================================
downloaded 82 KB
trying URL 'https://cloud.r-project.org/src/contrib/lwgeom_0.1-5.tar.gz'
Content type 'application/x-gzip' length 439764 bytes (429 KB)
==================================================
downloaded 429 KB
trying URL 'https://cloud.r-project.org/src/contrib/mapview_2.6.3.tar.gz'
Content type 'application/x-gzip' length 2016015 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
trying URL 'https://cloud.r-project.org/src/contrib/stars_0.2-0.tar.gz'
Content type 'application/x-gzip' length 5999356 bytes (5.7 MB)
==================================================
downloaded 5.7 MB
trying URL 'https://cloud.r-project.org/src/contrib/tmap_2.2.tar.gz'
Content type 'application/x-gzip' length 2900602 bytes (2.8 MB)
==================================================
downloaded 2.8 MB
trying URL 'https://cloud.r-project.org/src/contrib/sf_0.7-2.tar.gz'
Content type 'application/x-gzip' length 8330773 bytes (7.9 MB)
==================================================
downloaded 7.9 MB
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.1.2
checking GDAL version >= 2.0.0... yes
checking for gcc... gcc -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... 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 gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/2.1/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: pkg-config proj exists, will use it
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
configure: PROJ: 4.9.3
checking for pj_init_plus in -lproj... yes
checking PROJ: epsg found and readable... yes
checking PROJ: conus found and readable... yes
checking for geos-config... /usr/local/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.7.1
checking GEOS version >= 3.4.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/usr/local/lib -lgeos_c... yes
configure: Package CPP flags: -I/usr/include/gdal -I/usr/local/include
configure: Package LIBS: -lproj -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bbox.cpp -o bbox.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal.cpp -o gdal.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_geom.cpp -o gdal_geom.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_read.cpp -o gdal_read.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_utils.cpp -o gdal_utils.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_write.cpp -o gdal_write.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geos.cpp -o geos.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c hex.cpp -o hex.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c polygonize.cpp -o polygonize.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c proj.cpp -o proj.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c raster2sf.cpp -o raster2sf.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c sfg.cpp -o sfg.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c signed_area.cpp -o signed_area.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c stars.cpp -o stars.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c wkb.cpp -o wkb.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-z,relro -o sf.so RcppExports.o bbox.o gdal.o gdal_geom.o gdal_read.o gdal_utils.o gdal_write.o geos.o hex.o polygonize.o proj.o raster2sf.o sfg.o signed_area.o stars.o wkb.o -lproj -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c -L/usr/lib/R/lib -lR
installing to /home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
in method for ‘dbWriteTable’ with signature ‘"PostgreSQLConnection","character","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘dbDataType’ with signature ‘"PostgreSQLConnection","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘coerce’ with signature ‘"Spatial","sf"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"Spatial","sfc"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sf","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sfc","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"XY","Spatial"’: no definition for class “Spatial”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so':
/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so: undefined symbol: GEOSFrechetDistanceDensify_r
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/lwgeom’
Warning in install.packages :
installation of package ‘lwgeom’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘mapview’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/mapview’
Warning in install.packages :
installation of package ‘mapview’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘stars’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/stars’
Warning in install.packages :
installation of package ‘stars’ had non-zero exit status
ERROR: dependencies ‘sf’, ‘lwgeom’ are not available for package ‘tmaptools’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/tmaptools’
Warning in install.packages :
installation of package ‘tmaptools’ had non-zero exit status
ERROR: dependencies ‘tmaptools’, ‘sf’, ‘mapview’ are not available for package ‘tmap’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/tmap’
Warning in install.packages :
installation of package ‘tmap’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmptKPuTu/downloaded_packages’
What I don't understand (apart from the errors that I can't solve) is: how can sf be a dependency for lwgeom, and lwgeom be a dependency for sf at the same time?
Well, I ended up uninstalling and installing again both GDAL and GEOS, from Debian official repositories and from source, a few times. Until I got it right, don't know exactly how or why. In the end I got up with this:
ldconfig -v | grep gdal
libgdal.so.20 -> libgdal.so.20.1.2
ldconfig -v | grep geos
libgeos-3.7.1.so -> libgeos.so
libgeos_c.so.1 -> libgeos_c.so.1.11.1
libgeos-3.5.1.so -> libgeos-3.5.1.so
libgeos_c.so.1 -> libgeos_c.so.1.9.1
Which is quite similar to the first problem I had (more than one version of GEOS). So don't ask me...
The installation of lwgeom and sf gave a few warnings, but I was finally able to install spider.
EDIT
I've ran into the same problem again (trying to install stplanr). This time, I found out that I have installed one of libgeos' versions from source. So I went to the directory of the source and issued sudo make uninstall, which removed it nicely. Then I just reinstalled the official version from Debian repository, and now I could install both lwgeom and sf in R.

Unable toInstalling xlsx package in Rstudio. rjava ,unable to load shared object in ubuntu 16.04

> install.packages("rJava")
Installing package into ‘/home/unix/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rJava_0.9-10.tar.gz'
Content type 'application/x-gzip' length 672577 bytes (656 KB)
==================================================
downloaded 656 KB
* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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 -std=gnu99 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/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux'
java libs : '-L/usr/lib/jvm/java-8-openjdk-amd64/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 JNI programs can be compiled... 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 (/tmp/RtmphqeUs3/R.INSTALL29e9145183b8/rJava/jri)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc -std=gnu99
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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking Java version... 1.8.0_181
checking whether /usr/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 -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Rglue.c -o Rglue.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c arrayc.c -o arrayc.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c callJNI.c -o callJNI.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c callback.c -o callback.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fields.c -o fields.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c jri_glue.c -o jri_glue.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c loader.c -o loader.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c otables.c -o otables.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c rJava.c -o rJava.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c tools.c -o tools.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o otables.o rJava.o tools.o -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
(cd ../jri && make)
make[1]: Entering directory '/tmp/RtmphqeUs3/R.INSTALL29e9145183b8/rJava/jri'
make -C src JRI.jar
make[2]: Entering directory '/tmp/RtmphqeUs3/R.INSTALL29e9145183b8/rJava/jri/src'
/usr/bin/javac -target 1.4 -source 1.4 -d . ../package-info.java ../REXP.java ../RFactor.java ../RList.java ../Mutex.java ../RConsoleOutputStream.java ../RMainLoopCallbacks.java ../RVector.java ../RBool.java ../Rengine.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/bin/javah" ]; then /usr/bin/javah -d . -classpath . org.rosuda.JRI.Rengine; fi
gcc -std=gnu99 -c -o Rengine.o Rengine.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o jri.o jri.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o Rinit.o Rinit.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -I/usr/share/R/include -I/usr/share/R/include
gcc -std=gnu99 -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux
gcc -std=gnu99 -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux -fpic -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux
rjava.c: In function ‘RJava_request_lock’:
rjava.c:22:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^
rjava.c: In function ‘RJava_clear_lock’:
rjava.c:30:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^
rjava.c: In function ‘RJava_request_callback’:
rjava.c:39:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong) * 3);
^
rjava.c: In function ‘RJava_init_ctrl’:
rjava.c:51:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^
rjava.c:52:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
read(resin, buf, sizeof(ptrlong) * 2);
^
gcc -std=gnu99 -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm
/usr/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
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/bin/jar fc JRI.jar org libjri.so
make[2]: Leaving directory '/tmp/RtmphqeUs3/R.INSTALL29e9145183b8/rJava/jri/src'
rm -f libjri.so
cp src/libjri.so libjri.so
/usr/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/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 '/tmp/RtmphqeUs3/R.INSTALL29e9145183b8/rJava/jri'
installing via 'install.libs.R' to /home/unix/R/x86_64-pc-linux-gnu-library/3.4/rJava
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/unix/R/x86_64-pc-linux-gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/unix/R/x86_64-pc-linux-gnu-library/3.4/rJava’
* restoring previous ‘/home/unix/R/x86_64-pc-linux-gnu-library/3.4/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp1rqpcH/downloaded_packages’`enter code here`
**************************** loading the xlsx package ****************
library(xlsx)
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/unix/R/x86_64-pc-linux-gnu-library/3.4/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Getting rJava to work can be challenging. In your case I would suggest to use the c2d4u repository. Since you are using R 3.4, this would be:
sudo add-apt-repository ppa:marutter/c2d4u
sudo apt-get update
sudo apt-get install r-cran-xlsx
If you also update to R 3.5, you could use the corresponding repo:
sudo add-apt-repository ppa:marutter/c2d4u3.5
...

Rgdal package install: projects.h: No such file or directory (error)

I'm trying to install Rgdal package on my local server (no connected to internet). when I ran install.packages("rgdal_1.2-15.tar.gz","/usr/lib64/R/library/",repos=NULL) I got an error inverser.c:4:22: error: projects.h: No such file or directory
this is the out put of install process:
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: rgdal: 1.2-15
checking for /usr/bin/svnversion... no
configure: svn revision: 691
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.8.1
checking GDAL version >= 1.6.3... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/share/gdal/pcs.csv readable... yes
configure: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -I/usr/include/gdal
checking proj_api.h presence and usability... yes
checking PROJ.4 version: ... 4.8.0
checking PROJ.4: epsg found and readable... yes
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags: -I/usr/include/gdal
configure: Package LIBS: -lgdal -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c OGR_write.cpp -o OGR_write.o
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c gdal-bindings.cpp -o gdal-bindings.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c init.c -o init.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c inverser.c -o inverser.o
inverser.c:4:22: error: projects.h: No such file or directory
inverser.c:6: error: expected ‘)’ before ‘*’ token
make: *** [inverser.o] Error 1
ERROR: compilation failed for package ‘rgdal’
* removing ‘/usr/lib64/R/library/rgdal’
Warning message:
In install.packages("/data/ZUY10/Repo/R/rgdal_1.2-15.tar.gz", "/usr/lib64/R/library/", :
installation of package ‘/data/ZUY10/Repo/R/rgdal_1.2-15.tar.gz’ had non-zero exit status
What I did before this step:
Since my server is local, I had to install all package "dependencies" manually in my local server, So I installed like 30 packages manually which PROJ.4 and Gdal are principal as you can see here.
What do I miss here to install the RGDAL PACKAGE?
The header projects.h comes from PROJ.4. Where is that header file located on your system? You can pass this location to the configure script via --with-proj-include=DIR, i.e.
install.packages("rgdal_1.2-15.tar.gz",
"/usr/lib64/R/library/",
repos=NULL,
configure.args="--with-proj-include=DIR")
A check for projects.h being found has been added to rgdal only recently.
I have also faced above issue on RHEL7.7 upon doing multiple search. I resolved it as below:
#cd /opt
#wget http://download.osgeo.org/gdal/2.0.1/gdal-2.0.1.tar.gz
#./configure
#make
#make install
#echo "/usr/local/lib" >> /etc/ld.so.conf.d/libgdal-x86_64.conf
#ldconfig
#yum install proj.x86_64 proj-devel.x86_64 proj-epsg.x86_64 proj-nad.x86_64
Hope this helps.

gcc: error: libgomp.spec: No such file or directory with Amazon Linux 2017.09.1

I'm trying to install the rJava package in R running on an Amazon Lightsail instance (Amazon Linux 2017.09.1). I keep getting an error that gcc can't find libgomp.spec
I've located the file at /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.spec and I've tried setting up a symbolic link to it, but I haven't been able to figure out where to put the symbolic link so gcc can find it. For example, this doesn't seem to work:
ln -s /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.spec /usr/local/lib64/libgomp.spec
Does anyone know where to put the symbolic link so gcc can find it? There is probably a hint in this output that I don't understand:
* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -m64 -std=gnu99
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 -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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 -m64 -std=gnu99 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/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux'
java libs : '-L/usr/lib/jvm/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... yes
checking whether -Xrs is supported... yes
checking whether JNI programs can be compiled... 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 (/tmp/RtmphGxVwl/R.INSTALL1d971c944ee1/rJava/jri)
configure: running /bin/sh ./configure --disable-option-checking '--
prefix=/usr/local' --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc -m64 -std=gnu99
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 -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
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 -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Rglue.c -o Rglue.o
Rglue.c:847:13: warning: ‘new_jrectRef’ defined but not used [-Wunused-function]
static SEXP new_jrectRef(JNIEnv *env, jobject a, const char *sig, SEXP dim ) {
^~~~~~~~~~~~
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c arrayc.c -o arrayc.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c callJNI.c -o callJNI.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c callback.c -o callback.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c fields.c -o fields.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c init.c -o init.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c jri_glue.c -o jri_glue.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c loader.c -o loader.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c otables.c -o otables.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c rJava.c -o rJava.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c tools.c -o tools.o
gcc -m64 -std=gnu99 -shared -L/usr/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 tools.o -L/usr/lib/jvm/jre/lib/amd64/server -ljvm -L/usr/lib64/R/lib -lR
(cd ../jri && make)
make[1]: Entering directory `/tmp/RtmphGxVwl/R.INSTALL1d971c944ee1/rJava/jri'
make -C src JRI.jar
make[2]: Entering directory `/tmp/RtmphGxVwl/R.INSTALL1d971c944ee1/rJava/jri/src'
/usr/bin/javac -target 1.6 -source 1.6 -d . ../RConsoleOutputStream.java ../RFactor.java ../REXP.java ../Rengine.java ../RList.java ../Mutex.java ../package-info.java ../RMainLoopCallbacks.java ../RVector.java ../RBool.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
/usr/bin/javah -d . -classpath . org.rosuda.JRI.Rengine
gcc -m64 -std=gnu99 -c -o Rengine.o Rengine.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/include/R -I/usr/include/R
gcc -m64 -std=gnu99 -c -o jri.o jri.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/include/R -I/usr/include/R
gcc -m64 -std=gnu99 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -I/usr/include/R -I/usr/include/R
gcc -m64 -std=gnu99 -c -o Rinit.o Rinit.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/include/R -I/usr/include/R
gcc -m64 -std=gnu99 -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux
gcc -m64 -std=gnu99 -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -fpic -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux
rjava.c: In function ‘RJava_request_lock’:
rjava.c:22:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c: In function ‘RJava_clear_lock’:
rjava.c:30:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c: In function ‘RJava_request_callback’:
rjava.c:39:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong) * 3);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c: In function ‘RJava_init_ctrl’:
rjava.c:51:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(ipcout, buf, sizeof(ptrlong));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rjava.c:52:3: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
read(resin, buf, sizeof(ptrlong) * 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -m64 -std=gnu99 -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/lib/jvm/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/local/lib64 -L/usr/lib64/R/lib -lR -ltre -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n
gcc: error: libgomp.spec: No such file or directory
make[2]: *** [libjri.so] Error 1
make[2]: Leaving directory `/tmp/RtmphGxVwl/R.INSTALL1d971c944ee1/rJava/jri/src'
make[1]: *** [src/JRI.jar] Error 2
make[1]: Leaving directory `/tmp/RtmphGxVwl/R.INSTALL1d971c944ee1/rJava/jri'
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’
Sorry for answering my own question, but adding these three symbolic links allowed rJava to install on Amazon Linux 2017.09.1:
ln -s /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.spec /usr/lib64/libgomp.spec
ln -s /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.a /usr/lib64/libgomp.a
ln -s /usr/lib64/libgomp.so.1.0.0 /usr/lib64/libgomp.so
I had the same issue on Amazon Linux when installing rpy2.
sudo yum install gcc64 solved it for me.
Symlink works for me
ln -s /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.spec /usr/lib64/libgomp.spec
ln -s /usr/lib/gcc/x86_64-amazon-linux/6.4.1/libgomp.a /usr/lib64/libgomp.a
ln -s /usr/lib64/libgomp.so.1.0.0 /usr/lib64/libgomp.so
try to install libgomp and ( libgomp-dev or libgomp-devel)
# void Linux
xbps-install -Sy libgomp libgomp-devel
# Arch
pacman -Sy libgomp libgomp-devel
# debian
apt install libgomp libgomp-dev

Resources