[R-SIG-Mac] rJava: configure error: One or more JNI types differ from the corresponding native type

Marius Hofert marius.hofert at uwaterloo.ca
Tue Nov 3 22:20:52 CET 2015


Hi,

I run R (devel and 3.2.2) under Mac OS X 10.11.1. I installed the JDK
via jdk-8u66-macosx-x64.dmg ("java -version" works in the terminal).
When I do install.packages("rJava"), I receive:

...
checking whether JNI programs can be compiled... yes
checking JNI data types... configure: error: One or more JNI types
differ from the corresponding native type. You may need to use
non-standard compiler flags or a different compiler in order to fix
this.
ERROR: configuration failed for package ‘rJava’

I tried:
- Using R CMD javareconf as recommended on
http://www.rforge.net/rJava/ (do I need to have R compiled with
--enable-R-shlib?)
- Setting R_JAVA_LD_LIBRARY_PATH before starting R (as described on
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Java-support)

I also found http://r.789695.n4.nabble.com/Installation-problems-Linux-Java-and-R-not-working-together-td4680718.html.
Although this concerns Linux, below I included the output of
rJava/config.log after R CMD INSTALL rJava.

Do I have to configure R in a special way and/or set specific flags?

Cheers,
Marius


  $ ./configure

## --------- ##
## Platform. ##
## --------- ##

