rJava 无法安装在 openSUSE 13.2 上

rJava won't install on openSUSE 13.2

我正在尝试在全新安装的 openSUSE 13.2 上安装 rJava。 JRE 和 JDK 都已安装。当使用 install.packages() 它实际上工作正常并编译了一些东西,但是我得到的第一条错误消息是这些:

mp  -L/usr/lib64/R/lib -lR -lrt -ldl -lm -licuuc -licui18n
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -licuuc
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -licui18n
collect2: error: ld returned 1 exit status
Makefile.all:38: recipe for target 'libjri.so' failed
make[2]: *** [libjri.so] Error 1
make[2]: Leaving directory '/tmp/RtmpmK9cz2/R.INSTALL48f8aa9a7b5/rJava/jri/src'
Makefile.all:21: recipe for target 'src/JRI.jar' failed
make[1]: *** [src/JRI.jar] Error 2
make[1]: Leaving directory '/tmp/RtmpmK9cz2/R.INSTALL48f8aa9a7b5/rJava/jri'
Makevars:14: recipe for target 'jri' failed
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’

运行 R CMD javareconf 给我这个:

Java interpreter : /usr/bin/java
Java version     : 1.8.0_40
Java home path   : /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar

trying to compile and link a JNI progam 
detected JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/lib64/R/include -DNDEBUG -I/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/../include -I/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/../include/linux -I/usr/local/include    -fpic  -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g  -c conftest.c -o conftest.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o conftest.so conftest.o -L/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/lib/amd64/server -ljvm -L/usr/lib64/R/lib -lR


JAVA_HOME        : /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
Updating Java configuration in /usr/lib64/R
Done.

我什至不确定这是一个 Java 问题。关于哪里出了问题有什么想法吗?

原来问题是缺少 libicu-devel 包。安装它解决了问题。