Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

memory not mapped in get_seurat #809

Closed
mihem opened this issue Oct 13, 2023 · 33 comments
Closed

memory not mapped in get_seurat #809

mihem opened this issue Oct 13, 2023 · 33 comments
Labels
bug Something isn't working

Comments

@mihem
Copy link

mihem commented Oct 13, 2023

Describe the bug

When running the R code provided on this page https://chanzuckerberg.github.io/cellxgene-census/cellxgene_census_docsite_quick_start.html#installation:

library(cellxgene.census)

census <-  open_soma()

organism <-  "Homo sapiens"
gene_filter <-  "feature_id %in% c('ENSG00000107317', 'ENSG00000106034')"
cell_filter <-   "cell_type == 'sympathetic neuron'"
cell_columns <-  c("assay", "cell_type", "tissue", "tissue_general", "suspension_type", "disease")

seurat_obj <-  get_seurat(
   census = census,
   organism = organism,
   var_value_filter = gene_filter,
   obs_value_filter = cell_filter,
   obs_column_names = cell_columns
)

the following error occurs

*** caught segfault ***
address 0x7ffecddc8bb0, cause 'memory not mapped'

Traceback:
 1: sr_setup(uri = self$uri, config = cfg, colnames = column_names,     qc = value_filter, dim_points = coords, timestamp_end = private$tiledb_timestamp,     loglevel = log_level)
 2: df$read(coords = axis_query$coords, value_filter = axis_query$value_filter,     column_names = "soma_joinid", )
 3: private$load_joinids(df = self$query$obs_df, axis_query = self$query$obs_query)
 4: private$.joinids$obs()
 5: list2(...)
 6: lapply(list2(...), Array$create, type = type)
 7: arrow::concat_arrays(private$.joinids$obs())
 8: self$obs_joinids()
 9: paste0("cell", self$obs_joinids()$as_vector())
10: expt_query$to_seurat(X_layers = X_layers, obs_column_names = obs_column_names,     var_column_names = var_column_names, var_index = var_index)
11: get_seurat(census = census, organism = organism, var_value_filter = gene_filter,     obs_value_filter = cell_filter, obs_column_names = cell_columns)

Environment

sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=de_DE.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Berlin
tzcode source: system (glibc)

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

other attached packages:
[1] cellxgene.census_1.6.0  Seurat_4.9.9.9067       SeuratObject_4.9.9.9091
[4] sp_2.1-0               

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3      jsonlite_1.8.7          magrittr_2.0.3         
  [4] spatstat.utils_3.0-3    fs_1.6.3                zlibbioc_1.46.0        
  [7] vctrs_0.6.3             ROCR_1.0-11             spatstat.explore_3.2-3 
 [10] RCurl_1.98-1.12         base64enc_0.1-3         htmltools_0.5.6.1      
 [13] curl_5.1.0              sctransform_0.4.0       parallelly_1.36.0      
 [16] KernSmooth_2.23-22      htmlwidgets_1.6.2       ica_1.0-3              
 [19] plyr_1.8.9              plotly_4.10.2           zoo_1.8-12             
 [22] igraph_1.5.1            mime_0.12               lifecycle_1.0.3        
 [25] pkgconfig_2.0.3         Matrix_1.6-1.1          R6_2.5.1               
 [28] fastmap_1.1.1           GenomeInfoDbData_1.2.10 fitdistrplus_1.1-11    
 [31] future_1.33.0           shiny_1.7.5             digest_0.6.33          
 [34] colorspace_2.1-0        patchwork_1.1.3         S4Vectors_0.38.2       
 [37] tensor_1.5              RSpectra_0.16-1         irlba_2.3.5.1          
 [40] aws.signature_0.6.0     GenomicRanges_1.52.1    progressr_0.14.0       
 [43] urltools_1.7.3          fansi_1.0.5             spatstat.sparse_3.0-2  
 [46] httr_1.4.7              polyclip_1.10-6         abind_1.4-5            
 [49] compiler_4.3.1          bit64_4.0.5             fastDummies_1.7.3      
 [52] MASS_7.3-60             tiledbsoma_1.4.3        tools_4.3.1            
 [55] lmtest_0.9-40           httpuv_1.6.11           future.apply_1.11.0    
 [58] goftest_1.2-3           glue_1.6.2              nlme_3.1-163           
 [61] promises_1.2.1          grid_4.3.1              Rtsne_0.16             
 [64] cluster_2.1.4           reshape2_1.4.4          generics_0.1.3         
 [67] gtable_0.3.4            spatstat.data_3.0-1     tidyr_1.3.0            
 [70] data.table_1.14.8       xml2_1.3.5              utf8_1.2.3             
 [73] XVector_0.40.0          BiocGenerics_0.46.0     BPCells_0.1.0          
 [76] spatstat.geom_3.2-5     RcppAnnoy_0.0.21        ggrepel_0.9.3          
 [79] RANN_2.6.1              pillar_1.9.0            stringr_1.5.0          
 [82] spam_2.9-1              RcppHNSW_0.5.0          later_1.3.1            
 [85] splines_4.3.1           dplyr_1.1.3             lattice_0.21-9         
 [88] bit_4.0.5               survival_3.5-7          deldir_1.0-9           
 [91] tidyselect_1.2.0        miniUI_0.1.1.1          pbapply_1.7-2          
 [94] gridExtra_2.3           IRanges_2.34.1          scattermore_1.2        
 [97] stats4_4.3.1            matrixStats_1.0.0       stringi_1.7.12         
[100] lazyeval_0.2.2          codetools_0.2-19        tibble_3.2.1           
[103] cli_3.6.1               uwot_0.1.16             arrow_13.0.0.1         
[106] xtable_1.8-4            reticulate_1.32.0       munsell_0.5.0          
[109] Rcpp_1.0.11             GenomeInfoDb_1.36.4     globals_0.16.2         
[112] spatstat.random_3.1-6   triebeard_0.4.1         RcppSpdlog_0.0.14      
[115] png_0.1-8               parallel_4.3.1          ellipsis_0.3.2         
[118] ggplot2_3.4.3           assertthat_0.2.1        dotCall64_1.0-2        
[121] aws.s3_0.3.21           bitops_1.0-7            spdl_0.0.5             
[124] listenv_0.9.0           viridisLite_0.4.2       scales_1.2.1           
[127] ggridges_0.5.4          leiden_0.4.3            purrr_1.0.2            
[130] rlang_1.1.1             cowplot_1.1.1          

Additional context

Not sure if this is related, but I had problem installing tiledbsoma.

install.packages('tiledbsoma', repos = c('https://tiledb-inc.r-universe.dev',
                                             'https://cloud.r-project.org'))

failed with

Make Error at /tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-RELEASE.cmake:37 (message):
  Command failed: 1

   '/usr/bin/cmake' '-DCMAKE_PREFIX_PATH=/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/install' '-DCMAKE_INSTALL_PREFIX=/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/install' '-DCMAKE_OSX_ARCHITECTURES=' '-DCMAKE_BUILD_TYPE=RELEASE' '-DCMAKE_CXX_COMPILER=/usr/bin/ccache' '-DCMAKE_C_COMPILER=/usr/bin/ccache' '-DCMAKE_TOOLCHAIN_FILE=' '-DCMAKE_POSITION_INDEPENDENT_CODE=ON' '-DSPDLOG_BUILD_SHARED=OFF' '-GUnix Makefiles' '/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog'

  See also

    /tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-*.log


-- stdout output is:
-- The CXX compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/ccache
-- Check for working CXX compiler: /usr/bin/ccache - broken
-- Configuring incomplete, errors occurred!
See also "/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeOutput.log".
See also "/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeError.log".

-- stderr output is:
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler

    "/usr/bin/ccache"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_42063/fast && gmake[3]: Entering directory '/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    make  -f CMakeFiles/cmTC_42063.dir/build.make CMakeFiles/cmTC_42063.dir/build
    make[4]: Entering directory '/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_42063.dir/testCXXCompiler.cxx.o
    /usr/bin/ccache   -g -O2  -o CMakeFiles/cmTC_42063.dir/testCXXCompiler.cxx.o -c /tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    /usr/bin/ccache: invalid option -- 'g'
    make[4]: *** [CMakeFiles/cmTC_42063.dir/build.make:78: CMakeFiles/cmTC_42063.dir/testCXXCompiler.cxx.o] Error 1
    make[4]: Leaving directory '/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    gmake[3]: *** [Makefile:127: cmTC_42063/fast] Error 2
    gmake[3]: Leaving directory '/tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:13 (project)



CMake Error at /tmp/RtmpQOIr1N/R.INSTALL9ee39169bf4f7/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-RELEASE.cmake:47 (message):
  Stopping after outputting logs.


make[2]: *** [CMakeFiles/ep_spdlog.dir/build.make:93: externals/src/ep_spdlog-stamp/ep_spdlog-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/ep_spdlog.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Error: could not load cache
make[3]: *** [CMakeFiles/install-libtiledbsoma.dir/build.make:70: CMakeFiles/install-libtiledbsoma] Error 1
make[2]: *** [CMakeFiles/Makefile2:168: CMakeFiles/install-libtiledbsoma.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:175: CMakeFiles/install-libtiledbsoma.dir/rule] Error 2
make: *** [Makefile:163: install-libtiledbsoma] Error 2
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
using C++17
g++ -std=gnu++17 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I. -I../inst/include/ -I../inst/tiledb/include -I../inst/tiledbsoma/include   -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/RcppSpdlog/include' -I/usr/local/include    -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
../inst/include/tiledbsoma_types.h:21:10: fatal error: tiledbsoma/tiledbsoma: No such file or directory
   21 | #include <tiledbsoma/tiledbsoma>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.3.1/lib/R/etc/Makeconf:200: RcppExports.o] Error 1

So i used @eddelbuettel tip from here single-cell-data/TileDB-SOMA#1599
and downloaded the binary tiledbsoma_1.4.3-jammy.tar.gz from here https://chanzuckerberg.r-universe.dev/tiledbsoma which worked fine as did the cellxgene.census.

@mihem mihem added the bug Something isn't working label Oct 13, 2023
@eddelbuettel
Copy link
Contributor

Glad the tip helped -- we are in the process to sort this out / smoth this a little but we are currently focussing on getting a first official 1.5.0 release of tiledb-soma out after which this should get become easier, (CC @johnkerl).

@mihem
Copy link
Author

mihem commented Oct 13, 2023

Thanks Dirk, appreciate your help (all all your great Rcpp work!)

So you think this is related?

I understand. Any about a workaround for the current situation (downgrading tiledbsoma, couldn't find any older binary), or is this release planned soon anyway?

How does it work on your machine?

@eddelbuettel
Copy link
Contributor

Yes related in the sense that compiled parts (and more so with C++ than with C) need to be aliged / can create issues when mimatched builds happen. I am more on the dev side here than the user side so I compile it all locally and it all works. But we have seen things similar to what you describe in our CI when using pre-built parts so we know about it, and as I mentioned, planned to put some improvements in. But first a full 1.5.0 release.

@mlin
Copy link
Contributor

mlin commented Oct 16, 2023

@mihem While we're pushing out the 1.5.0 release, two possible temporary workarounds would be to:

  1. upgrade tiledbsoma to our (non-released) main branch per these instructions; OR
  2. downgrade tiledb to the prior release 0.20.3 which the last-released tiledbsoma was built for.

Sorry for the inconvenience!

@mihem
Copy link
Author

mihem commented Oct 16, 2023

@mlin thanks for you support.

I would prefer upgrading to downgrading ;).

But 1. leads to the same problem

remotes::install_github("https://github.com/single-cell-data/TileDB-SOMA", subdir = "apis/r")
** using staged installation
   -- Install prefix is /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/inst/tiledbsoma.
   -- The C compiler identification is GNU 11.4.0
   -- The CXX compiler identification is GNU 11.4.0
   -- Detecting C compiler ABI info
   -- Detecting C compiler ABI info - done
   -- Check for working C compiler: /usr/bin/ccache - skipped
   -- Detecting C compile features
   -- Detecting C compile features - done
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Check for working CXX compiler: /usr/bin/ccache - skipped
   -- Detecting CXX compile features
   -- Detecting CXX compile features - done
   -- Starting TileDB-SOMA superbuild.
   -- Could NOT find TileDB (missing: TileDB_DIR)
   -- Adding TileDB as an external project
   -- Could NOT find spdlog (missing: spdlog_DIR)
   -- Adding spdlog as an external project
   -- Not found clang-tidy
   -- Not found clang-format
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib
   [  4%] Creating directories for 'ep_tiledb'
   [  8%] Performing download step (download, verify and extract) for 'ep_tiledb'
   -- ep_tiledb download command succeeded.  See also /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_tiledb-stamp/ep_tiledb-download-*.log
   [ 12%] No update step for 'ep_tiledb'
   [ 16%] No patch step for 'ep_tiledb'
   [ 20%] No configure step for 'ep_tiledb'
   [ 24%] No build step for 'ep_tiledb'
   [ 28%] Performing install step for 'ep_tiledb'
   [ 32%] No test step for 'ep_tiledb'
   [ 36%] Completed 'ep_tiledb'
   [ 36%] Built target ep_tiledb
   [ 40%] Creating directories for 'ep_spdlog'
   [ 44%] Performing download step (download, verify and extract) for 'ep_spdlog'
   -- ep_spdlog download command succeeded.  See also /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-download-*.log
   [ 48%] No update step for 'ep_spdlog'
   [ 52%] Performing patch step for 'ep_spdlog'
   patching file include/spdlog/logger-inl.h
   [ 56%] Performing configure step for 'ep_spdlog'
   CMake Error at /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-RELEASE.cmake:37 (message):
     Command failed: 1
   
      '/usr/bin/cmake' '-DCMAKE_PREFIX_PATH=/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/install' '-DCMAKE_INSTALL_PREFIX=/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/install' '-DCMAKE_OSX_ARCHITECTURES=' '-DCMAKE_BUILD_TYPE=RELEASE' '-DCMAKE_CXX_COMPILER=/usr/bin/ccache' '-DCMAKE_C_COMPILER=/usr/bin/ccache' '-DCMAKE_TOOLCHAIN_FILE=' '-DCMAKE_POSITION_INDEPENDENT_CODE=ON' '-DSPDLOG_BUILD_SHARED=OFF' '-GUnix Makefiles' '/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog'
   
     See also
   
       /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-*.log
   
   
   -- stdout output is:
   -- The CXX compiler identification is unknown
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - failed
   -- Check for working CXX compiler: /usr/bin/ccache
   -- Check for working CXX compiler: /usr/bin/ccache - broken
   -- Configuring incomplete, errors occurred!
   See also "/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeOutput.log".
   See also "/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeError.log".
   
   -- stderr output is:
   CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
     The C++ compiler
   
       "/usr/bin/ccache"
   
     is not able to compile a simple test program.
   
     It fails with the following output:
   
       Change Dir: /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp
       
       Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_622a9/fast && gmake[3]: Entering directory '/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
       make  -f CMakeFiles/cmTC_622a9.dir/build.make CMakeFiles/cmTC_622a9.dir/build
       make[4]: Entering directory '/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
       Building CXX object CMakeFiles/cmTC_622a9.dir/testCXXCompiler.cxx.o
       /usr/bin/ccache   -g -O2 -Wall -pedantic -fdiagnostics-color=always  -o CMakeFiles/cmTC_622a9.dir/testCXXCompiler.cxx.o -c /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
       /usr/bin/ccache: invalid option -- 'g'
       make[4]: *** [CMakeFiles/cmTC_622a9.dir/build.make:78: CMakeFiles/cmTC_622a9.dir/testCXXCompiler.cxx.o] Error 1
       make[4]: Leaving directory '/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
       gmake[3]: *** [Makefile:127: cmTC_622a9/fast] Error 2
       gmake[3]: Leaving directory '/tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
       
       
   
     
   
     CMake will not be able to correctly generate this project.
   Call Stack (most recent call first):
     CMakeLists.txt:13 (project)
   
   
   
   CMake Error at /tmp/Rtmp8W64Hm/Rbuild11877a69e8a218/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-RELEASE.cmake:47 (message):
     Stopping after outputting logs.
   
   
   make[2]: *** [CMakeFiles/ep_spdlog.dir/build.make:93: externals/src/ep_spdlog-stamp/ep_spdlog-configure] Error 1
   make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/ep_spdlog.dir/all] Error 2
   make: *** [Makefile:91: all] Error 2
   Error: could not load cache
   make[3]: *** [CMakeFiles/install-libtiledbsoma.dir/build.make:70: CMakeFiles/install-libtiledbsoma] Error 1
   make[2]: *** [CMakeFiles/Makefile2:168: CMakeFiles/install-libtiledbsoma.dir/all] Error 2
   make[1]: *** [CMakeFiles/Makefile2:175: CMakeFiles/install-libtiledbsoma.dir/rule] Error 2
   make: *** [Makefile:163: install-libtiledbsoma] Error 2
   ** libs
   using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
   using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
   using C++17
   g++ -std=gnu++17 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I. -I../inst/include/ -I../inst/tiledb/include -I../inst/tiledbsoma/include   -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/RcppSpdlog/include' -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/RcppInt64/include' -I/usr/local/include    -fpic  -g -O2  -Wall -pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o
   In file included from RcppExports.cpp:4:
   ../inst/include/tiledbsoma_types.h:21:10: fatal error: tiledbsoma/tiledbsoma: No such file or directory
      21 | #include <tiledbsoma/tiledbsoma>
         |          ^~~~~~~~~~~~~~~~~~~~~~~
   compilation terminated.
   make: *** [/opt/R/4.3.1/lib/R/etc/Makeconf:200: RcppExports.o] Error 1
   ERROR: compilation failed for package ‘tiledbsoma’
─  removing ‘/tmp/Rtmp8W64Hm/Rinst11877a254320a9/tiledbsoma’
         -----------------------------------
   ERROR: package installation failed
Error: Failed to install 'tiledbsoma' from GitHub:
  ! System command 'R' failed

@mlin
Copy link
Contributor

mlin commented Oct 16, 2023

@eddelbuettel re @mihem's difficulties building from source...seems like something to do with ccache. I just noticed that my dev laptop, and probably our CI, don't have ccache installed, so I've probably never experienced the ccache path in our CMakeLists.txt. Any insights about potential mismatches/misconfigurations there? Is there some way to avoid that optimization path short of advising @mihem to uninstall ccache?

@eddelbuettel
Copy link
Contributor

@mlin I presume that is "theoretically possible" as ccache, well, caches but I have used it for about ten or so years and still think this is more likely due to slight ABI/API shifts and drifts usually solved by ensuring all object code in the current 'stack' is consistenly built. I clearly saw this a lot over the year with geospatial packages. The difficulty with this Seurat-based stack is again that it involves so many packages.

@mihem It all works for me. You could, as @mlin suggests, unset ccache but I use ccache and I too have had at times issues with spdlog (when at times I also had the -dev package installed). You are on an older compiler (gcc-11, so Ubuntu 22.04 ?) but if you want to try the binary that is made for Ubuntu 22.04 by r-universe (over is 'my' r-universe which I point at the main rather than the release branch -- this differs from our official docs and is hence not an official recommentation). If you want to try follow this hint by Jeroen and point at these binaries. I worked all this out once as a test even via devcontainers, see this blog post from a few weeks ago where I tied it all together via Docker containers based on Ubuntu 22.04 that run off GitHub devcontainer codespaces (but note that CELLxCENSUS needs the bigger RAM allocation version). All this is inofficial but once 1.5.0 is released we hope to offer similar smoother experience.

@mihem
Copy link
Author

mihem commented Oct 16, 2023

thanks for your responses.

Yes, I am on Ubuntu jammy 22.04 (also see first post environment).

Sorry, maybe I mistunderstood you, but as explained in the first post your tip with installing tiledbsoma_1.4.3-jammy.tar.gz works well, and then installing cellxgene.census works fine, but then I end up memory not mapped error.
I would prefer running this locally, because I want to query a dataset, which I want to align with Seurat, and probably need more memory than codespace provides.

@eddelbuettel
Copy link
Contributor

eddelbuettel commented Oct 16, 2023

Ok, sorry. The codespace mention was an illustration (possibly poorly worded) showing that everything works (well: worked when I wrote the blog post as an illustration/set this up in a Docker environment where all components come from consistently-built Ubuntu 22.04 LTS environment, namely my r-universe which has the 'unreleased' pre-1.5.0 release current tiledbsoma snapshot as a binary when you follow the link about to install them with the specific repo= argument to install.packages()) and CELLxGENE from their r-universe). The other benefit of the codespace is that it makes that recipe public via its script. Note that the script was a illustration from August. When you run it now you may get the same mismatch on object code (as the suspected cause for your issue) as the CELLxGENE may have been matching to the tiledbsoma snapshot at the time.

We are sadly in a bit of pre-release state but our CI also runs the tiledb (R package), tiledbsoma, Seurat, ... packages as Ubuntu 22.04 binaries (via r2u). I think CELLxGENE may just 'fit' with them but I am currently traveling and can't fully tests this for you.

@eddelbuettel
Copy link
Contributor

eddelbuettel commented Oct 16, 2023

Detailed log below but I just

  • installed the r-universe binary of cellxgene.census for Ubuntu 22.04 on my dev machine (running 23.04, that is generally never a problem)
  • that machine has Seurat and most other dependencies compiled from CRAN sources on Ubuntu
  • given that I am TileDB engineer, tiledb (the R package) and tiledbsoma are locally compiled against a current dev built of TileDB Core
  • but you should get close proxies of these (compiled against the last TIleDB Core release though) from my r-universe

So in short we should still be able to get you set up.

This is your script executed line by line in Emacs/ESS and output copied from the Emacs buffer.

> library(cellxgene.census)                                                                                                                                                      
 > census <-  open_soma()                                                                                                                                                         
 The stable Census release is currently 2023-07-25. Specify census_version = "2023-07-25" in future calls to open_soma() to ensure data consistency.                              
 > organism <-  "Homo sapiens"                                                                                                                                                    
 > gene_filter <-  "feature_id %in% c('ENSG00000107317', 'ENSG00000106034')"                                                                                                      
 > cell_filter <-   "cell_type == 'sympathetic neuron'"                                                                                                                           
 > cell_columns <-  c("assay", "cell_type", "tissue", "tissue_general", "suspension_type", "disease")                                                                             
 > seurat_obj <-  get_seurat(                                                                                                                                                     
 + census = census,                                                                                                                                                               
 + organism = organism,                                                                                                                                                           
 + var_value_filter = gene_filter,                                                                                                                                                
 + obs_value_filter = cell_filter,                                                                                                                                                
 + obs_column_names = cell_columns                                                                                                                                                
!+ )                                                                                                                                                                              
 The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,                                                                                                     
 which was just loaded, were retired in October 2023.                                                                                                                             
 Please refer to R-spatial evolution reports for details, especially                                                                                                              
 https://r-spatial.org/r/2023/05/15/evolution4.html.                                                                                                                              
 It may be desirable to make the sf package available;                                                                                                                            
 package maintainers should consider adding sf to Suggests:.                                                                                                                      
 Attaching SeuratObject                                                                                                                                                           
 >                 

@johnkerl
Copy link

johnkerl commented Oct 17, 2023

Hello @mihem -- to repro, I tried using

docker run --rm -ti eddelbuettel/r2u:jammy

as a clean slate

I was able to do the following:

$ docker run --rm -ti eddelbuettel/r2u:jammy

# apt install cmake
# apt install git

> install.packages('tiledbsoma', repos = c('https://tiledb-inc.r-universe.dev', 'https://cloud.r-project.org'))

> install.packages('SeuratObject')

# Rscript -e 'update.packages(ask=FALSE)'

> remotes::install_github(repo="TileDB-Inc/TileDB-R@0.20.3")

(Exit and restart R)

