Thanks, this was very helpful. I suppose I mis-read the documentation or code at this point.
Cheers Paul On Mon, Sep 5, 2011 at 11:35 AM, Pierre de Buyl <[email protected]>wrote: > Le 4 sept. 11 à 23:08, [email protected] a écrit : > > On Sun, 4 Sep 2011 16:12:41 +0200, Paul Anton Letnes wrote: >> >>> Hello everyone. >>> >>> My fortran code using hdf5 compiles nicely on a number of machines. >>> After losing my laptop (sad, but true) I am now installing hdf5 (and >>> other stuff) on my machine to be able to compile my code again. >>> Needless to say, I have made no changes to my code, so compilation >>> should be a breeze after installing all dependencies. >>> >>> However, I get a number of errors of this kind (one per subroutine >>> call, I am doing several): >>> /home/paulanto/Code/**Rayleigh2D/Rayleigh2D_Modules/**R_save.f90:121.29: >>> >>> (/ i_surface /), int(1, kind=hsize_t), hdferr) >>> 1 >>> Error: Type mismatch in argument 'size' at (1); passed INTEGER(8) to >>> INTEGER(4) >>> >>> The relevant subroutine call looks like this: >>> call h5ltset_attribute_int_f(file_**id, root, >>> n_surfaces_name, & >>> (/ i_surface /), int(1, kind=hsize_t), >>> hdferr) >>> >> >> h5ltset_attribute_int_f (and probably the other functions) is expecting >> "size" to be size_t, not hsize_t. >> hsize_t and size_t will only be the same depending on the OS , compiler >> flags, etc../ >> >> >> Changing hsize_t to size_t should fix the problem(s). >> > > I had the same issue when changing compilers (between ifort and gfortran) > that I resolved thanks to your help. > > Pierre > > > >> My preliminary conclusion is that hsize_t is somehow not the type >>> that the hdf5 subroutine is expecting. Probably it coincides with the >>> correct type on some CPUs or some operating systems, hence it has >>> worked until now. >>> >>> My hdf5 library (1.8.7) and my code are both compiled with gfortran >>> 4.6.1, which I have used with success before. One potential difference >>> is that this PC (which I'm borrowing) is running 32 bit linux. Is the >>> error in my code, is there a bug in hdf5, does gfortran handle this >>> incorrectly, or something else? >>> >>> Thanks in advance, >>> Paul >>> >> >> >> ______________________________**_________________ >> Hdf-forum is for HDF software users discussion. >> [email protected] >> http://mail.hdfgroup.org/**mailman/listinfo/hdf-forum_**hdfgroup.org<http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org> >> > > > ______________________________**_________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.hdfgroup.org/**mailman/listinfo/hdf-forum_**hdfgroup.org<http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org> >
_______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
