grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
59 stars 22 forks source link

ERROR: compilation failed for package ‘rhdf5’ #127

Closed PengZhang1995 closed 8 months ago

PengZhang1995 commented 1 year ago

When I was installing rhdf5 in the Ubantu system, I encountered an error.

H5R.c: In function ‘_H5Rdereference’:
H5R.c:90:51: error: incompatible type for argument 3 of ‘H5Rdereference1’
   90 |   hid_t obj = H5Rdereference(obj_id, H5P_DEFAULT, ref_type, ref);
      |                                                   ^~~~~~~~
      |                                                   |
      |                                                   H5R_type_t {aka enum H5R_type_t}
In file included from /usr/share/R/include/hdf5.h:36,
                 from myhdf5.h:11,
                 from H5R.h:8,
                 from H5R.c:1:
/usr/share/R/include/H5Rpublic.h:95:77: note: expected ‘const void *’ but argument is of type ‘H5R_type_t’ {aka ‘enum H5R_type_t’}
   95 | H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref);
      |                                                                 ~~~~~~~~~~~~^~~
In file included from /usr/share/R/include/H5public.h:32,
                 from /usr/share/R/include/hdf5.h:22,
                 from myhdf5.h:11,
                 from H5R.h:8,
                 from H5R.c:1:
/usr/share/R/include/H5version.h:685:26: error: too many arguments to function ‘H5Rdereference1’
  685 |   #define H5Rdereference H5Rdereference1
      |                          ^~~~~~~~~~~~~~~
H5R.c:90:15: note: in expansion of macro ‘H5Rdereference’
   90 |   hid_t obj = H5Rdereference(obj_id, H5P_DEFAULT, ref_type, ref);
      |               ^~~~~~~~~~~~~~
In file included from /usr/share/R/include/hdf5.h:36,
                 from myhdf5.h:11,
                 from H5R.h:8,
                 from H5R.c:1:
/usr/share/R/include/H5Rpublic.h:95:14: note: declared here
   95 | H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref);
      |              ^~~~~~~~~~~~~~~
make: *** [/usr/lib/R/etc/Makeconf:191: H5R.o] Error 1
ERROR: compilation failed for package ‘rhdf5’
sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 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/liblapack.so.3;  LAPACK version 3.9.0

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

time zone: Asia/Shanghai
tzcode source: system (glibc)

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

other attached packages:
 [1] sessioninfo_1.2.2           igraph_1.4.2                qgraph_1.9.4               
 [4] psych_2.3.3                 stringr_1.5.0               reshape2_1.4.4             
 [7] dplyr_1.1.2                 RColorBrewer_1.1-3          viridis_0.6.2              
[10] viridisLite_0.4.1           cowplot_1.1.1               pheatmap_1.0.12            
[13] ComplexHeatmap_2.15.3       celldex_1.9.0               SingleR_2.1.0              
[16] SummarizedExperiment_1.29.1 GenomicRanges_1.51.4        GenomeInfoDb_1.35.17       
[19] MatrixGenerics_1.11.1       matrixStats_0.63.0          org.Hs.eg.db_3.17.0        
[22] AnnotationDbi_1.61.2        IRanges_2.33.1              S4Vectors_0.37.7           
[25] Biobase_2.59.0              BiocGenerics_0.45.3         clusterProfiler_4.7.1      
[28] enrichplot_1.19.2           clustree_0.5.0              ggraph_2.1.0               
[31] ggplot2_3.4.2               harmony_0.1.1               Rcpp_1.0.10                
[34] SoupX_1.6.2                 SeuratObject_4.1.3          Seurat_4.3.0               