> library(tiledb)
TileDB R 0.20.3 with TileDB Embedded 2.16.2 on Ubuntu 22.04.1 LTS.
See https://tiledb.com for more information about TileDB.

> library(tiledbsoma)

> tiledbsoma::show_package_versions()
tiledbsoma:    1.4.3
tiledb-r:      0.20.3
tiledb core:   2.16.2
libtiledbsoma: libtiledb=2.16.2
R:             R version 4.3.1 (2023-06-16)
OS:            Ubuntu 22.04.1 LTS

As noted above we're in a bit of flux as our 1.5.0 is almost release but not quite yet

Also, this worked well for me -- but I don't have your particular ccache build error -- I can look more deeply into that tomorrow

@mihem
Copy link
Author

mihem commented Oct 18, 2023

Wow, three experts working on this issue.
I must say, you do have an excellent support. :)

I am little confused, why do you start with installingtiledbsoma isn't that the critical one, with the most dependencies?

So if I start running your code, tiledb_0.21.1 and tiledbsoma_1.4.3 are downloaded

install.packages('tiledbsoma', repos = c('https://tiledb-inc.r-universe.dev',
                                                  'https://cloud.r-project.org'))
Installing package into ‘/home/mischko/R/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘tiledb’

trying URL 'https://tiledb-inc.r-universe.dev/src/contrib/tiledb_0.21.1.tar.gz'
Content type 'application/x-gzip' length 920017 bytes (898 KB)
==================================================
downloaded 898 KB

trying URL 'https://tiledb-inc.r-universe.dev/src/contrib/tiledbsoma_1.4.3.tar.gz'
Content type 'application/x-gzip' length 656874 bytes (641 KB)
==================================================
downloaded 641 KB

tiledb works fine, but tiledbsoma fails as previously.

DONE (tiledb)
begin installing package ‘tiledbsoma’
make: *** [Makefile:9: tiledbsoma.ts] Error 1
make: Target 'all' not remade because of errors.
* installing *source* package ‘tiledbsoma’ ...
** using staged installation
-- Install prefix is /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/inst/tiledbsoma.
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/ccache - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/ccache - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Starting TileDB-SOMA superbuild.
-- Could NOT find TileDB (missing: TileDB_DIR)
-- Adding TileDB as an external project
-- Could NOT find spdlog (missing: spdlog_DIR)
-- Adding spdlog as an external project
-- Not found clang-tidy
-- Not found clang-format
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib
make[1]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[2]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[3]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[3]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[3]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
[  4%] Creating directories for 'ep_tiledb'
[  8%] Performing download step (download, verify and extract) for 'ep_tiledb'
-- ep_tiledb download command succeeded.  See also /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_tiledb-stamp/ep_tiledb-download-*.log
[ 12%] No update step for 'ep_tiledb'
[ 16%] No patch step for 'ep_tiledb'
[ 20%] No configure step for 'ep_tiledb'
[ 24%] No build step for 'ep_tiledb'
[ 28%] Performing install step for 'ep_tiledb'
[ 32%] No test step for 'ep_tiledb'
[ 36%] Completed 'ep_tiledb'
make[3]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
[ 36%] Built target ep_tiledb
make[3]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[3]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[3]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
[ 40%] Creating directories for 'ep_spdlog'
[ 44%] Performing download step (download, verify and extract) for 'ep_spdlog'
-- ep_spdlog download command succeeded.  See also /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-download-*.log
[ 48%] No update step for 'ep_spdlog'
[ 52%] Performing patch step for 'ep_spdlog'
patching file include/spdlog/logger-inl.h
[ 56%] Performing configure step for 'ep_spdlog'
CMake Error at /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-RELEASE.cmake:37 (message):
  Command failed: 1

   '/usr/bin/cmake' '-DCMAKE_PREFIX_PATH=/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/install' '-DCMAKE_INSTALL_PREFIX=/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/install' '-DCMAKE_OSX_ARCHITECTURES=' '-DCMAKE_BUILD_TYPE=RELEASE' '-DCMAKE_CXX_COMPILER=/usr/bin/ccache' '-DCMAKE_C_COMPILER=/usr/bin/ccache' '-DCMAKE_TOOLCHAIN_FILE=' '-DCMAKE_POSITION_INDEPENDENT_CODE=ON' '-DSPDLOG_BUILD_SHARED=OFF' '-GUnix Makefiles' '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog'

  See also

    /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-*.log


-- stdout output is:
-- The CXX compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/ccache
-- Check for working CXX compiler: /usr/bin/ccache - broken
-- Configuring incomplete, errors occurred!
See also "/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeOutput.log".
See also "/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeError.log".

-- stderr output is:
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler

    "/usr/bin/ccache"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_2d27e/fast && gmake[4]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    make  -f CMakeFiles/cmTC_2d27e.dir/build.make CMakeFiles/cmTC_2d27e.dir/build
    make[5]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_2d27e.dir/testCXXCompiler.cxx.o
    /usr/bin/ccache   -g -O2  -o CMakeFiles/cmTC_2d27e.dir/testCXXCompiler.cxx.o -c /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    /usr/bin/ccache: invalid option -- 'g'
    make[5]: *** [CMakeFiles/cmTC_2d27e.dir/build.make:78: CMakeFiles/cmTC_2d27e.dir/testCXXCompiler.cxx.o] Error 1
    make[5]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    gmake[4]: *** [Makefile:127: cmTC_2d27e/fast] Error 2
    gmake[4]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-build/CMakeFiles/CMakeTmp'
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:13 (project)



CMake Error at /tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-RELEASE.cmake:47 (message):
  Stopping after outputting logs.


