[Dune] Re: hdf5 and dune
Markus Blatt
Markus.Blatt at iwr.uni-heidelberg.de
Wed Aug 9 22:01:44 CEST 2006
Hi,
On Wed, Aug 09, 2006 at 05:54:58PM +0200, Patrick Leidenberger wrote:
> Hi Markus,
>
> I have installed hdf5 in parallel with:
> CC='mpicc' F9X='mpif90' CFLAGS='-fPIC' LDFLAGS='-fPIC'
> CPPFLAGS='-fPIC'
> ./configure --prefix=/home/patrick/extlib/hdf5-1.6.5
> --with-pic --disable-shared
>
>
> In libhdf5.a I found with nm the following sections:
> ..
> 000014d3 T H5open
> ...
> U H5open
> ..
>
> [Excerpt of config.log]
> This file contains any messages produced by compilers while
> running configure, to aid debugging if configure makes a mistake.
>
> It was created by dune-common configure 0.0, which was
> generated by GNU Autoconf 2.59. Invocation command line was
>
> $ ./configure CXX=mpicxx CC=mpicc --disable-documentation --prefix=/home2/leidenberger/extlib/dune --with-metis=/home2/leidenberger/extlib/metis-4.0 --with-parmetis=/home2/leidenberger/extlib/ParMetis-3.1 --with-alugrid=/home2/leidenberger/extlib/ALUGrid-0.3 --with-rlog=/home2/leidenberger/extlib/rlog-1.3.7 --with-boost=/home2/leidenberger/extlib/boost-1.33.1 --with-hdf5=/home2/leidenberger/extlib/hdf5-1.6.5 --with-dune-common=/home2/leidenberger/afs/private/dune/dune-common --with-dune-grid=/home2/leidenberger/afs/private/dune/dune-grid --with-dune-istl=/home2/leidenberger/afs/private/dune/dune-istl --with-dune-disc=/home2/leidenberger/afs/private/dune/dune-disc
>
In general it is not a good idea to set CXX=mpicxx and CC=mpicc. This
works as long as you are using the default compiler (mpi was compiled
with). But might fail if you don't.
> [...]
> configure:22917: checking hdf5.h usability
> configure:22929: mpicxx -c -g -O2 -I/home2/leidenberger/extlib/hdf5-1.6.5/include conftest.cc >&5
> configure:22935: $? = 0
THis works because you compile with mpi. In my case this test already
failed as CXX=g++-4.0 and CC=gcc-4.0
> configure:22939: test -z
> || test ! -s conftest.err
> configure:22942: $? = 0
> configure:22945: test -s conftest.o
> configure:22948: $? = 0
> configure:22958: result: yes
> configure:22962: checking hdf5.h presence
> configure:22972: mpicxx -E -I/home2/leidenberger/extlib/hdf5-1.6.5/include conftest.cc
> configure:22978: $? = 0
> configure:22998: result: yes
> configure:23033: checking for hdf5.h
> configure:23040: result: yes
> configure:23055: checking for H5open in -lhdf5
> configure:23085: mpicxx -o conftest -g -O2 -I/home2/leidenberger/extlib/hdf5-1.6.5/include -L/home2/leidenberger/extlib/hdf5-1.6.5/lib conftest.cc -lhdf5 >&5
> /home2/leidenberger/extlib/hdf5-1.6.5/lib/libhdf5.a(H5Zdeflate.o)(.text+0x11a): In function `H5Z_filter_deflate':
> : undefined reference to `inflateInit_'
> /home2/leidenberger/extlib/hdf5-1.6.5/lib/libhdf5.a(H5Zdeflate.o)(.text+0x16e): In function `H5Z_filter_deflate':
> : undefined reference to `inflate'
> /home2/leidenberger/extlib/hdf5-1.6.5/lib/libhdf5.a(H5Zdeflate.o)(.text+0x1dd): In function `H5Z_filter_deflate':
> : undefined reference to `inflateEnd'
> /home2/leidenberger/extlib/hdf5-1.6.5/lib/libhdf5.a(H5Zdeflate.o)(.text+0x2b9): In function `H5Z_filter_deflate':
> : undefined reference to `compress2'
> /home2/leidenberger/extlib/hdf5-1.6.5/lib/libhdf5.a(H5Zdeflate.o)(.text+0x38d): In function `H5Z_filter_deflate':
> : undefined reference to `inflateEnd'
> /home2/leidenberger/extlib/hdf5-1.6.5/lib/libhdf5.a(H5Zdeflate.o)(.text+0x3d2): In function `H5Z_filter_deflate':
> : undefined reference to `inflateEnd'
> collect2: ld returned 1 exit status
> configure:23091: $? = 1
> configure: failed program was:
> | /* confdefs.h. */
> |
> | #define PACKAGE_NAME "dune-common"
> | #define PACKAGE_TARNAME "dune-common"
> | #define PACKAGE_VERSION "0.0"
> | #define PACKAGE_STRING "dune-common 0.0"
> | #define PACKAGE_BUGREPORT "dune at hal.iwr.uni-heidelberg.de"
> | #define PACKAGE "dune-common"
> | #define VERSION "0.0"
> | #ifdef __cplusplus
> | extern "C" void std::exit (int) throw (); using std::exit;
> | #endif
> | #define DUNE_DEPRECATED __attribute__((deprecated))
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_MEMORY_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_STDINT_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_DLFCN_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_MALLOC 1
> | #define DUNE_MINIMAL_DEBUG_LEVEL 4
> | #define HAVE_RPC_RPC_H 1
> | #define HAVE_PTHREAD 1
> | /* end confdefs.h. */
> |
> | /* Override any gcc2 internal prototype to avoid an error. */
> | #ifdef __cplusplus
> | extern "C"
> | #endif
> | /* We use char because int might match the return type of a gcc2
> | builtin and then its argument prototype would still apply. */
> | char H5open ();
> | int
> | main ()
> | {
> | H5open ();
> | ;
> | return 0;
> | }
> configure:23117: result: no
This looks like some compression library is not found. Probably for
libs than libhdf5 are needed for the compilation.
Probably you can work around this by setting LIBS to include that
libraries when running configure?
Anyway we have make the test more fancy as we somehow have to examine
whether hdf5 is parallel or not.
> $ ./configure CXX=mpicxx CC=mpicc --disable-documentation --prefix=/home2/leidenberger/extlib/dune --with-metis=/home2/leidenberger/extlib/metis-4.0 --with-parmetis=/home2/leidenberger/extlib/ParMetis-3.1 --with-alugrid=/home2/leidenberger/extlib/ALUGrid-0.3 --with-rlog=/home2/leidenberger/extlib/rlog-1.3.7 --with-boost=/home2/leidenberger/extlib/boost-1.33.1 --with-hdf5=/home2/leidenberger/extlib/hdf5-1.6.5 --with-dune-common=/home2/leidenberger/afs/private/dune/dune-common --with-dune-grid=/home2/leidenberger/afs/private/dune/dune-grid --with-dune-istl=/home2/leidenberger/afs/private/dune/dune-istl --with-dune-disc=/home2/leidenberger/afs/private/dune/dune-disc
>
> [...]
>
> configure:22917: checking hdf5.h usability
> configure:22929: mpicxx -c -g -O2 -I/home2/leidenberger/extlib/hdf5-1.6.5/include conftest.cc >&5
> configure:22935: $? = 0
> configure:22939: test -z
> || test ! -s conftest.err
> configure:22942: $? = 0
> configure:22945: test -s conftest.o
> configure:22948: $? = 0
> configure:22958: result: yes
> configure:22962: checking hdf5.h presence
> configure:22972: mpicxx -E -I/home2/leidenberger/extlib/hdf5-1.6.5/include conftest.cc
> configure:22978: $? = 0
> configure:22998: result: yes
> configure:23033: checking for hdf5.h
> configure:23040: result: yes
> configure:23055: checking for HDF5_LIBS=-lhdf5 in -lhdf5
> configure:23085: mpicxx -o conftest -g -O2 -I/home2/leidenberger/extlib/hdf5-1.6.5/include -L/home2/leidenberger/extlib/hdf5-1.6.5/lib conftest.cc -lhdf5 >&5
> conftest.cc:38: warning: `HDF5_LIBS' initialized and declared `extern'
> conftest.cc:38: error: `lhdf5' was not declared in this scope
> conftest.cc: In function `int main()':
> conftest.cc:42: error: `lhdf5' was not declared in this scope
> configure:23091: $? = 1
> configure: failed program was:
> | /* confdefs.h. */
> |
> | #define PACKAGE_NAME "dune-common"
> | #define PACKAGE_TARNAME "dune-common"
> | #define PACKAGE_VERSION "0.0"
> | #define PACKAGE_STRING "dune-common 0.0"
> | #define PACKAGE_BUGREPORT "dune at hal.iwr.uni-heidelberg.de"
> | #define PACKAGE "dune-common"
> | #define VERSION "0.0"
> | #ifdef __cplusplus
> | extern "C" void std::exit (int) throw (); using std::exit;
> | #endif
> | #define DUNE_DEPRECATED __attribute__((deprecated))
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_MEMORY_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_STDINT_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_DLFCN_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_MALLOC 1
> | #define DUNE_MINIMAL_DEBUG_LEVEL 4
> | #define HAVE_RPC_RPC_H 1
> | #define HAVE_PTHREAD 1
> | /* end confdefs.h. */
> |
> | /* Override any gcc2 internal prototype to avoid an error. */
> | #ifdef __cplusplus
> | extern "C"
> | #endif
> | /* We use char because int might match the return type of a gcc2
> | builtin and then its argument prototype would still apply. */
> | char HDF5_LIBS=-lhdf5 ();
> | int
> | main ()
> | {
> | HDF5_LIBS=-lhdf5 ();
> | ;
> | return 0;
> | }
> configure:23117: result: no
>
As I already pointed out, your test searches for a function named
HDF5_LIBS=-lhdf5, does not find it, but never sets HAVE_HDF5 to 0 and
it stays one because the header was found (and HAVE_HDF5 was to 1 at
that stage.) SO it claims it has HDF5 but it actually lies.
You should redo your changes and try the workaround above.
Markus
More information about the Dune
mailing list