hostname = v1020-wn-126-174.campus-dynamic.uwaterloo.ca
uname -m = x86_64
uname -r = 15.0.0
uname -s = Darwin
uname -v = Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015;
root:xnu-3247.10.11~1/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015;
root:xnu-3247.10.11~1/RELEASE_X86_64
Kernel configured for up to 8 processors.
4 processors are physically available.
8 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 16.00 gigabytes
Default processor set: 305 tasks, 1236 threads, 8 processors
Load average: 1.24, Mach factor: 6.74
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Applications/Emacs.app/Contents/MacOS
PATH: /Applications/Emacs.app/Contents/MacOS/bin
PATH: /usr/local
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /opt/X11/bin
PATH: /Library/TeX/texbin
PATH: /Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9
PATH: /Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_9


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2245: checking for gcc
configure:2272: result: gcc
configure:2501: checking for C compiler version
configure:2510: gcc --version >&5
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
Configured with:
--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
configure:2521: $? = 0
configure:2510: gcc -v >&5
Configured with:
--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
configure:2521: $? = 0
configure:2510: gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:2521: $? = 1
configure:2510: gcc -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:2521: $? = 1
configure:2541: checking whether the C compiler works
configure:2563: gcc -g -O2   conftest.c  >&5
configure:2567: $? = 0
configure:2615: result: yes
configure:2618: checking for C compiler default output file name
configure:2620: result: a.out
configure:2626: checking for suffix of executables
configure:2633: gcc -o conftest -g -O2   conftest.c  >&5
configure:2637: $? = 0
configure:2659: result:
configure:2681: checking whether we are cross compiling
configure:2689: gcc -o conftest -g -O2   conftest.c  >&5
configure:2693: $? = 0
configure:2700: ./conftest
configure:2704: $? = 0
configure:2719: result: no
configure:2724: checking for suffix of object files
configure:2746: gcc -c -g -O2  conftest.c >&5
configure:2750: $? = 0
configure:2771: result: o
configure:2775: checking whether we are using the GNU C compiler
configure:2794: gcc -c -g -O2  conftest.c >&5
configure:2794: $? = 0
configure:2803: result: yes
configure:2812: checking whether gcc accepts -g
configure:2832: gcc -c -g  conftest.c >&5
configure:2832: $? = 0
configure:2873: result: yes
configure:2890: checking for gcc option to accept ISO C89
configure:2953: gcc  -c -g -O2  conftest.c >&5
configure:2953: $? = 0
configure:2966: result: none needed
configure:2996: checking how to run the C preprocessor
configure:3027: gcc -E  conftest.c
configure:3027: $? = 0
configure:3041: gcc -E  conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^
1 error generated.
configure:3041: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "rJava"
| #define PACKAGE_TARNAME "rjava"
| #define PACKAGE_VERSION "0.8"
| #define PACKAGE_STRING "rJava 0.8"
| #define PACKAGE_BUGREPORT "Simon.Urbanek at r-project.org"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3066: result: gcc -E
configure:3086: gcc -E  conftest.c
configure:3086: $? = 0
configure:3100: gcc -E  conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^
1 error generated.
configure:3100: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "rJava"
| #define PACKAGE_TARNAME "rjava"
| #define PACKAGE_VERSION "0.8"
| #define PACKAGE_STRING "rJava 0.8"
| #define PACKAGE_BUGREPORT "Simon.Urbanek at r-project.org"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3129: checking for grep that handles long lines and -e
configure:3187: result: /usr/local/bin/grep
configure:3192: checking for egrep
configure:3254: result: /usr/local/bin/grep -E
configure:3259: checking for ANSI C header files
configure:3279: gcc -c -g -O2  conftest.c >&5
configure:3279: $? = 0
configure:3352: gcc -o conftest -g -O2   conftest.c  >&5
configure:3352: $? = 0
configure:3352: ./conftest
configure:3352: $? = 0
configure:3363: result: yes
configure:3371: checking for sys/wait.h that is POSIX.1 compatible
configure:3397: gcc -c -g -O2  conftest.c >&5
configure:3397: $? = 0
configure:3404: result: yes
configure:3417: checking for sys/types.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for sys/stat.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for stdlib.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for string.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for memory.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for strings.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for inttypes.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for stdint.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3417: checking for unistd.h
configure:3417: gcc -c -g -O2  conftest.c >&5
configure:3417: $? = 0
configure:3417: result: yes
configure:3432: checking for string.h
configure:3432: result: yes
configure:3432: checking sys/time.h usability
configure:3432: gcc -c -g -O2  conftest.c >&5
configure:3432: $? = 0
configure:3432: result: yes
configure:3432: checking sys/time.h presence
configure:3432: gcc -E  conftest.c
configure:3432: $? = 0
configure:3432: result: yes
configure:3432: checking for sys/time.h
configure:3432: result: yes
configure:3432: checking for unistd.h
configure:3432: result: yes
configure:3444: checking for an ANSI C-conforming const
configure:3510: gcc -c -g -O2  conftest.c >&5
configure:3510: $? = 0
configure:3517: result: yes
configure:3525: checking whether time.h and sys/time.h may both be included
configure:3545: gcc -c -g -O2  conftest.c >&5
configure:3545: $? = 0
configure:3552: result: yes
configure:3561: checking whether gcc supports static inline...
configure:3574: gcc -c -g -O2  conftest.c >&5
conftest.c:26:8: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
static f = 1;
~~~~~~ ^
1 warning generated.
configure:3574: $? = 0
configure:3578: result: yes
configure:3587: checking whether setjmp.h is POSIX.1 compatible
configure:3605: gcc -c -g -O2  conftest.c >&5
configure:3605: $? = 0
configure:3612: result: yes
configure:3614: checking whether sigsetjmp is declared
configure:3614: gcc -c -g -O2  conftest.c >&5
configure:3614: $? = 0
configure:3614: result: yes
configure:3625: checking whether siglongjmp is declared
configure:3625: gcc -c -g -O2  conftest.c >&5
configure:3625: $? = 0
configure:3625: result: yes
configure:3649: checking Java support in R
configure:3677: result: present:
interpreter : '/usr/bin/java'
archiver    : '/usr/bin/jar'
compiler    : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags   : '-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include/darwin'
java libs   : '-L/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/lib/server
-ljvm'
configure:3727: checking whether Java run-time works
configure:3730: result: yes
configure:3739: checking whether -Xrs is supported
configure:3747: result: yes
configure:3750: checking whether JNI programs can be compiled
configure:3763: gcc -o conftest -g -O2
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include/darwin
  conftest.c  -L/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/lib/server
