Install hdf5r package in R 4.0.2

Page content

While installing the R package “hdf5r” version 1.3.3, I encountered the error:

fatal error: hdf5.h: No such file or directory
 #include <hdf5.h>
compilation terminated.

My OS is Debian buster/10.6, and the package “libhdf5-dev” has been installed. It looks R cannot find the path of hdf5 header and library files.

It has been resolved by:

1. Export environment variables for header files

export C_INCLUDE_PATH=/usr/include/hdf5/serial/:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/include/hdf5/serial/:$CPLUS_INCLUDE_PATH

2. Create symbolic links for library files

cd /usr/lib/x86_64-linux-gnu/
sudo ln -s
sudo ln -s

3. Install package “hdf5r”


Now there would be OK.