[Dune] How to include hdf5 in the build system

Markus Blatt Markus.Blatt at iwr.uni-heidelberg.de
Wed Aug 9 15:07:21 CEST 2006


Hi,

On Wed, Aug 09, 2006 at 02:45:28PM +0200, Patrick Leidenberger wrote:
> 
> I try to write an IO routine to use hdf5 from Dune. But I have some
> problems with the build system:
> In dune-common/m4 I fond a hdf5.m4 file. I addapted this file according
> to metis.m4 and parmetis.m4 (perhaps that is not neccesary). But I get
> never an --with-hdf5 option in the configure file.

Currently hdf5 is never checked. To enable the check you have add a 
AC_REQUIRE([DUNE_PATH_HDF5]) in dune_all.m4 (right where the other
functions are required. That should do the trick.

I am not whether the adaptation was needed.

> 
> The IO routine should be placed at the dune-grid/grid/io/file/
> 
> How can I use hdf5 libs from that place?
> 

the (unmodified) hdf5 check defines HAVE_HDF5 in config.h (which
should be included as the first step in every application .cc file) 
if hdf5 is found. 

In the Makefile HDF5_CPPFLAGS, HDF5_LDFLAGS, HDF5_LIBS get set. Those
should be used to compile applications that need hdf5.

Simply including the needed hdf5 headers if it was found should be
sufficient:

#ifdef HAVE_HDF5
#include"hdf5header.hh"
// code 
#endif

Cheers,

markus

-- 
DUNE -- The Distributed And Unified Numerics Environment 
<http://www.dune-project.org>




More information about the Dune mailing list