2020年12月22日星期二

Cannot properly install/load Rcpp

Trying desperately to load and work with Rcpp (well really I am trying to work in the package Seurat which needs Rcpp)

> library(Seurat)  Error: package or namespace load failed for 'Seurat' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):   there is no package called 'Rcpp'  In addition: Warning message:  package 'Seurat' was built under R version 4.0.2   > install.packages("Rcpp")  trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/Rcpp_1.0.5.tgz'  Content type 'application/x-gzip' length 3215939 bytes (3.1 MB)  ==================================================  downloaded 3.1 MB      The downloaded binary packages are in      /var/folders/hl/247qzpv55z99f6kgddn95kk80000gn/T//RtmpX3Ovqt/downloaded_packages  > library(Rcpp)  Error: package or namespace load failed for 'Rcpp' in dyn.load(file, DLLpath = DLLpath, ...):   unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so':    dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so, 6): Symbol not found: _EXTPTR_PTR    Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so    Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib   in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so  In addition: Warning message:  package 'Rcpp' was built under R version 4.0.2   

I have tried the following

  1. restarting, reinstalling -> same errors
  2. Making sure Xcode is installed (downloaded from app store)
  3. Installed Command Line Tools from terminal with xcode-select --install
  4. Installing from source
> install.packages("Rcpp", type = "source")  trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_1.0.5.tar.gz'  Content type 'application/x-gzip' length 2950521 bytes (2.8 MB)  ==================================================  downloaded 2.8 MB    * installing *source* package 'Rcpp' ...  ** package 'Rcpp' successfully unpacked and MD5 sums checked  ** using staged installation  ** libs  clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c api.cpp -o api.o  clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c attributes.cpp -o attributes.o  clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c barrier.cpp -o barrier.o  clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c date.cpp -o date.o  clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c module.cpp -o module.o  clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include   -fPIC  -Wall -g -O2  -c rcpp_init.cpp -o rcpp_init.o  clang++ -mmacosx-version-min=10.13 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o Rcpp.so api.o attributes.o barrier.o date.o module.o rcpp_init.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation  installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-Rcpp/00new/Rcpp/libs  ** R  ** inst  ** byte-compile and prepare package for lazy loading  ** help  *** installing help indices  ** building package indices  ** installing vignettes  ** testing if installed package can be loaded from temporary location  ** checking absolute paths in shared objects and dynamic libraries  ** testing if installed package can be loaded from final location  ** testing if installed package keeps a record of temporary installation path  * DONE (Rcpp)    The downloaded source packages are in      '/private/var/folders/hl/247qzpv55z99f6kgddn95kk80000gn/T/RtmpX3Ovqt/downloaded_packages'  > library(Rcpp)  Error: package or namespace load failed for 'Rcpp' in get(Info[i, 1], envir = env):   lazy-load database '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/R/Rcpp.rdb' is corrupt  In addition: Warning message:  In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1  

Can someone please advise? Thanks!

https://stackoverflow.com/questions/65418163/cannot-properly-install-load-rcpp December 23, 2020 at 10:06AM

没有评论:

发表评论