Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RunSVD report error of function 'as_cholmod_sparse' not provided by package 'Matrix' #1530

Closed
linzhangTuesday opened this issue Nov 15, 2023 · 7 comments

Comments

@linzhangTuesday
Copy link

Hi I recently updated to R 4.3. 2 and the Matrix version is 1.6.3

Then when run RunSVD it report an error.

M <- RunTFIDF(M)
M <- FindTopFeatures(M, min.cutoff = 'q0')
M <- RunSVD(M)

Error in irlba(A = t(x = object), nv = n, work = irlba.work, tol = tol) :
function 'as_cholmod_sparse' not provided by package 'Matrix'

I tried downgrading Matrix to 1.6.1 but the compilation failed

Any getaround with this? Thanks!

sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.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/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

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

time zone:
tzcode source: internal

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

other attached packages:
[1] Seurat_5.0.0 SeuratObject_5.0.0 sp_2.1-1 Signac_1.12.0

loaded via a namespace (and not attached):
[1] RcppAnnoy_0.0.21 splines_4.3.2 later_1.3.1 BiocIO_1.12.0 bitops_1.0-7 tibble_3.2.1
[7] polyclip_1.10-6 XML_3.99-0.15 fastDummies_1.7.3 lifecycle_1.0.4 processx_3.8.2 globals_0.16.2
[13] lattice_0.22-5 MASS_7.3-60 magrittr_2.0.3 plotly_4.10.3 rmarkdown_2.25 yaml_2.3.7
[19] remotes_2.4.2.1 httpuv_1.6.12 sctransform_0.4.1 spam_2.10-0 pkgbuild_1.4.2 spatstat.sparse_3.0-3
[25] reticulate_1.34.0 cowplot_1.1.1 pbapply_1.7-2 RColorBrewer_1.1-3 abind_1.4-5 zlibbioc_1.48.0
[31] Rtsne_0.16 GenomicRanges_1.54.1 purrr_1.0.2 BiocGenerics_0.48.1 RCurl_1.98-1.13 circlize_0.4.15
[37] GenomeInfoDbData_1.2.11 IRanges_2.36.0 S4Vectors_0.40.1 ggrepel_0.9.4 irlba_2.3.5.1 listenv_0.9.0
[43] spatstat.utils_3.0-4 goftest_1.2-3 RSpectra_0.16-1 spatstat.random_3.2-1 fitdistrplus_1.1-11 parallelly_1.36.0
[49] RcppRoll_0.3.0 leiden_0.4.3 codetools_0.2-19 DelayedArray_0.28.0 tidyselect_1.2.0 shape_1.4.6
[55] matrixStats_1.1.0 stats4_4.3.2 spatstat.explore_3.2-5 GenomicAlignments_1.38.0 jsonlite_1.8.7 ellipsis_0.3.2
[61] progressr_0.14.0 ggridges_0.5.4 survival_3.5-7 tools_4.3.2 ica_1.0-3 Rcpp_1.0.11
[67] glue_1.6.2 gridExtra_2.3 SparseArray_1.2.2 xfun_0.41 MatrixGenerics_1.14.0 GenomeInfoDb_1.38.1
[73] dplyr_1.1.3 BiocManager_1.30.22 fastmap_1.1.1 fansi_1.0.5 callr_3.7.3 digest_0.6.33
[79] R6_2.5.1 mime_0.12 colorspace_2.1-0 scattermore_1.2 tensor_1.5 spatstat.data_3.0-3
[85] utf8_1.2.4 tidyr_1.3.0 generics_0.1.3 data.table_1.14.8 rtracklayer_1.62.0 prettyunits_1.2.0
[91] httr_1.4.7 htmlwidgets_1.6.2 S4Arrays_1.2.0 uwot_0.1.16 pkgconfig_2.0.3 gtable_0.3.4
[97] lmtest_0.9-40 XVector_0.42.0 htmltools_0.5.7 dotCall64_1.1-0 scales_1.2.1 Biobase_2.62.0
[103] png_0.1-8 knitr_1.45 rstudioapi_0.15.0 reshape2_1.4.4 rjson_0.2.21 nlme_3.1-163
[109] zoo_1.8-12 cachem_1.0.8 GlobalOptions_0.1.2 stringr_1.5.0 KernSmooth_2.23-22 parallel_4.3.2
[115] miniUI_0.1.1.1 RcppZiggurat_0.1.6 restfulr_0.0.15 pillar_1.9.0 grid_4.3.2 vctrs_0.6.4
[121] RANN_2.6.1 phateR_1.0.7 promises_1.2.1 xtable_1.8-4 cluster_2.1.4 evaluate_0.23
[127] cli_3.6.1 compiler_4.3.2 Rsamtools_2.18.0 rlang_1.1.2 crayon_1.5.2 future.apply_1.11.0
[133] ps_1.7.5 plyr_1.8.9 stringi_1.8.1 viridisLite_0.4.2 deldir_1.0-9 BiocParallel_1.36.0
[139] munsell_0.5.0 Biostrings_2.70.1 lazyeval_0.2.2 spatstat.geom_3.2-7 Matrix_1.6-3 RcppHNSW_0.5.0
[145] patchwork_1.1.3 future_1.33.0 ggplot2_3.4.4 shiny_1.7.5.1 SummarizedExperiment_1.32.0 ROCR_1.0-11
[151] Rfast_2.1.0 igraph_1.5.1 memoise_2.0.1 RcppParallel_5.1.7 fastmatch_1.1-4

