2013-11-22 19 views
5

install.packages("rJava")を使用してrJavaをインストールすると、いくつかのエラーが発生します。R:rJavaがMac OSX 10.8.5でインストールに失敗する 'lzma library missing'と 'libjri.jnilib make error'

lm-mb:~ lisa$ R 

R Under development (unstable) (2013-11-21 r64282) -- "Unsuffered Consequences" 
Copyright (C) 2013 The R Foundation for Statistical Computing 
Platform: x86_64-apple-darwin10.8.0 (64-bit) 

R is free software and comes with ABSOLUTELY NO WARRANTY. 
You are welcome to redistribute it under certain conditions. 
Type 'license()' or 'licence()' for distribution details. 

    Natural language support but running in an English locale 

R is a collaborative project with many contributors. 
Type 'contributors()' for more information and 
'citation()' on how to cite R or R packages in publications. 

Type 'demo()' for some demos, 'help()' for on-line help, or 
'help.start()' for an HTML browser interface to help. 
Type 'q()' to quit R. 

> install.packages("rJava") 
--- Please select a CRAN mirror for use in this session --- 
trying URL 'http://www.stats.bris.ac.uk/R/src/contrib/rJava_0.9-4.tar.gz' 
Content type 'application/x-gzip' length 498108 bytes (486 Kb) 
opened URL 
================================================== 
downloaded 486 Kb 

* installing *source* package ‘rJava’ ... 
** package ‘rJava’ successfully unpacked and MD5 sums checked 
checking for gcc... llvm-gcc-4.2 -arch x86_64 -std=gnu99 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether llvm-gcc-4.2 -arch x86_64 -std=gnu99 accepts -g... yes 
checking for llvm-gcc-4.2 -arch x86_64 -std=gnu99 option to accept ISO C89... none  needed 
checking how to run the C preprocessor... llvm-gcc-4.2 -arch x86_64 -std=gnu99 -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 llvm-gcc-4.2 -arch x86_64 -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/System/Library/Frameworks/JavaVM.framework/Headers' 
java libs : '-framework JavaVM' 
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 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  (/private/var/folders/dn/lvhnwvq15n37bdh0dqm033zh0000gp/T/RtmpuD563L/R.INSTALL158732c239a6c/rJava/jri) 
configure: running /bin/sh ./configure '--prefix=/usr/local' --cache-file=/dev/null -- srcdir=. 
checking build system type... i386-apple-darwin12.5.0 
checking host system type... i386-apple-darwin12.5.0 
checking for gcc... llvm-gcc-4.2 -arch x86_64 -std=gnu99 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether llvm-gcc-4.2 -arch x86_64 -std=gnu99 accepts -g... yes 
checking for llvm-gcc-4.2 -arch x86_64 -std=gnu99 option to accept ISO C89... none needed 
checking how to run the C preprocessor... llvm-gcc-4.2 -arch x86_64 -std=gnu99 -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... rm: conftest.dSYM: is a directory 
rm: conftest.dSYM: is a directory 
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 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c Rglue.c -o Rglue.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c arrayc.c -o arrayc.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c callJNI.c -o callJNI.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c callback.c -o callback.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c fields.c -o fields.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c init.c -o init.o 
init.c: In function ‘initJVM’: 
init.c:100: warning: ‘JNI_GetDefaultJavaVMInitArgs’ is deprecated (declared at  /System/Library/Frameworks/JavaVM.framework/Headers/jni.h:1934) 
init.c:139: warning: ‘JNI_CreateJavaVM’ is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Headers/jni.h:1937) 
init.c: In function ‘RinitJVM’: 
init.c:278: warning: ‘JNI_GetCreatedJavaVMs’ is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Headers/jni.h:1940) 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c jri_glue.c -o jri_glue.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c loader.c -o loader.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c otables.c -o otables.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c rJava.c -o rJava.o 
rJava.c: In function ‘getJNIEnv’: 
rJava.c:200: warning: ‘JNI_GetCreatedJavaVMs’ is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Headers/jni.h:1940) 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I. -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c tools.c -o tools.o 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -L/usr/local/lib -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 -framework JavaVM -F/Library/Frameworks/R.framework/.. - framework R -Wl,-framework -Wl,CoreFoundation 
(cd ../jri && make) 
make -C src JRI.jar 
/usr/bin/javac -target 1.4 -source 1.4 -d . ../Mutex.java ../RBool.java    ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java  ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java ../package-info.java 
/usr/bin/javah -d . -classpath . org.rosuda.JRI.Rengine 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -c -o Rengine.o Rengine.c -g -Iinclude - DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -mtune=core2 -g -O2 - I/System/Library/Frameworks/JavaVM.framework/Headers -fno-common -I/System/Library/Frameworks/JavaVM.framework/Headers -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -c -o jri.o jri.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -mtune=core2 -g -O2 -I/System/Library/Frameworks/JavaVM.framework/Headers -fno-common -I/System/Library/Frameworks/JavaVM.framework/Headers -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -mtune=core2 -g -O2 -I/System/Library/Frameworks/JavaVM.framework/Headers -fno-common -I/System/Library/Frameworks/JavaVM.framework/Headers -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include 
Rcallbacks.c: In function ‘checkEnvironment’: 
Rcallbacks.c:46: warning: ‘JNI_GetCreatedJavaVMs’ is deprecated (declared at /System/Library/Frameworks/JavaVM.framework/Headers/jni.h:1940) 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -c -o Rinit.o Rinit.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -mtune=core2 -g -O2 -I/System/Library/Frameworks/JavaVM.framework/Headers -fno-common -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -mtune=core2 -g -O2 -I/System/Library/Frameworks/JavaVM.framework/Headers -fno-common -I/System/Library/Frameworks/JavaVM.framework/Headers 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -mtune=core2 -g -O2 -I/System/Library/Frameworks/JavaVM.framework/Headers -fno-common -I/System/Library/Frameworks/JavaVM.framework/Headers 
llvm-gcc-4.2 -arch x86_64 -std=gnu99 -o libjri.jnilib Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -dynamiclib -framework JavaVM -F/Library/Frameworks/R.framework/.. -framework R -llzma -licucore -lm -liconv 
ld: library not found for -llzma 
collect2: ld returned 1 exit status 
make[2]: *** [libjri.jnilib] Error 1 
make[1]: *** [src/JRI.jar] Error 2 
make: *** [jri] Error 2 
ERROR: compilation failed for package ‘rJava’ 
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rJava’ 

The downloaded source packages are in 
    ‘/private/var/folders/dn/lvhnwvq15n37bdh0dqm033zh0000gp/T/Rtmp5B1vEJ/downloaded_packages’ 
Warning message: 
In install.packages("rJava") : 
    installation of package ‘rJava’ had non-zero exit status 

最初に、lzmaに関連付けられたライブラリがありません。 googlingのビットは、このライブラリ、liblzmaは、XYファイルの圧縮に関連付けられて私に教えてくれますか? XZ Compression Tukaaniこれは正しいですか?もしそうなら、どこでこのライブラリを入手できますか?

ビルド時に他のエラーが発生する理由はわかりませんが、私は彼らが私のJava環境に関連付けられていると推測していますか?

私はJavaバージョンを更新しており、最新のものを実行しています。

lm-mb:~ lisa$ java -version 
java version "1.7.0_45" 
Java(TM) SE Runtime Environment (build 1.7.0_45-b18) 
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) 

私も大幅に任意のヘルプをお願い申し上げlibjdns_sd.jnilib

lm-mb:jre lisa$ ls /usr/lib/java/ 
libjdns_sd.jnilib 

を発見された私は、この記事によるとR: rJava package install failing

export JAVA_HOME=$/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre 
export JAVA_HOME 

export PATH=$PATH:$JAVA_HOME/bin 
export PATH 

を私JAVA_HOME環境をも設定していることがわかります。 (14.04でテスト)Linuxユーザのための

+0

片道:自宅をインストールし、次にbrew install xzをインストールします。あなたはR CMD javareconfを試しましたか? –

答えて

5

私は同じ問題に走ったと私はそうのようなマックバイナリ版をインストールすることで、それを持っているように見える

sudo apt-get install liblzma-dev 

行方不明LZMAライブラリをinstalltingことによってそれを解決しました

install.packages("rJava", type="mac.binary") 

あなたが本当に運がMacPortsを経由して、それをインストールしている場合がありますことLZMAライブラリを使用する必要がある場合:

sudo port install lzma 

OS X 10.6.8(Snow Leopard)を使用しています。

+0

'type =" mac.binary "'トリックが私のために働いていました。ありがとう! –

+0

これは完璧に働いてくれてありがとう –

+0

私は2015年10月のコメントをここに追加します。 rJavaに依存する一連のパッケージをインストールすることができませんでしたが、 'sudo'を使ってコマンドラインで作業することで、すべてのものをインストールすることができました。 –

0

私は同様の問題があったが、私の環境では、私は、Java 1.6を使用しています。 :私はそれが誰かを役に立てば幸い:)乾杯

+2

これはMacOSに関するものですが、そこには 'apt-get'があるのではないかと思います。 – dirkk

関連する問題