make[3]: *** [CMakeFiles/ep_spdlog.dir/build.make:93: externals/src/ep_spdlog-stamp/ep_spdlog-configure] Error 1
make[3]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[2]: *** [CMakeFiles/Makefile2:115: CMakeFiles/ep_spdlog.dir/all] Error 2
make[2]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[1]: *** [Makefile:91: all] Error 2
make[1]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[1]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[2]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[3]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[4]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[4]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[4]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
Error: could not load cache
make[4]: *** [CMakeFiles/install-libtiledbsoma.dir/build.make:70: CMakeFiles/install-libtiledbsoma] Error 1
make[4]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[3]: *** [CMakeFiles/Makefile2:168: CMakeFiles/install-libtiledbsoma.dir/all] Error 2
make[3]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[2]: *** [CMakeFiles/Makefile2:175: CMakeFiles/install-libtiledbsoma.dir/rule] Error 2
make[2]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
make[1]: *** [Makefile:163: install-libtiledbsoma] Error 2
make[1]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src/libtiledbsoma/build-lib'
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
using C++17
make[1]: Entering directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src'
g++ -std=gnu++17 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I. -I../inst/include/ -I../inst/tiledb/include -I../inst/tiledbsoma/include   -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/RcppSpdlog/include' -I/usr/local/include    -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
../inst/include/tiledbsoma_types.h:21:10: fatal error: tiledbsoma/tiledbsoma: No such file or directory
   21 | #include <tiledbsoma/tiledbsoma>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/opt/R/4.3.1/lib/R/etc/Makeconf:200: RcppExports.o] Error 1
make[1]: Leaving directory '/tmp/RtmpZBYSI6/R.INSTALL1245d15123bf2d/tiledbsoma/src'
ERROR: compilation failed for package ‘tiledbsoma’

When I start with installing tiledb 0.20.3 compilation works fine (as does the 0.21.1 version), but compilation of tiledbsoma fails the same way.

@johnkerl
Copy link

johnkerl commented Oct 18, 2023

I am little confused, why do you start with installingtiledbsoma isn't that the critical one, with the most dependencies?

@mihem the issue is that R doesn't allow upper-bound pins, and tiledb-r 0.21 has appeared since tiledbsoma 1.4.3 (which needs tiledb-r 0.20). So we indeed install tiledbsoma, then update the tiledb-r package to be 0.20. (This situation will disappear once we release 1.5.0 (which uses tiledb-r 0.21), and that 1.5.0 release will be soon. The current situation admits a non-ideal workaround.)

When I start with installing tiledb 0.20.3 compilation works fine (as does the 0.21.1 version), but compilation of tiledbsoma fails the same way.

This checks out with what I saw above namely:

Also, this worked well for me -- but I don't have your particular ccache build error -- I can look more deeply into that tomorrow

This is a bit odd:

  The C++ compiler

    "/usr/bin/ccache"

  is not able to compile a simple test program.

and I will indeed look into this more deeply today.

My apologies for the inconvenience, and thank you!

@johnkerl
Copy link

@mihem can you please share your cmake --version?

@mihem
Copy link
Author

mihem commented Oct 18, 2023

sure, cmake version 3.22.1

@johnkerl
Copy link

johnkerl commented Oct 18, 2023

@mihem I also have cmake version 3.22.1 on docker run --rm -ti eddelbuettel/r2u:jammy

I believe the sole issue right now is why on your system cmake is detecting /usr/bin/ccache as a C compiler (it is not a C compiler) 🤔

@eddelbuettel
Copy link
Contributor

eddelbuettel commented Oct 18, 2023

(I do not think ccache is to blame. I just built it with and without (but setting / unsetting one line in my ~/.R/Makevars)

(I suspect different versions of cmake simple report a different string. I get

-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 12.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

under Ubuntu 23.04 and cmake 3.25.1)

@johnkerl
Copy link

johnkerl commented Oct 18, 2023

@mihem with regard to https://ccache.dev/manual/4.8.3.html#_run_modes can we please check on your system:

which ccache
which gcc
which g++
ls -l $(which ccache)
ls -l $(which gcc)
ls -l $(which g++)

Can you please run all six of these and send me all their outputs? Thank you!

@johnkerl
Copy link

@mihem also env | grep CXX please

@eddelbuettel
Copy link
Contributor

eddelbuettel commented Oct 18, 2023

@johnkerl Recall that the build is started from R and in a shell spawned from R so settings as this (here from my box) may also come in when R is calling out.

#VER=-13                                                                                
CCACHE=ccache                                                                           
CC=$(CCACHE) gcc$(VER)                                                                  
CXX=$(CCACHE) g++$(VER)                                                                 
CXX11=$(CCACHE) g++$(VER) #-std=c++11                                                   
CXX14=$(CCACHE) g++$(VER) #-std=c++14                                                   
CXX17=$(CCACHE) g++$(VER) #-std=c++17   

Hence eg

$ R CMD config CXX
ccache g++
$ R CMD config CXX17
ccache g++
$ 
$ R CMD config CC
ccache gcc
$ 

which under normal settings gets back to the ones in the $PATH,

@mihem
Copy link
Author

mihem commented Oct 18, 2023

which ccache
which gcc
which g++
ls -l $(which ccache)
ls -l $(which gcc)
ls -l $(which g++)

/usr/bin/ccache
/usr/bin/gcc
/usr/bin/g++
-rwxr-xr-x 1 root root 1080720 Nov 17  2021 /usr/bin/ccache
lrwxrwxrwx 1 root root 6 Aug  5  2021 /usr/bin/gcc -> gcc-11
lrwxrwxrwx 1 root root 6 Aug  5  2021 /usr/bin/g++ -> g++-11

and Dirks ideas

 R CMD config CXX  
ccache g++
R CMD config CXX17
g++
R CMD config CC   
ccache gcc

@johnkerl
Copy link

@mihem aha, I have indeed

ubuntu@anzo$ docker run --rm -ti eddelbuettel/r2u:jammy

root@46f1ade47451:/# R CMD config CXX
g++ -std=gnu++17

root@46f1ade47451:/# R CMD config CC
gcc

@eddelbuettel
Copy link
Contributor

@mihem If you have a ~/.R/Makevars maybe add CXX17 entries too:

$ grep CXX17 .R/Makevars 
CXX17FLAGS=             -g -O3 -Wall -pipe $(PEDANTIC) $(XTRAFLAGS) $(LTO)
CXX17=$(CCACHE) g++$(VER) #-std=c++17
SHLIB_CXX17LDFLAGS = $(STRIP) -shared $(LTO_LD)
$ 

It's a bit confusing but I think CXX is more or less ignore if C++17 is selected as compilation standard (as we do)

Ditto @johnkerl You need R CMD config CXX17 for C++17. Setting CXX (the plain one) to g++ and enforcing C++17 there is a little non-standard. Though it comes out the same, it still make ALL compilations C++17. That may be a source of difference, intended or not.

(At least I think I have this right. Details in Writiing R Extensions as always.)

@johnkerl
Copy link

johnkerl commented Oct 18, 2023

@mihem can you please show us your ~/.R/Makevars?

@eddelbuettel
Copy link
Contributor

eddelbuettel commented Oct 18, 2023

@mihem I think John was right all along -- while I am a huge fanboy of ccache I can replicate the issue inside a Docker container: if and when I tell R to use ccache via ~/.R/Makevars then the spdlog part of the superbuild falls over. That is something I would not often see during development ... as I tend to have spdlog instally locally so no superbuild for me.

PS It also no longer is an issue for us in dev all the cmake use was rewritten for vcpkg. That should be in 2.18 or beyond,

@mihem
Copy link
Author

mihem commented Oct 18, 2023

Intersting.
So my old Makevars was:

VER=
CCACHE=ccache
CC=$(CCACHE) gcc$(VER)
CXX=$(CCACHE) g++$(VER)
CXX11=$(CCACHE) g++$(VER)
CXX14=$(CCACHE) g++$(VER)
FC=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)

