[Dune] Re: hdf5 and dune

Markus Blatt Markus.Blatt at iwr.uni-heidelberg.de
Wed Aug 9 16:53:05 CEST 2006


Hi,

On Wed, Aug 09, 2006 at 04:16:42PM +0200, Patrick Leidenberger wrote:
> The only thing I have to change in hdf5.m4 is at line 43. The original is:
> AC_CHECK_LIB(hdf5, H5open,[HDF5_LIBS=-lhdf5],[HAVE_HDF5=0]) #,-lz, -lsz)
> 
> the changed is
> AC_CHECK_LIB(hdf5,[HDF5_LIBS=-lhdf5],[HAVE_HDF5=0]) #,-lz, -lsz)
> 

And this really works? Suspicous! Actually (in the first statement) it
is checked whether the lib hdf5 contains a function H5open and if it
does HDF5_LIBS is set to -lhdf5 otherwise HAVE_HDF5 is set 0.

In your case it checks for a function [HDF5_LIBS=-lhdf5] which
definitely is not there. Therefore HAVE_HDF5 is not set to 0 (this
would be the case if it was found). I suppose nonexistent arguments
get treated as null statements.

Documentation directly from the m4-Source:

# AC_CHECK_LIB(LIBRARY, FUNCTION,
#              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
#              [OTHER-LIBRARIES])
# ------------------------------------------------------
#
# Use a cache variable name containing both the library and function
# name,
# because the test really is for library $1 defining function $2, not
# just for library $1.  Separate tests with the same $1 and different
# $2s
# may have different results.
#
# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])
# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give
# ac_cv_lib_$lib_fun, which is definitely not what was meant.  Hence
# the AS_LITERAL_IF indirection.
#
# FIXME: This macro is extremely suspicious.  It DEFINEs
# unconditionally,
# whatever the FUNCTION, in addition to not being a *S macro.  Note
# that the cache does depend upon the function we are looking for.
#
# It is on purpose we used `ac_check_lib_save_LIBS' and not just
# `ac_save_LIBS': there are many macros which don't want to see `LIBS'
# changed but still want to use AC_CHECK_LIB, so they save `LIBS'.
# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
# freedom

So the lib is not found, but the test will not complain, too.

The question is:
- Is there a function H5open in hdf5 (I do not know hdf5, but I guess
  the one writing the test kew that there is.
- If there is. The library is probably not found in the default
  library path. (Take a look at dune-common/config.log what autconf
  complains about. Probably ld does not find libhdf5).
- If that is the case: where is the lib installed? (And why does
--with-hdf5=path_to_hdf5 get ignored?)

Cheers,

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




More information about the Dune mailing list