본문 바로가기
기본적인프로그래밍/R

[R] rcdk설치시 오류 해결방법

by 인포메틱스 2021. 1. 29.
반응형

환경은 다음과 같습니다.

 

version : Ubuntu 20.04 1LTS

R version : 4.0.3

 

rcdk를 이용하기 위해서 설치를 하니 다음과 같은 오류가 떳습니다.

 

configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.

If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.

ERROR: configuration failed for package ‘rJava’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.0/rJava’
Warning in install.packages :
  installation of package ‘rJava’ had non-zero exit status
ERROR: dependency ‘rJava’ is not available for package ‘rcdk’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.0/rcdk’
Warning in install.packages :
  installation of package ‘rcdk’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpaepuLG/downloaded_packages’

 

terminal 에서 다음과 같이 했지만 해결되지가 않았습니다.

 

root@usercom:/home/user# R CMD javareconf -e
Java interpreter : /usr/lib/jvm/default-java/bin/java
Java version     : 11.0.9.1
Java home path   : /usr/lib/jvm/default-java
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar

trying to compile and link a JNI program 
detected JNI cpp flags    : 
detected JNI linker flags : 
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-8T8CYO/r-base-4.0.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
 #include <jni.h>
          ^~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:172: conftest.o] Error 1
Unable to compile a JNI program

The following Java variables have been exported:
JAVA_HOME JAVA JAVAC JAVAH JAR JAVA_LIBS JAVA_CPPFLAGS JAVA_LD_LIBRARY_PATH
Running: /bin/bash

 

terminal에서 바로 깔아 보려했지만 다음과 같이 오류가 떳습니다.

 

user@usercom:~$ sudo apt install r-cran-rjava
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-cran-rjava : Depends: r-api-3.5
E: Unable to correct problems, you have held broken packages.

 

포기하려다가 구글교수님에게 찾아보니 다음과 같은 이야기를 하십니다.

 

sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+
sudo apt-get update
sudo apt install r-cran-rjava

 

위와 같이 진행하게되면 rjava가 설치가 되어야 합니다.. 그리고 rcdk를 설치를 해보니..

 

rcdklibs를 설치하라고 해서 그것도 설치하고 다시 rcdk 설치를 하니!! 되네요

 

굳굳 rcdk를 이용하여 tanimoto coefficient분석을 할 생각입니다.!

 

728x90
반응형

댓글