waqas bhatti / notes / installing hdf5 on debian with C++ support

For some reason, the HDF5 library that comes packaged with Debian doesn't support C++ bindings (this was true as of Debian 7). Since we've switched to using the HDF5 format for all of our light curves and data products, and our pipeline is mostly in C++, we need this enabled. It's fairly straightforward to install the library via the usual ./config, make, make install procedure:

Get the tarball from the HDF5 website. The latest version as of this writing was 1.8.14. Extract the tarball:

[root@server:~] # tar xvfz hdf5-1.8.14.tar.gz

Build the library with C++ support enabled:

[root@server:~] ./configure --prefix=/usr/local --enable-cxx --enable-production
[root@server:~] make -j 16

Install it and tell the linker where to find the library:

[root@server:~] make install
[root@server:~] make check-install # optionally run tests
[root@server:~] echo "/usr/local/lib" > /etc/ld.so.conf.d/h5.conf
[root@server:~] ldconfig

Once it's installed, it should be visible to any C and C++ compilers. If you're using Python in conjunction with HDF5, install the h5py module via pip (this is needed because the Debian h5py package would attempt to pull in the system hdf5 package, which won't work for us). Pytables is another nice package that supports HDF5 and is a bit easier to get started with as compared to h5py.