Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save geyang/dfa69365203639fcde5f2aae73f7d9ac to your computer and use it in GitHub Desktop.
Save geyang/dfa69365203639fcde5f2aae73f7d9ac to your computer and use it in GitHub Desktop.
hdf5 v1.10 upgrade/installation instruction for using single-write-multiple-read (SWMR) in h5py.

The new 1.10 version of hdf5 library is stable. You can now install from the source to use this new capability.

The installation process has a few caveats, so here is how to do it.

Note:

  1. you need to first remove the hdf5 libraries currently installed in ubuntu.
  2. Then you need to reinstall h5py.
  3. when you reinstall h5py via pip, use the --no-binary flag. This is because the h5py wheel comes with its own hdf5 binary.

Instructions:

First search for hdf5 libraries, and then remove all of them.

# do this, to show the list of packages you need to remove
dpkg --get-selections | grep -v deinstall | grep hdf5

# now remove all of then
sudo apt-get uninstall <name of these libraries, should be four of them>

Then install from hdf5 source.

Note: although it says 'patch', it is actually not a patch.

reference

wget https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/hdf5-1.10.0-patch1.tar.gz
tar -xzf hdf5-1.10.0-patch1.tar.gz
cd hdf5-1.10.0-patch1
./configure --prefix=/usr/local --enable-cxx --enable-build-mode=production 
sudo make install

Now reinstall h5py with the --no-binary option.

sudo pip install h5py --no-binary --force-reinstall

Acknowledgement

Thanks to @tacaswell for helping me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment