1

I tried installing 'dplyr' on a Linux server using the following code in a script:

install.packages('dplyr', dependencies = TRUE, lib = 'output/software/r/package/installation/', 
                 repos = 'http://cran.rstudio.com')

but after running it with 'Rscript code.R' I got a long message followed by:

 ** package ‘dplyr’ successfully unpacked and MD5 sums checked
** libs

...

g++  -I/software/R-3.4.0/lib/R/include -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -DBOOST_NO_INT64_T -DBOOST_NO_INTEGRAL_INT64_T -DBOOST_NO_LONG_LONG -DRCPP_USING_UTF8_ERROR_STRING -I"/lustre/.../project/output/software/r/package/installation/Rcpp/include" -I"/software/R-3.4.0/lib/R/library/BH/include" -I"/software/R-3.4.0/lib/R/library/bindrcpp/include" -I"/software/R-3.4.0/lib/R/library/plogr/include" -I/usr/local/include   -fpic  -g -O2  -c hybrid_offset.cpp -o hybrid_offset.o
...

g++ -shared -L/usr/local/lib -o dplyr.so RcppExports.o address.o api.o arrange.o between.o bind.o combine_variables.o distinct.o encoding.o filter.o group_by.o group_indices.o hybrid.o hybrid_count.o hybrid_debug.o hybrid_in.o hybrid_minmax.o hybrid_nth.o hybrid_offset.o hybrid_simple.o hybrid_window.o init.o join.o join_exports.o mutate.o rlang-export.o select.o set.o slice.o summarise.o test.o utils.o window.o
installing to /lustre/.../project/output/software/r/package/installation/dplyr/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/software/R-3.4.0/lib/R/library/bindrcpp/libs/bindrcpp.so':
  /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /software/R-3.4.0/lib/R/library/bindrcpp/libs/bindrcpp.so)
ERROR: lazy loading failed for package ‘dplyr’

I tried installing 'dplyr' without the dependencies and it gives the same messages.

charlesdarwin
  • 717
  • 1
  • 9
  • 16
  • Maybe try this first `install.packages('bindrcpp', dependencies = TRUE, lib = 'output/software/r/package/installation/', repos = 'http://cran.rstudio.com')` – Tung Feb 16 '18 at 23:31
  • ...-c test.cpp -o test.o g++ -shared -L/usr/local/lib -o bindrcpp.so RcppExports.o create.o plogr.o test.o installing to /lustre/.../project/output/software/r/package/installation/bindrcpp/libs ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded * DONE (bindrcpp) The downloaded source packages are in ‘/tmp/Rtmp8smu8o/downloaded_packages’ so this seems to be OK. – charlesdarwin Feb 17 '18 at 00:23
  • Why not add '.libPaths('output/software/r/package/installation/')' in my ~/.Rprofile ? I had .libPaths('output/software/r/package/installation/') in my Rscript. Why would putting it in bash_profile make a difference. It's working now by the way. Mysterious to me. – charlesdarwin Feb 17 '18 at 18:32

0 Answers0