I then added a line for CXX17 as Dirk suggested (not sure if FLAGS were needed

VER=
CCACHE=ccache
CC=$(CCACHE) gcc$(VER)
CXX11=$(CCACHE) g++$(VER)
CXX14=$(CCACHE) g++$(VER)
FC=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)
CXX17=$(CCACHE) g++$(VER) #-std=c++17

Now it doesn't stop with 56% but at 88%

* installing *source* package ‘tiledbsoma’ ...
** using staged installation
-- Install prefix is /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/inst/tiledbsoma.
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/ccache - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Starting TileDB-SOMA superbuild.
-- Could NOT find TileDB (missing: TileDB_DIR)
-- Adding TileDB as an external project
-- Could NOT find spdlog (missing: spdlog_DIR)
-- Adding spdlog as an external project
-- Not found clang-tidy
-- Not found clang-format
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib
[  4%] Creating directories for 'ep_tiledb'
[  8%] Performing download step (download, verify and extract) for 'ep_tiledb'
-- ep_tiledb download command succeeded.  See also /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_tiledb-stamp/ep_tiledb-download-*.log
[ 12%] No update step for 'ep_tiledb'
[ 16%] No patch step for 'ep_tiledb'
[ 20%] No configure step for 'ep_tiledb'
[ 24%] No build step for 'ep_tiledb'
[ 28%] Performing install step for 'ep_tiledb'
[ 32%] No test step for 'ep_tiledb'
[ 36%] Completed 'ep_tiledb'
[ 36%] Built target ep_tiledb
[ 40%] Creating directories for 'ep_spdlog'
[ 44%] Performing download step (download, verify and extract) for 'ep_spdlog'
-- ep_spdlog download command succeeded.  See also /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-download-*.log
[ 48%] No update step for 'ep_spdlog'
[ 52%] Performing patch step for 'ep_spdlog'
patching file include/spdlog/logger-inl.h
[ 56%] Performing configure step for 'ep_spdlog'
-- ep_spdlog configure command succeeded.  See also /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-configure-*.log
[ 60%] Performing build step for 'ep_spdlog'
-- ep_spdlog build command succeeded.  See also /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-build-*.log
[ 64%] Performing install step for 'ep_spdlog'
-- ep_spdlog install command succeeded.  See also /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/externals/src/ep_spdlog-stamp/ep_spdlog-install-*.log
[ 68%] Completed 'ep_spdlog'
[ 68%] Built target ep_spdlog
[ 72%] Creating directories for 'libtiledbsoma'
[ 76%] No download step for 'libtiledbsoma'
[ 80%] No update step for 'libtiledbsoma'
[ 84%] No patch step for 'libtiledbsoma'
[ 88%] Performing configure step for 'libtiledbsoma'
-- Install prefix is /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/inst/tiledbsoma.
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/ccache
-- Check for working C compiler: /usr/bin/ccache - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/bin/ccache"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_58b29/fast && gmake[3]: Entering directory '/tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeTmp'
    make  -f CMakeFiles/cmTC_58b29.dir/build.make CMakeFiles/cmTC_58b29.dir/build
    make[4]: Entering directory '/tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_58b29.dir/testCCompiler.c.o
    /usr/bin/ccache   -g -O2  -o CMakeFiles/cmTC_58b29.dir/testCCompiler.c.o -c /tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeTmp/testCCompiler.c
    /usr/bin/ccache: invalid option -- 'g'
    make[4]: *** [CMakeFiles/cmTC_58b29.dir/build.make:78: CMakeFiles/cmTC_58b29.dir/testCCompiler.c.o] Error 1
    make[4]: Leaving directory '/tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeTmp'
    gmake[3]: *** [Makefile:127: cmTC_58b29/fast] Error 2
    gmake[3]: Leaving directory '/tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeTmp'
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:144 (project)


