[R-SIG-Mac] Install rJava produce an error

Marc Girondot marc_grt at yahoo.fr
Sat Oct 14 17:01:43 CEST 2017


I would be most interested to get a solution for my problem in rJava 
install.

R 3.4.2

MacOSx 10.12.6, Sierra

Xcode 9.

If I install the rJava package, I get this error:

#######

 > install.packages("rJava")
essai de l'URL 'https://cran.r-project.org/src/contrib/rJava_0.9-9.tar.gz'
Content type 'application/x-gzip' length 660454 bytes (644 KB)
==================================================
downloaded 644 KB

* installing *source* package ‘rJava’ ...

####### many lines

clang -o libjri.jnilib Rengine.o jri.o Rcallbacks.o Rinit.o globals.o 
rjava.o  -dynamiclib -framework JavaVM -fopenmp -L/usr/local/lib 
-F/Library/Frameworks/R.framework/.. -framework R -lpcre -llzma -lbz2 
-lz -licucore -lm -liconv
clang: error: unsupported option '-fopenmp'
make[2]: *** [libjri.jnilib] Error 1
make[1]: *** [src/JRI.jar] Error 2
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’

#######

clang does not understand the option -fopenmp

This version of clang comes with xCode 9:
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Then I install clang 5.0.0

clang version 5.0.0 (tags/RELEASE_500/final)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

This time, the error is:

#######

clang -o libjri.jnilib Rengine.o jri.o Rcallbacks.o Rinit.o globals.o 
rjava.o  -dynamiclib -framework JavaVM -fopenmp -L/usr/local/lib 
-F/Library/Frameworks/R.framework/.. -framework R -lpcre -llzma -lbz2 
-lz -licucore -lm -liconv
ld: library not found for -lomp
clang-5.0: error: linker command failed with exit code 1 (use -v to see 
invocation)

#######

Has someone a solution to compile rJava ?

Thanks

Marc



More information about the R-SIG-Mac mailing list