--- mathgl-1.9.0.1.orig/configure.ac 2009-07-08 11:29:13.000000000 +0200 +++ mathgl-1.9.0.1/configure.ac 2009-08-26 11:09:55.123551155 +0200 @@ -153,6 +153,7 @@ AC_CHECK_LIB([hdf5], [main], [(test x$all = xtrue || test x$hdf5 = xtrue) && HDF5_LIBS=-lhdf5 AC_SUBST(HDF5_LIBS)], [(test x$all = xtrue || test x$hdf5 = xtrue) && echo "Please install hdf5 library" && exit]) +AC_CHECK_LIB([hdf5], [H5Literate], [(test x$all = xtrue || test x$hdf5 = xtrue) && HDF5_FLAGS="-DHAVE_HDF5 -DHAVE_HDF5_18" AC_SUBST(HDF5_FLAGS)], []) AM_CONDITIONAL(USE_HDF5, (test x$all = xtrue || test x$hdf5 = xtrue)) AC_ARG_ENABLE(gif, --- mathgl-1.9.0.1.orig/mgl/mgl_data_io.cpp 2009-07-08 11:28:45.000000000 +0200 +++ mathgl-1.9.0.1/mgl/mgl_data_io.cpp 2009-08-26 11:29:45.067804785 +0200 @@ -919,7 +919,11 @@ hid_t hf,hd,hs; hsize_t dims[3]; long rank = 3, res; +#ifdef HAVE_HDF5_18 + H5Eset_auto(H5E_DEFAULT,0,0); +#else H5Eset_auto(0,0); +#endif res=H5Fis_hdf5(fname); if(res>0 && !rewrite) hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); else hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -929,10 +933,18 @@ else { rank = 3; dims[0] = nz; dims[1] = ny; dims[2] = nx; } hs = H5Screate_simple(rank, dims, 0); #if(MGL_USE_DOUBLE==1) +#ifdef HAVE_HDF5_18 + hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#else /* ! HAVE_HDF5_18 */ hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT); +#endif /* HAVE_HDF5_18 */ H5Dwrite(hd, H5T_NATIVE_DOUBLE, hs, hs, H5P_DEFAULT, a); #else +#ifdef HAVE_HDF5_18 + hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#else /* ! HAVE_HDF5_18 */ hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT); +#endif /* HAVE_HDF5_18 */ H5Dwrite(hd, H5T_NATIVE_FLOAT, hs, hs, H5P_DEFAULT, a); #endif H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); @@ -944,7 +956,11 @@ hsize_t dims[3]; long rank; hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); +#ifdef HAVE_HDF5_18 + hd = H5Dopen(hf,data,H5P_DEFAULT); +#else hd = H5Dopen(hf,data); +#endif hs = H5Dget_space(hd); rank = H5Sget_simple_extent_ndims(hs); if(rank>0 && rank<=3)