loaded via a namespace (and not attached):
  [1] spatstat.sparse_3.0-1         bitops_1.0-7                  HDO.db_0.99.1                
  [4] httr_1.4.5                    doParallel_1.0.17             backports_1.4.1              
  [7] tools_4.3.0                   sctransform_0.3.5             utf8_1.2.3                   
 [10] R6_2.5.1                      lazyeval_0.2.2                uwot_0.1.14                  
 [13] GetoptLong_1.0.5              withr_2.5.0                   sp_1.6-0                     
 [16] gridExtra_2.3                 fdrtool_1.2.17                progressr_0.13.0             
 [19] cli_3.6.1                     spatstat.explore_3.1-0        scatterpie_0.1.9             
 [22] spatstat.data_3.0-1           ggridges_0.5.4                pbapply_1.7-0                
 [25] pbivnorm_0.6.0                yulab.utils_0.0.6             foreign_0.8-84               
 [28] gson_0.1.0                    DOSE_3.25.0                   parallelly_1.35.0            
 [31] rstudioapi_0.14               RSQLite_2.3.1                 shape_1.4.6                  
 [34] generics_0.1.3                gridGraphics_0.5-1            gtools_3.9.4                 
 [37] ica_1.0-3                     spatstat.random_3.1-4         GO.db_3.17.0                 
 [40] Matrix_1.5-4                  fansi_1.0.4                   abind_1.4-5                  
 [43] lifecycle_1.0.3               yaml_2.3.7                    qvalue_2.31.1                
 [46] BiocFileCache_2.7.2           Rtsne_0.16                    lavaan_0.6-15                
 [49] blob_1.2.4                    promises_1.2.0.1              ExperimentHub_2.7.1          
 [52] crayon_1.5.2                  miniUI_0.1.1.1                lattice_0.21-8               
 [55] beachmat_2.15.2               KEGGREST_1.39.0               knitr_1.42                   
 [58] pillar_1.9.0                  fgsea_1.25.2                  rjson_0.2.21                 
 [61] corpcor_1.6.10                future.apply_1.10.0           codetools_0.2-19             
 [64] fastmatch_1.1-3               leiden_0.4.3                  glue_1.6.2                   
 [67] downloader_0.4                ggfun_0.0.9                   data.table_1.14.8            
 [70] vctrs_0.6.2                   png_0.1-8                     treeio_1.23.1                
 [73] gtable_0.3.3                  cachem_1.0.7                  xfun_0.39                    
 [76] mime_0.12                     tidygraph_1.2.3               survival_3.5-5               
 [79] iterators_1.0.14              interactiveDisplayBase_1.37.0 ellipsis_0.3.2               
 [82] fitdistrplus_1.1-8            ROCR_1.0-11                   nlme_3.1-162                 
 [85] ggtree_3.7.2                  bit64_4.0.5                   filelock_1.0.2               
 [88] RcppAnnoy_0.0.20              irlba_2.3.5.1                 rpart_4.1.19                 
 [91] KernSmooth_2.23-20            Hmisc_5.0-1                   colorspace_2.1-0             
 [94] DBI_1.1.3                     nnet_7.3-18                   mnormt_2.1.1                 
 [97] tidyselect_1.2.0              bit_4.0.5                     compiler_4.3.0               
[100] curl_5.0.0                    htmlTable_2.4.1               DelayedArray_0.25.0          
[103] plotly_4.10.1                 shadowtext_0.1.2              checkmate_2.1.0              
[106] scales_1.2.1                  lmtest_0.9-40                 quadprog_1.5-8               
[109] rappdirs_0.3.3                digest_0.6.31                 goftest_1.2-3                
[112] spatstat.utils_3.0-2          rmarkdown_2.21                XVector_0.39.0               
[115] base64enc_0.1-3               jpeg_0.1-10                   htmltools_0.5.5              
[118] pkgconfig_2.0.3               sparseMatrixStats_1.11.1      dbplyr_2.3.2                 
[121] fastmap_1.1.1                 GlobalOptions_0.1.2           rlang_1.1.0                  
[124] htmlwidgets_1.6.2             shiny_1.7.4                   DelayedMatrixStats_1.21.0    
[127] farver_2.1.1                  zoo_1.8-12                    jsonlite_1.8.4               
[130] BiocParallel_1.33.12          GOSemSim_2.25.0               BiocSingular_1.15.0          
[133] RCurl_1.98-1.12               magrittr_2.0.3                Formula_1.2-5                
[136] GenomeInfoDbData_1.2.10       ggplotify_0.1.0               patchwork_1.1.2              
[139] munsell_0.5.0                 ape_5.7-1                     reticulate_1.28              
[142] stringi_1.7.12                zlibbioc_1.45.0               MASS_7.3-59                  
[145] AnnotationHub_3.7.4           plyr_1.8.8                    parallel_4.3.0               
[148] listenv_0.9.0                 ggrepel_0.9.3                 deldir_1.0-6                 
[151] Biostrings_2.67.2             graphlayouts_0.8.4            splines_4.3.0                
[154] tensor_1.5                    circlize_0.4.15               spatstat.geom_3.1-0          
[157] ScaledMatrix_1.7.1            BiocVersion_3.17.1            evaluate_0.20                
[160] BiocManager_1.30.20           foreach_1.5.2                 tweenr_2.0.2                 
[163] httpuv_1.6.9                  RANN_2.6.1                    tidyr_1.3.0                  
[166] purrr_1.0.1                   polyclip_1.10-4               clue_0.3-64                  
[169] future_1.32.0                 scattermore_0.8               ggforce_0.4.1                
[172] rsvd_1.0.5                    xtable_1.8-4                  tidytree_0.4.2               
[175] later_1.3.0                   glasso_1.11                   tibble_3.2.1                 
[178] aplot_0.1.10                  memoise_2.0.1                 cluster_2.1.4                
[181] globals_0.16.2
PengZhang1995 commented 1 year ago

PS:

ii  hdf5-helpers                               1.10.4+repack-11ubuntu1             amd64        Hierarchical Data Format 5 (HDF5) - Helper tools
ii  libhdf5-103:amd64                          1.10.4+repack-11ubuntu1             amd64        Hierarchical Data Format 5 (HDF5) - runtime files - serial version
ii  libhdf5-cpp-103:amd64                      1.10.4+repack-11ubuntu1             amd64        Hierarchical Data Format 5 (HDF5) - C++ libraries
ii  libhdf5-dev                                1.10.4+repack-11ubuntu1             amd64        Hierarchical Data Format 5 (HDF5) - development files - serial version
grimbough commented 1 year ago

How are you installing rhdf5? Is it via BiocManager::install() or sudo apt-get install?

PengZhang1995 commented 1 year ago

Thank you for your reply!!!

 BiocManager::install("rhdf5")
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
    CRAN: https://mirrors.tuna.tsinghua.edu.cn/CRAN/
Bioconductor version 3.17 (BiocManager 1.30.20), R 4.3.0 (2023-04-21)
Installing package(s) 'rhdf5'
trying URL 'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.17/bioc/src/contrib/rhdf5_2.43.5.tar.gz'
Content type 'application/octet-stream' length 1249815 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

* installing *source* package ‘rhdf5’ ...
** using staged installation
configure: WARNING: unrecognized options: --with-hdf5
configure: creating ./config.status
config.status: creating src/external_filters.h
configure: WARNING: unrecognized options: --with-hdf5
** libs
using C compiler: ‘gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0’
using C++ compiler: ‘g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0’
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5.c -o H5.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5A.c -o H5A.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5D.c -o H5D.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5E.c -o H5E.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5F.c -o H5F.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5G.c -o H5G.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5I.c -o H5I.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5L.c -o H5L.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5O.c -o H5O.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5P.c -o H5P.o
gcc -I"/usr/share/R/include" -DNDEBUG  -I'/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/Rhdf5lib/include'     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-dIDxrQ/r-base-4.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c H5R.c -o H5R.o
H5R.c: In function ‘_H5Rdereference’:
H5R.c:90:51: error: incompatible type for argument 3 of ‘H5Rdereference1’
   90 |   hid_t obj = H5Rdereference(obj_id, H5P_DEFAULT, ref_type, ref);
      |                                                   ^~~~~~~~
      |                                                   |
      |                                                   H5R_type_t {aka enum H5R_type_t}
In file included from /usr/share/R/include/hdf5.h:36,
                 from myhdf5.h:11,
                 from H5R.h:8,
                 from H5R.c:1:
/usr/share/R/include/H5Rpublic.h:95:77: note: expected ‘const void *’ but argument is of type ‘H5R_type_t’ {aka ‘enum H5R_type_t’}
   95 | H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref);
      |                                                                 ~~~~~~~~~~~~^~~
In file included from /usr/share/R/include/H5public.h:32,
                 from /usr/share/R/include/hdf5.h:22,
                 from myhdf5.h:11,
                 from H5R.h:8,
                 from H5R.c:1:
/usr/share/R/include/H5version.h:685:26: error: too many arguments to function ‘H5Rdereference1’
  685 |   #define H5Rdereference H5Rdereference1
      |                          ^~~~~~~~~~~~~~~
H5R.c:90:15: note: in expansion of macro ‘H5Rdereference’
   90 |   hid_t obj = H5Rdereference(obj_id, H5P_DEFAULT, ref_type, ref);
      |               ^~~~~~~~~~~~~~
In file included from /usr/share/R/include/hdf5.h:36,
                 from myhdf5.h:11,
                 from H5R.h:8,
                 from H5R.c:1:
/usr/share/R/include/H5Rpublic.h:95:14: note: declared here
   95 | H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref);
      |              ^~~~~~~~~~~~~~~
make: *** [/usr/lib/R/etc/Makeconf:191: H5R.o] Error 1
ERROR: compilation failed for package ‘rhdf5’
* removing ‘/home/zhangp/R/x86_64-pc-linux-gnu-library/4.3/rhdf5’
PengZhang1995 commented 1 year ago

BTW,I have tried devtools::install_github('grimbough/rhdf5'),However, the issue has not been solved.

PengZhang1995 commented 1 year ago

The issue has been resolved. Thank you for your response.

sudo cp -r /path/to/Rhdf5lib/include/* /usr/share/R/include/

I really enjoy using your package as it provides great help and support for my research

grimbough commented 1 year ago

I'm glad you found a solution, but you really shouldn't have to move files around. I don't think I've seen hdf5.h in /usr/share/R/include/ before, but that's what's causing the issue.