Seurat: Can't load Seurat after MacOS Catalina update

Created on 31 Oct 2019  Â·  4Comments  Â·  Source: satijalab/seurat

Hi,
After updating the system to MacOS Catalina, I can't load the Seurat 3.1.1 package anymore.

library(Seurat)
after long time running, it retuns the error below:
Error: package or namespace load failed for ‘Seurat’ in .doLoadActions(where, attach):
error in load action .__A__.1 for package RcppAnnoy: loadModule(module = "AnnoyAngular", what = TRUE, env = ns, loadNow = TRUE): Unable to load module "AnnoyAngular": vector memory exhausted (limit reached?)

Any idea how to fix it?
Thanks,
Zhibo

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.1

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 RANN_2.6.1 lattice_0.20-38 gtools_3.8.1 bitops_1.0-6 MASS_7.3-51.4 grid_3.6.1 KernSmooth_2.23-16 gplots_3.0.1.1
[10] ROCR_1.0-7 gdata_2.18.0 Matrix_1.2-17 RColorBrewer_1.1-2 tools_3.6.1 compiler_3.6.1 caTools_1.17.1.2

Most helpful comment

OK this fixed it. I can't believe how long this took me to figure out. I ran down the rabbit hole of recompiling everything to be sure Rcpp and RcppAnnoy and R itself were all compiled with gcc 7. As some things I was reading seemed to think the error could be from Rcpp and RcppAnnoy being done with gcc vs clang. Turns out all you have to do is answer NO! to this:

There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 1.0.4 1.0.4.6 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) no

All 4 comments

I have previously encountered something similar after an OS update, and solved it by reinstalling R and all associated packages. The following thread also offers a solution: https://stackoverflow.com/questions/51248293/error-vector-memory-exhausted-limit-reached-r-3-5-0-macos/52612848

That should solve your problem, but If neither of those work, please reopen this issue

Hi, can I reopen this? I've updated to MacOS 10.15.4 and attempted to load a fresh install of Seurat. I was on R 3.6.3, but have sense been uninstalling and reinstalling previous versions and reattempting, along with changing the R_MAX_VSIZE option. (I have a 64 GB machine too, though that shouldn't be an issue anyway...). Default R_MAX_VSIZE is unspecified and seems to attempt to hog a lot of memory before finding the same error.

Anyway here's the current info below, any thoughts?

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_3.6.1 tools_3.6.1

library(Seurat)
Error: package or namespace load failed for ‘Seurat’ in .doLoadActions(where, attach):
error in load action .__A__.1 for package RcppAnnoy: loadModule(module = "AnnoyAngular", what = TRUE, env = ns, loadNow = TRUE): Unable to load module "AnnoyAngular": vector memory exhausted (limit reached?)
Sys.getenv('R_MAX_VSIZE')
[1] "32000000000"

OK this fixed it. I can't believe how long this took me to figure out. I ran down the rabbit hole of recompiling everything to be sure Rcpp and RcppAnnoy and R itself were all compiled with gcc 7. As some things I was reading seemed to think the error could be from Rcpp and RcppAnnoy being done with gcc vs clang. Turns out all you have to do is answer NO! to this:

There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 1.0.4 1.0.4.6 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) no

Thanks @walter-eckalbar , this worked!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bio-la picture bio-la  Â·  3Comments

igordot picture igordot  Â·  3Comments

farhanma picture farhanma  Â·  3Comments

GHAStVHenry picture GHAStVHenry  Â·  3Comments

kysbbubbu picture kysbbubbu  Â·  3Comments