Install HDF5: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
Line 14: Line 14:


== Install ==
== Install ==

As of HDF5 version 1.9 there is no way to install the MPI and C++ interfaces together.


=== Ubuntu ===
=== Ubuntu ===
Line 27: Line 29:
sudo apt-get install libhdf5-mpich-dev
sudo apt-get install libhdf5-mpich-dev


where 'mpich' can be replaced by 'openmpi' or 'lam'. Unfortunately then the C++ interface is not provided for this MPI version. As of Ubuntu 8.10 and HDF5 1.6.6 there is no way to install the MPI and C++ interfaces together unless you follow the manual installation.
where 'mpich' can be replaced by 'openmpi' or 'lam'. Unfortunately then the C++ interface is not provided for this MPI version. Note that the two version are incompatible.


=== Build and Installation from Sources ===
=== Build and Installation from Sources ===


We will try to install HDF5 1.9 in our user space:
We will try to install the parallel version of HDF5 1.8 in our user space:


mk $HOME/usr
mk $HOME/usr
Line 47: Line 49:
./configure --prefix=$HOME/usr --enable-parallel
./configure --prefix=$HOME/usr --enable-parallel


Other options are described in ./configure --help.
Other options are described in ./configure --help. The opton --enable-cxx can be specified but not together with --enable-parallel.

Revision as of 03:38, 4 February 2009

HDF5 Library

HDF5 is a library for managing large numerical data sets. It is appropriate for saving and retrieving data to/from structured large files. It also supports parallel access to files in HDF5 format, in particular within the MPI environment. HDF5 library can be used from C, C++ and Fortran.

Some popular numerical packages, like MATLAB, Mathematica, Octave and ROOT, already have native support for the HDF5 format. If you want to quickly experiment with HDF5 files, you can use those programs to see how it works.

For example, in Mathematica

 m = RandomInteger[255, {5, 5}]
 Export[ "matrix.h5", m]
 mLoad = Import["matrix.h5", {"Datasets", "/Dataset1"}]

will create a binary file called "matrix.h5" with the matrix data.

Install

As of HDF5 version 1.9 there is no way to install the MPI and C++ interfaces together.

Ubuntu

HDF5 1.6.6 can be installed directly in Ubuntu be doing:

 sudo apt-get install libhdf5-serial-dev

This will install the C, C++ and Fortran versions of the library and development (header) files, but it will not include the MPI version.

The MPI version, (which will remove the previous serial version) can be installed by:

 sudo apt-get install libhdf5-mpich-dev

where 'mpich' can be replaced by 'openmpi' or 'lam'. Unfortunately then the C++ interface is not provided for this MPI version. Note that the two version are incompatible.

Build and Installation from Sources

We will try to install the parallel version of HDF5 1.8 in our user space:

 mk $HOME/usr

from a download location

 mk $HOME/soft
 cd $HOME/soft
 wget ftp://ftp.hdfgroup.org/HDF5/current/src/hdf5-1.8.2.tar.gz
 tar -zxvf hdf5-1.8.2.tar.gz
 cd hdf5-1.8.2

then we can configure:

 ./configure --prefix=$HOME/usr --enable-parallel

Other options are described in ./configure --help. The opton --enable-cxx can be specified but not together with --enable-parallel.