@linzhangTuesday linzhangTuesday changed the title RunSVD report no function 'as_cholmod_sparse' not provided by package 'Matrix' RunSVD report error of function 'as_cholmod_sparse' not provided by package 'Matrix' Nov 15, 2023
@yufan122
Copy link

I ran into the same issue recently, how did you fix it?

@linzhangTuesday
Copy link
Author

sorry I just saw this. In case you still have this error.
I did the following
in mac terminal:
brew install gcc
brew install gfortran
add the below line to ~/.R/Makevars (if you don't have one, please create one)
FLIBS=-L/usr/local/Cellar/gfortran/4.8.2/gfortran

above adapted from https://stackoverflow.com/questions/23135703/package-install-error-compilation-failed

download Matrix_1.6-1.tar.gz from https://mirror.las.iastate.edu/CRAN/src/contrib/Archive/Matrix/
Then in R:
install.packages("~/Downloads/Matrix_1.6-1.tar.gz", repos = NULL, type="source")

This solved the compilation error for me

@yufan122
Copy link

Thank you so much for your reply! Really appreciate it!

@Usamahussein551980
Copy link

Hi Guys,

I would like to recommend the people that got an issue related to Matrix 1.6.3 and its incompatibility that broke several packages to not go down and install Matrix_1.6.1.
The problem arise from irlba package, so try to manually install it as follow, because it is one of the Matrix dependencies.

Here is my solution and it works fine with me:

db <- available.packages(repos = "https://cran.r-project.org/")
tools::package_dependencies("Matrix", db = db, which = "LinkingTo", reverse =
TRUE)[[1L]]

[1] "ahMLE" "bayesWatch" "cplm" "GeneralizedWendland" "geostatsp" "hibayes"

[7] "irlba" "lme4" "mcmcsae" "OpenMx" "PRIMME" "robustlmm"

[13] "spGARCH" "TMB"

irlba

install.packages("irlba")
library(irlba)

@yufan122
Copy link

Thank you so much!!

@Jingwe-Zhao
Copy link

sorry I just saw this. In case you still have this error. I did the following in mac terminal: brew install gcc brew install gfortran add the below line to ~/.R/Makevars (if you don't have one, please create one) FLIBS=-L/usr/local/Cellar/gfortran/4.8.2/gfortran

above adapted from https://stackoverflow.com/questions/23135703/package-install-error-compilation-failed

download Matrix_1.6-1.tar.gz from https://mirror.las.iastate.edu/CRAN/src/contrib/Archive/Matrix/ Then in R: install.packages("~/Downloads/Matrix_1.6-1.tar.gz", repos = NULL, type="source")

This solved the compilation error for me

Thank u ,Perfectly solved the problem:error in irlba::irlba(L, nv = n, nu = 0, maxit = iters) :
[function 'as_cholmod_sparse' not provided by package 'Matrix'

@mzzhang2024
Copy link

I fixed it by installing two packages together :

install.packages("Matrix", type = "source")
install.packages("irlba", type = "source")

After the installation is complete, restart R.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants