Contents

1 Motivation

Rhdf5lib provides versions of the C and C++ HDF5 libraries. It is primarily useful to developers of other R packages who want to make use of the capabilities of the HDF5 library directly in the C or C++ code of their own packages, rather than using a higher level interface such as the rhdf5 package. Using Rhdf5lib makes life easier for users, as they do not have to worry about installing libraries at a system level, and for developers since they can work with a defined version of the library rather than developing strategies to cope with the potential for multiple versions.

Rhdf5lib is very much inspired by the zlibbioc and Rhtslib packages.

2 Usage

There is an example package, usingRhdf5lib, that demonstrates how packages should link to Rhdf5lib.

2.2 Locating the library headers

In order for the C/C++ compiler to find the HDF5 headers during package installation, add Rhdf5lib to the LinkingTo field of the DESCRIPTION file of your package, e.g.

LinkingTo: Rhdf5lib

In you C or C++ code files, you can then use the standard include techniques, e.g., #include "hdf5.h" or #include "H5Cpp.h". You can inspect the header files manually to check their names and declared functions. To find their location on your system you can use the following code:

system.file(package="Rhdf5lib", "include")
## [1] "/tmp/RtmphufY4W/Rinst34d44f2b61068c/Rhdf5lib/include"

3 Configuration arguments for non-standard system setups

Because potential issues are likely to be different with the switch to a CMake build system, we start from a clean slate and have not implemented any of the configuration options that were available in the previous version of Rhdf5lib. If you have a non-standard system setup and would like to see support for it, please open an issue on the GitHub repository for this package.

4 Funding

MLS was supported by the BMBF-funded Heidelberg Center for Human Bioinformatics (HD-HuB) within the German Network for Bioinformatics Infrastructure (de.NBI), Grant Number #031A537B

Session info

## R Under development (unstable) (2026-03-05 r89546)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.4 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.23-bioc/R/lib/libRblas.so 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: America/New_York
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] BiocStyle_2.39.0
## 
## loaded via a namespace (and not attached):
##  [1] digest_0.6.39       R6_2.6.1            bookdown_0.46      
##  [4] fastmap_1.2.0       xfun_0.56           cachem_1.1.0       
##  [7] knitr_1.51          htmltools_0.5.9     rmarkdown_2.30     
## [10] lifecycle_1.0.5     cli_3.6.5           sass_0.4.10        
## [13] jquerylib_0.1.4     compiler_4.6.0      tools_4.6.0        
## [16] evaluate_1.0.5      bslib_0.10.0        yaml_2.3.12        
## [19] otel_0.2.0          BiocManager_1.30.27 jsonlite_2.0.0     
## [22] rlang_1.1.7