-ljvm >&5
configure:3763: $? = 0
configure:3764: result: yes
configure:3776: checking JNI data types
configure:3791: gcc -o conftest -g -O2
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include/darwin
  conftest.c  -L/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/lib/server
-ljvm >&5
configure:3791: $? = 0
configure:3791: ./conftest
dyld: Library not loaded: @rpath/libjvm.dylib
  Referenced from: /Users/mhofert/Downloads/rJava/./conftest
  Reason: image not found
./configure: line 1527: 81965 Trace/BPT trap: 5       ./conftest$ac_exeext
configure:3791: $? = 133
configure: program exited with status 133
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "rJava"
| #define PACKAGE_TARNAME "rjava"
| #define PACKAGE_VERSION "0.8"
| #define PACKAGE_STRING "rJava 0.8"
| #define PACKAGE_BUGREPORT "Simon.Urbanek at r-project.org"
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_UNISTD_H 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_STATIC_INLINE 1
| #define HAVE_DECL_SIGSETJMP 1
| #define HAVE_DECL_SIGLONGJMP 1
| #define HAVE_POSIX_SETJMP 1
| #define HAVE_XRS 1
| /* end confdefs.h.  */
|
| #include <jni.h>
| int main(void) {
|   return (sizeof(int)==sizeof(jint) && sizeof(long)==sizeof(long) &&
sizeof(jbyte)==sizeof(char) && sizeof(jshort)==sizeof(short) &&
sizeof(jfloat)==sizeof(float) && sizeof(jdouble)==sizeof(double))?0:1;
| }
|
configure:3795: error: One or more JNI types differ from the
corresponding native type. You may need to use non-standard compiler
flags or a different compiler in order to fix this.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_c_compiler_gnu=yes
ac_cv_c_const=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_have_decl_siglongjmp=yes
ac_cv_have_decl_sigsetjmp=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_time_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_sys_wait_h=yes
ac_cv_header_time=yes
ac_cv_header_unistd_h=yes
ac_cv_objext=o
ac_cv_path_EGREP='/usr/local/bin/grep -E'
ac_cv_path_GREP=/usr/local/bin/grep
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
r_cv_header_setjmp_posix=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

CC='gcc'
CFLAGS='-g -O2 -I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include/darwin'
CPP='gcc -E'
CPPFLAGS=''
DEFS=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP='/usr/local/bin/grep -E'
EXEEXT=''
GREP='/usr/local/bin/grep'
JAVA='/usr/bin/java'
JAVAC='/usr/bin/javac'
JAVAH='/usr/bin/javah'
JAVA_CPPFLAGS='-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include/darwin'
JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre'
JAVA_LIBS='-L/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/lib/server
-ljvm'
LDFLAGS=''
LIBOBJS=''
LIBS=' -L/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/lib/server
-ljvm'
LTLIBOBJS=''
OBJEXT='o'
PACKAGE_BUGREPORT='Simon.Urbanek at r-project.org'
PACKAGE_NAME='rJava'
PACKAGE_STRING='rJava 0.8'
PACKAGE_TARNAME='rjava'
PACKAGE_URL=''
PACKAGE_VERSION='0.8'
PATH_SEPARATOR=':'
R_HOME='/usr/local/R/R-devel_build'
SHELL='/bin/sh'
WANT_JRI_FALSE=''
WANT_JRI_TRUE=''
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs=''
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "rJava"
#define PACKAGE_TARNAME "rjava"
#define PACKAGE_VERSION "0.8"
#define PACKAGE_STRING "rJava 0.8"
#define PACKAGE_BUGREPORT "Simon.Urbanek at r-project.org"
#define PACKAGE_URL ""
#define STDC_HEADERS 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_UNISTD_H 1
#define TIME_WITH_SYS_TIME 1
#define HAVE_STATIC_INLINE 1
#define HAVE_DECL_SIGSETJMP 1
#define HAVE_DECL_SIGLONGJMP 1
#define HAVE_POSIX_SETJMP 1
#define HAVE_XRS 1

configure: exit 133



More information about the R-SIG-Mac mailing list