2

To reproduce:

  1. Follow the instructions in the README of https://github.com/yencarnacion/GCP-jupyter-notebook
  2. open an R jupyter notebook and execute:

    system("mkdir -p ~/anaconda3/lib/R/library", intern=TRUE)

    system("echo R_LIBS=~/anaconda3/lib/R/library > ~/.Renviron", intern=TRUE)

    * Then do a Kernel>Restart and in the first cell of your notebook put:

    .libPaths("~/anaconda3/lib/R/library")

  3. as user ubuntu do:

    • wget https://cran.rstudio.com/src/contrib/Rcpp_0.12.10.tar.gz
  4. as user ubuntu do:
    • /usr/lib/anaconda/lib/R/bin/R CMD INSTALL --library=~/anaconda3/lib/R/library Rcpp_0.12.10.tar.gz

This is the output I get from /usr/lib/anaconda/lib/R/bin/R CMD INSTALL --library=~/anaconda3/lib/R/library Rcpp_0.12.10.tar.gz:

* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c Date.cpp -o Date.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c Module.cpp -o Module.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c Rcpp_init.cpp -o Rcpp_init.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c api.cpp -o api.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c attributes.cpp -o attributes.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c barrier.cpp -o barrier.o
g++ -shared -L/usr/lib/anaconda/lib/R/lib -L/usr/lib/anaconda/lib -lgfortran -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/lib/anaconda/lib/R/lib -lR
installing to /home/ubuntu/anaconda3/lib/R/library/Rcpp/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/ubuntu/anaconda3/lib/R/library/Rcpp/libs/Rcpp.so':
  /home/ubuntu/anaconda3/lib/R/library/Rcpp/libs/Rcpp.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/ubuntu/anaconda3/lib/R/library/Rcpp’

Because of the Rcpp problem, I am unable to devtools::install_github('rstudio/leaflet') among other things.

Note: This question may be related to Rcpp package in R not install ubuntu 14.04

Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133
  • 1
    Just say no to Conda. Jupyter, and everything it needs, works just fine off the distro, for Ubuntu and Debian. – Dirk Eddelbuettel Mar 23 '17 at 11:41
  • 1
    You can install Rcpp via `sudo apt-get install r-cran-rcpp`, *and* you can install it via the normal R package path from source. Blaming Rcpp (as per your title) for failing to install other packages is borderline slander. You have a problem with the Conda stack on Ubuntu so go talk to the Conda people. – Dirk Eddelbuettel Mar 23 '17 at 11:44

2 Answers2

1

You can install Rcpp through conda:

conda install r-rcpp
Karol Pal
  • 91
  • 1
  • 12
0

Fyi, you can create a Jupyter Notebook for R on GCP in seconds by using GCP's new AI Platform Notebooks.

In the GCP console go to AI Notebooks -> New Instance -> Select R. You should be able to install any R packages that you need

Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133