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

Marc Girondot marc_grt at yahoo.fr
Sun Oct 15 10:37:45 CEST 2017


The temporary solution was to load the compiled version of the package:
https://cran.r-project.org/bin/macosx/el-capitan/contrib/3.4/rJava_0.9-9.tgz

Uncompress with double-click,

and replace the rJava (from previous installation) folder with this new 
one in:
 > .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/3.4/Resources/library"

It is not very elegant but until now it works.

Marc

Le 14/10/2017 à 17:01, Marc Girondot via R-SIG-Mac a écrit :
> 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
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list