rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

How to get java into verse? #23

Closed dfrankow closed 7 years ago

dfrankow commented 7 years ago

hadleyverse had java.

verse does not.

I tried to crib things from hadleyverse:

... && apt-get install -y --no-install-recommends default-jdk \ && . /etc/environment \ && install2.r -e -r $MRAN rJava \ && R CMD javareconf \ ...

There are errors (see below).

This seems non-trivial.

=====================

gcc -std=gnu99 -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -shared -L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -ljvm -Wl,--export-dynamic -fopenmp -L/usr/local/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n /usr/bin/ld: cannot find -licuuc /usr/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/RtmpxTWDYk/R.INSTALLa2d7299c413/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/RtmpxTWDYk/R.INSTALLa2d7299c413/rJava/jri' Makevars:14: recipe for target 'jri' failed make: *** [jri] Error 2 ERROR: compilation failed for package ‘rJava’

dfrankow commented 7 years ago

I added these and it worked:

apt-get install default-jre libicu-dev

Not sure if default-jre is needed. I just got this from web searching, not sure if it's the best solution.

cboettig commented 7 years ago

Yup, though for some things that have to compile you'll need default-jdk I believe? Note that hadleyverse still exists, though deprecated; it now builds on verse and still has java, so you can compare with the setup there: https://github.com/rocker-org/hadleyverse/blob/master/Dockerfile

dfrankow commented 7 years ago

Thanks. Yeah, I was using hadleyverse and switched to verse because I read hadleyverse is deprecated.

The Dockerfile you linked to doesn't have libicu-dev. So there is some subtlety I don't understand. But, I'll just do what worked.

jsonbecker commented 7 years ago
FROM rocker/rstudio:3.3.1

RUN apt-get update -qq && apt-get -y --no-install-recommends install \
  libxml2-dev \
  libcairo2-dev \
  libsqlite-dev \
  libmariadbd-dev \
  libmariadb-client-lgpl-dev \
  libpq-dev \
    libicu-dev \ 
    libbz2-dev \
  liblzma-dev \
  default-jdk \
  && R CMD javareconf \
  && . /etc/environment \
  && install2.r --error \
    --repos 'http://www.bioconductor.org/packages/release/bioc' \
    --repos $MRAN \ 
    --deps "TRUE" \
    ## explicitly include ggplot2 to get their suggests lists
    tidyverse devtools profvis openxlsx RJDBC data.table yaml ggplot2

I use this to accomplish something probably similar to what you're doing.

cboettig commented 7 years ago

@dfrankow right, libicu-dev is probably automatically pulled in because it is a dependency of something else on that list.

eddelbuettel commented 7 years ago

Of stringi, if memory serves.