About the project
The h5py package is a Pythonic interface to the HDF5 binary data format.
Install Hdf5 Library
It lets you store huge amounts of numerical data, and easily manipulate that data from NumPy. For example, you can slice into multi-terabyte datasets stored on disk, as if they were real NumPy arrays. Thousands of datasets can be stored in a single file, categorized and tagged however you want.
Headers are 1.10.4, library is 1.10.5 SUMMARY OF THE HDF5 CONFIGURATION General Information: - HDF5 Version: 1.10.5 Configured on: 2019-03-04 Configured by: Visual Studio 14 2015 Win64 Host system: Windows-10.0.17763 Uname information: Windows Byte sex: little-endian Installation point: C:/Program Files/HDF5 Compiling Options: - Build Mode: Debugging Symbols: Asserts: Profiling: Optimization Level: Linking Options: - Libraries: Statically Linked Executables: OFF LDFLAGS. INSTALL - Start Here. General instructions for compiling and installing the library INSTALLCMAKE - instructions for building with CMake (Kitware.com) INSTALLparallel - instructions for building and configuring Parallel HDF5 INSTALLWindows and INSTALLCygwin - MS Windows installations. HDF5 is a data model, library, and file format for storing and managing data.
H5py uses straightforward NumPy and Python metaphors, like dictionary and NumPy array syntax. For example, you can iterate over datasets in a file, or check out the .shape or .dtype attributes of datasets. You don't need to know anything special about HDF5 to get started.
In addition to the easy-to-use high level interface, h5py rests on a object-orientedCython wrapping of the HDF5 C API. Almost anything you can do from C in HDF5, you can dofrom h5py.
Best of all, the files you create are in a widely-used standard binary format, which you can exchange with other people, including those who use programs like IDL and MATLAB.
Stable Downloads
Install Hdf5 Library Windows
All downloads are now available at the Python Package Index (PyPI).
Check out the install guide.
Development
All development for h5py takes place on GitHub. Before sending a pullrequest, please ping the mailing list at Google Groups.
Documentation
The h5py user manual is a great place to start; you may also want to check out the FAQ.
There's an O'Reilly book, Python and HDF5, written by the lead author of h5py, Andrew Collette.
General questions are always welcome on the mailing list.
If you are a computational fluid dynamics (CFD) practitioner, at some point, you would have to use Hierarchical Data Format 5 (HDF5) and CFD General Notation System (CGNS) libraries in your programs. HDF5 format provides an advanced way of organizing any data and allows efficient access to the data. CGNS prescribes specific methods and practices to use when writing CFD simulation data into HDF5 format. You can find more info on everything about these libraries in their website. But here, I describe the way to install HDF5 & CGNS in a Ubuntu 18.04 system.
The installation procedure follows what is given in CGNS website, but with some important tweaks to get it to succeed installing in Ubuntu 18.04.
Download the CGNS source code into some directory.
Currently, this downloads CGNS 3.4.0 source code into a directory named CGNS
in the present location. Although you can install HDF5 separately, and possibly a newer version from HDF5 website, I strongly advise against it. We want the CGNS library to work with our HDF5 installation. So, it is best to install the HDF5 version suggested by CGNS.
Change into the CGNS directory.
There are install scripts provided in the bin
folder. Three of them in fact, one to install HDF5 (./bin/install-hdf.sh
), another to configure CGNS for our system (./bin/config-cgns.sh
) and the last one to install the configured CGNS (./bin/build-cgns.sh
). Of course, we need to do the installation in the order I have listed.
You can choose to use the install-hdf.sh
script. Some options inside that script failed for me. So, instead, use the following commands:
This will download the HDF5 v1.8 into the newly created directory hdf5_1_8
. Change into this directory and use the following command:
Note that I am choosing to install HDF5 in the location $HOME/hdf5
, you can choose any other convenient location as well. But remember, this is the location you need to link any program trying to compile with HDF5 libraries.
The installation of HDF5 will take some time, and finally it will output the HDF5 configuration installed in the system. I have configured HDF5 to include Fortran bindings as well by the flag --enable-fortran
. If you only want C binidings, you can replace that by --disable-fortran
.
After this, we need to configure CGNS using the ./bin/config-cgns.sh
script. The default script looks like this:
Edit it to look like this:
Apart from some specific modifications to make it work for Ubuntu, I have also specified the CGNS installation directory as $HOME/cgns
. You can change this to any other convenient location. But again, this is where the built CGNS libraries and headers will be kept. You will be required to link to this location when compiling and linking programs with CGNS.
(If you have installed the HDF5 to some location other than $HOME/hdf5
, you should specify that here in the flag --with-hdf5=
)
Run this configure script using:
This will configure the CGNS for your system.
Finally, install CGNS using:
That’s it. You have installed HDF5 & CGNS in your Ubuntu system at $HOME/hdf5
and $HOME/cgns
respectively.
There are test codes available inside the downloaded CGNS repo at: ./CGNS/src/Test_UserGuideCode
. They would have been tested during the build process as well.
If you have a program test.c
which uses CGNS functions, then you would want to compile and link the program as follows:
test.out
is the final executable created for the program.
Notice that we have chose not to install the utility tools for CGNS by choosing the flag --disable-cgnstools
in out configure script. Enabling this fails for me. I tried to install cgnstools using various other methods as well, but it fails for me in Ubuntu 18.04.
HDFVIEW
If you want a GUI for viewing your CGNS/HDF5 files, you may want to use HDFVIEW software. Note that the hdfview
available in ubuntu repositories does not work. Even the source code compilation process always fails in ubuntu. Just download the prebuilt binary for CentOS7 from the HDF website. And run the HDFView-3.1.0-Linux.sh
script inside the downloaded archive to create the binary. It works properly in Ubuntu 18.04. I found this useful tip from Michael Hirsch’s blog.