Closed jsonbecker closed 7 years ago
Sorry, Add libicu-dev
and libbz2-dev
to your apt-get install list. (These were in base r-ver but I pulled out the dev versions to keep that image a bit lighter... Still tweaking r-ver stack a bit, but will tag a release soon & stop fiddling...)
Thanks trying that now and will report back. Once I can get something minimal running, I may just create and open source a container based on r-ver
myself that adds rJava
and open source that. Seems like it could be useful and likely drags along or requires some dependencies you might not want in r-ver
.
That didn't quite do it. Do you know of a place that lists the Linux build dependencies for rJava? All of my Googling has failed me since the recommendation is to install from apt-get which won't work since we're compiling a specific R version.
I think I got it... it was also missing liblzma-dev
. Builds take about a half hour, sorry for the notifications/emails but I'll thumbs up this if I confirm that this works and close.
i) liblzma-dev
is a dependency of r-base-dev
. If you don't install that ...
ii) Build-time dependencies are recorded and accessible: apt-get build-dep r-cran-rjava
It was liblzma-dev
.
i) Because it's listed in BUILDDEPS
here, it's removed for images based on r-ver
.
ii) Solid. That'll help me make my rJava container. Thanks.
I also got /usr/bin/ld: cannot find -lz
which I managed to fix with the following: sudo ln -s /usr/lib/libzip.so.2.1.0 /usr/lib/libz.so
In general: don't do that. libz
comes from the zlib package, libzip
comes from libzip4.
OK. Thanks for clearing that up. What should I have done?
To a first appromixation (and I answered this a few times on the list and on SO):
-lsomething
" means you lack the -dev
package for libsomething
I thought I could quickly find a good SO answer but failed, sorry. Maybe some googleing will get you there.
Thanks, I couldn't find the reference to the package on google either, but your recommendation for zlib1g-dev did fix the "cannot find -lz" and rJava does now install.
sudo apt-get install zlib1g-dev
I am also having problems with installing rJava due to the /usr/bin/ld: cannot find -lomp
message. Here are my session info details:
> devtools::session_info()
Session info ------------------------------------------------------------------
setting value
version R version 3.5.0 (2018-04-23)
system x86_64, linux-gnu
ui X11
language (EN)
collate en_US.UTF-8
tz Europe/Berlin
date 2018-10-08
Packages ----------------------------------------------------------------------
package * version date source
base * 3.5.0 2018-05-24 local
compiler 3.5.0 2018-05-24 local
datasets * 3.5.0 2018-05-24 local
devtools 1.13.6 2018-06-27 CRAN (R 3.5.0)
digest 0.6.17 2018-09-12 CRAN (R 3.5.0)
graphics * 3.5.0 2018-05-24 local
grDevices * 3.5.0 2018-05-24 local
memoise 1.1.0 2017-04-21 CRAN (R 3.5.0)
methods * 3.5.0 2018-05-24 local
RevoUtils * 11.0.0 2018-06-04 local
RevoUtilsMath * 11.0.0 2018-06-01 local
stats * 3.5.0 2018-05-24 local
tools 3.5.0 2018-05-24 local
utils * 3.5.0 2018-05-24 local
withr 2.1.2 2018-03-15 CRAN (R 3.5.0)
This is the the result of the R CMD javareconf
:
Java interpreter : /usr/bin/java
Java version : 1.8.0_181
Java home path : /usr/lib/jvm/java-8-oracle/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 program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
clang -I/opt/microsoft/ropen/3.5.0/lib64/R/include -DNDEBUG -I/usr/lib/jvm/java-8-oracle/jre/../include -I/usr/lib/jvm/java-8-oracle/jre/../include/linux -DU_STATIC_IMPLEMENTATION -g -O2 -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c conftest.c -o conftest.o
clang -shared -L/opt/microsoft/ropen/3.5.0/lib64/R/lib -o conftest.so conftest.o -L/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server -ljvm -L/opt/microsoft/ropen/3.5.0/lib64/R/lib -lR
JAVA_HOME : /usr/lib/jvm/java-8-oracle/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 /opt/microsoft/ropen/3.5.0/lib64/R
Done.
I've tried installing all additional libraries but no luck. I keep getting:
clang -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/opt/microsoft/ropen/3.5.0/lib64/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licui18n -licuuc -licudata -lstdc++ -licuuc -licui18n
/usr/bin/ld: cannot find -lomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile.all:35: recipe for target 'libjri.so' failed
make[2]: *** [libjri.so] Error 1
make[2]: Leaving directory '/data/RTMP/RtmpJ9Kieb/R.INSTALL939279164ba2/rJava/jri/src'
Makefile.all:19: recipe for target 'src/JRI.jar' failed
make[1]: *** [src/JRI.jar] Error 2
make[1]: Leaving directory '/data/RTMP/RtmpJ9Kieb/R.INSTALL939279164ba2/rJava/jri'
Makevars:14: recipe for target 'jri' failed
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’
* removing ‘/opt/microsoft/ropen/3.5.0/lib64/R/library/rJava’
thank you
@thengl Thanks for the report. What image are you using? In rocker/verse
, install.packages("rJava")
is working fine for me, e.g.
docker run --rm -ti rocker/verse R -e "install.packages('rJava')"
On other images you may need to first install some of the dependencies. See https://www.rocker-project.org/images/ or the README for an overview of the different images.
Thank you it works
i) liblzma-dev is a dependency of r-base-dev. If you don't install that ...
ii) Build-time dependencies are recorded and accessible: apt-get build-dep r-cran-rjava
As recently as Thursday evening, I was able to pull from
rocker/rstudio:3.3.1
and installRJDBC
andrJava
with the Dockerfile below. I have tried all kinds of changes but keep running into similar errors since then. I'd love some help to get back to a working configuration. I am having a heck of a time trying to figure out what changed over night.