8000 Prophet example does not build anymore · Issue #22 · r-hub/r-minimal · GitHub
[go: up one dir, main page]

Skip to content

Prophet example does not build anymore #22

Closed

Description

@denrou

Prophet has rstan as a dependency which has been updated recently.
The last change of rstan introduce a new dependency to V8 package which needs some headers which are not available in Alpine linux (at least not that I know of).

Here's a tweak I use which is not a long term solution:

# Install all prophet dependencies but rstan
RUN installr -t "linux-headers gfortran g++" StanHeaders ggplot2 inline gridExtra loo pkgbuild BH dygraphs extraDistr grid methods rstantools scales stats tidyr xts

# Add system requirement for rstan (can't use installr when installing package from source, or with option dependencies != NA)
RUN apk add g++ linux-headers gfortran

# Install rstan and prophet
RUN Rscript -e 'install.packages("https://cran.r-project.org/src/contrib/Archive/rstan/rstan_2.19.3.tar.gz", type = "source")'
RUN Rscript -e 'install.packages("prophet", repos = "https://cloud.r-project.org/", dependencies = "Depends")'

I don't know if a better solution can be found

Activity

  1. gaborcsardi commented on Jul 9, 2020

    @gaborcsardi
    Collaborator

    V8 is in libnode-dev, but the R package does not find it automatically, unfortunately.

    Are you interested in making a PR to the README and example Dockerfile?

  2. denrou commented on Jul 9, 2020

    @denrou
    ContributorAuthor

    You're right, libnode-dev contains v8.h and some other requirements.
    I tried something like that:

    FROM rhub/r-minimal
    
    # V8 package requirements search for headers in v8 folder, not node
    RUN apk add libnode-dev && ln -s /usr/include/node /usr/include/v8
    RUN installr -t "linux-headers gfortran g++" prophet
    

    Unfortunately without much success

    Yes I can make a PR to the README

  3. gaborcsardi commented on Jul 9, 2020

    @gaborcsardi
    Collaborator

    Yeah, look at the error message for installr V8, it tells you how to set the location of V8, but we'll need to use install.packages() for this.

    Yes I can make a PR to the README

    Thanks much!

  4. denrou commented on Jul 9, 2020

    @denrou
    ContributorAuthor

    I tried with a custom install.packages(), but no luck, best I can do is:

    
    FROM rhub/r-minimal
    
    RUN apk add nodejs-dev linux-headers g++ curl-dev bash && ln -s /usr/include/node /usr/include/v8
    RUN installr V8
    

    Resulting with

    trying URL 'https://cloud.r-project.org/src/contrib/V8_3.2.0.tar.gz'
    Content type 'application/x-gzip' length 680510 bytes (664 KB)
    ==================================================
    downloaded 664 KB
    
    * installing *source* package ‘V8’ ...
    ** package ‘V8’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Found INCLUDE_DIR and/or LIB_DIR!
    Using PKG_CFLAGS=-I/usr/include/node -I/usr/include/v8 -I/usr/include/v8-3.14
    Using PKG_LIBS=-L -lv8 -lv8_libplatform
    Running feature test for pointer compression...
    /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lv8_libplatform
    collect2: error: ld returned 1 exit status
    Enabling pointer compression
    ** libs
    rm -f V8.so RcppExports.o bindings.o
    g++ -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/include/node -I/usr/include/v8 -I/usr/include/v8-3.14 -DV8_COMPRESS_POINTERS -I"/usr/local/lib/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -D__MUSL_
    _  -c RcppExports.cpp -o RcppExports.o
    g++ -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/include/node -I/usr/include/v8 -I/usr/include/v8-3.14 -DV8_COMPRESS_POINTERS -I"/usr/local/lib/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -D__MUSL_
    _  -c bindings.cpp -o bindings.o
    g++ -std=gnu++11 -shared -L/usr/local/lib -o V8.so RcppExports.o bindings.o -L -lv8 -lv8_libplatform
    /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lv8_libplatform
    collect2: error: ld returned 1 exit status
    make: *** [/usr/local/lib/R/share/make/shlib.mk:6: V8.so] Error 1
    ERROR: compilation failed for package ‘V8’
    * removing ‘/usr/local/lib/R/library/V8’
    
    The downloaded source packages are in
            ‘/tmp/RtmpEjPkDF/downloaded_packages’
    Updating HTML index of packages in '.Library'
    Making 'packages.html' ... done
    Warning message:
    In install.packages("V8", repos = "https://cloud.r-project.org",  :
      installation of package ‘V8’ had non-zero exit status
    

    So I'm missing lv8_libplatform but I don't know where to find it

  5. gaborcsardi commented on Oct 24, 2020

    @gaborcsardi
    Collaborator

    I merged this manually because I could not push to the PR. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0