R packages install_hdf5r
- Create Time: 2022-02-11
- Update Time: 2022-02-11
Processes
mkdir -p $HOME/lib $HOME/softwares $HOME/tmp
export LD_LIBRARY_PATH=$HOME/lib/:${LD_LIBRARY_PATH}
cd $HOME/tmp
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.4/src/hdf5-1.10.4.tar.gz
tar -zxvf hdf5-1.10.4.tar.gz
cd hdf5-1.10.4
./configure --prefix=$HOME/softwares/hdf5
make
make install
cd $HOME/lib
ln -s $HOME/softwares/hdf5/lib/* ./
# Then you could install the package: hdf5r in the R environment
In the R environment
install.packages('hdf5r')
TL;DR
The R package, hdf5r, is the interface of hdf5, so it is necessary to have the hdf5, without r in the name, package installed. It will be easier if we had root permission, but it is still installable using an non-root account. Here I will explain the processes above.
Why I created three directories?
This process is not necessary for installing package but useful for well organising the structures of the server. I created three directories:
$HOME/lib
to place all the libraries;$HOME/softwares
to place different softwares;$HOME/tmp
to place the temporary files or source files, which could be removed without any worrying.
So here I went to $HOME/tmp
directory to download the source file of the hdf5
, I could delete everything in the directory after I installed.
Also, I will put all the soft-links of the libraries in the $HOME/lib
, so that telling the system to find the libraries in that directory is enough, which was done by export LD_LIBRARY_PATH=$HOME/lib/:${LD_LIBRARY_PATH}
.
Can I use another later version hdf5 package?
I don’t know about other later versions, but I have tried the latest one (version 1.13), it didn’t work.