-- Configuring incomplete, errors occurred!
See also "/tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeOutput.log".
See also "/tmp/RtmpHF2KxH/R.INSTALL12b8af52409592/tiledbsoma/src/libtiledbsoma/build-lib/libtiledbsoma/CMakeFiles/CMakeError.log".
make[2]: *** [CMakeFiles/libtiledbsoma.dir/build.make:94: libtiledbsoma-prefix/src/libtiledbsoma-stamp/libtiledbsoma-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/libtiledbsoma.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
gmake[4]: Makefile: No such file or directory
gmake[4]: *** No rule to make target 'Makefile'.  Stop.
make[3]: *** [CMakeFiles/install-libtiledbsoma.dir/build.make:70: CMakeFiles/install-libtiledbsoma] Error 2
make[2]: *** [CMakeFiles/Makefile2:168: CMakeFiles/install-libtiledbsoma.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:175: CMakeFiles/install-libtiledbsoma.dir/rule] Error 2
make: *** [Makefile:163: install-libtiledbsoma] Error 2
** libs
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
using C++17
ccache g++  -std=gnu++17 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I. -I../inst/include/ -I../inst/tiledb/include -I../inst/tiledbsoma/include   -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I'/home/mischko/R/x86_64-pc-linux-gnu-library/4.3/RcppSpdlog/include' -I/usr/local/include    -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
../inst/include/tiledbsoma_types.h:21:10: fatal error: tiledbsoma/tiledbsoma: No such file or directory
   21 | #include <tiledbsoma/tiledbsoma>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/opt/R/4.3.1/lib/R/etc/Makeconf:200: RcppExports.o] Error 1
ERROR: compilation failed for package ‘tiledbsoma’

@eddelbuettel
Copy link
Contributor

eddelbuettel commented Oct 18, 2023

Could you humour us and please remove the setting for ccache as both John and I suggested? Commenting out CCACHE-ccache is all it takes, Just put # in front.

@mihem
Copy link
Author

mihem commented Oct 18, 2023

Ah, I am sorry, I didn't get that before.

Yes, now tiledbsoma is compiling successfully.
Great work.

However, unfortunately i still canno access any data via cellxgene census. I stilll get

cell_metadata <-  census$get("census_data")$get("homo_sapiens")$get("obs")
> cell_metadata <-  cell_metadata$read(
   value_filter = "sex == 'female' & cell_type %in% c('microglial cell', 'neuron')",
   column_names = c("assay", "cell_type", "sex", "tissue", "tissue_general", "suspension_type", "disease")
)


 *** caught segfault ***
address 0x7ffcfeeb3000, cause 'memory not mapped'

Traceback:
 1: sr_setup(uri = self$uri, config = cfg, colnames = column_names,     qc = value_filter, dim_points = coords, timestamp_end = private$tiledb_timestamp,     loglevel = log_level)
 2: cell_metadata$read(value_filter = "sex == 'female' & cell_type %in% c('microglial cell', 'neuron')",     column_names = c("assay", "cell_type", "sex", "tissue", "tissue_general",         "suspension_type", "disease"))

sessionInfo

R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=de_DE.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Berlin
tzcode source: system (glibc)

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

other attached packages:
[1] RcppSpdlog_0.0.14      cellxgene.census_1.6.0

loaded via a namespace (and not attached):
 [1] Matrix_1.6-1.1      bit_4.0.5           jsonlite_1.8.7     
 [4] dplyr_1.1.3         compiler_4.3.1      tidyselect_1.2.0   
 [7] Rcpp_1.0.11         xml2_1.3.5          urltools_1.7.3     
[10] assertthat_0.2.1    tiledbsoma_1.4.4    arrow_13.0.0.1     
[13] triebeard_0.4.1     lattice_0.21-9      RcppCCTZ_0.2.12    
[16] R6_2.5.1            generics_0.1.3      curl_5.1.0         
[19] tiledb_0.21.1       tibble_3.2.1        aws.s3_0.3.21      
[22] pillar_1.9.0        rlang_1.1.1         utf8_1.2.3         
[25] fs_1.6.3            bit64_4.0.5         cli_3.6.1          
[28] magrittr_2.0.3      spdl_0.0.5          digest_0.6.33      
[31] grid_4.3.1          base64enc_0.1-3     lifecycle_1.0.3    
[34] vctrs_0.6.3         nanotime_0.3.7      glue_1.6.2         
[37] data.table_1.14.8   zoo_1.8-12          aws.signature_0.6.0
[40] fansi_1.0.5         purrr_1.0.2         httr_1.4.7         
[43] tools_4.3.1         pkgconfig_2.0.3  

@johnkerl
Copy link

johnkerl commented Oct 18, 2023

@mihem thank you -- can you please show us the output of tiledbsoma::show_package_versions()?

(Actually I can already see in the above that you have tiledb 0.21.1 whereas for tiledbsoma 1.4.3 we need to be at 0.20.3.)

You should be able to do

Rscript -e 'remotes::install_github(repo="TileDB-Inc/TileDB-R@0.20.3")'

Then re-enter R.

@eddelbuettel
Copy link
Contributor

Phew. I am truly sorry for (as a card-carrying member of 'team ccache) having sent us astray there for a bit.

Now, the segfaults. John, Paul H, and I have seen that too. The harder part is that the package tail gets longer. One issue we had recently is that package Matrix had a subtle change in its S4 signatures -- which get cached at installation of packages using it, and R on Linux has not mechanism to force rebuilds 😿 . But the primary cause, as John mentioned may be mismatch tiledb-r and tiledbsoma meaning different TileDB Core versions are used in two places.

An old school alternative to the remotes call is to fetch the 0.20.3 source tarball (from GitHub or CRAN) and run R CMD INSTALL on it. remotes wraps that.

@mihem
Copy link
Author

mihem commented Oct 18, 2023

Ah, sorry, you already explained that earlier.

So after downgrading to 0.20.3 it finally works 😂 .

So no ccache and tiledb version 0.20.3. Not very intuitive, so maybe a note on the homepage for users would be useful (of course not if you solve it soon in the next version).

(Hehe. Wouldn't never have thought that you were not right from the very beginning about an issue with C++ in R)

Thanks for your great support, both of you!

@eddelbuettel
Copy link
Contributor

We are truly sorry for this. But we are working really really hard on getting the SOMA 1.5.0 release out, with feature parity between Python and R, and as it goes found a bug to fix here to there but it is ... "really close". Should be simpler afterwards.

The core issue here is a somewhat direct attempt at version pinning but as you noticed there are different versions under the hood. It's tricky. When everything is aligned it ... just works (TM) as it should.

@mihem
Copy link
Author

mihem commented Oct 18, 2023

No need to apologize, I absolutely understand.

I just saw this post on Twitter
https://twitter.com/satijalab/status/1688637421028601856

And thought I give it a quick shot .. and other biologist/physicians with limited C++ knowledge might too.

I really appreciate that you also support R because Seurat is still the most popular tool in the single cell community I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants