I’m looking for an HDF5 version compatible with the golang version 1.9.2 to build a specific project, that requires this version. I already installed the HDF5 library version 1.10.1 on ubuntu18.04 using “sudo apt install libhdf5-dev” , but when I build the project it gave me the following error:
gonum.org/v1/hdf5 …/…/…/gonum.org/v1/hdf5/h5a_attribute.go:96: cannot use C.ulong(uint(unsafe.Sizeof(byte(0))) * (dlen + 1)) (type C.ulong) as type C.size_t in argument to _Cfunc__CMalloc …/…/…/gonum.org/v1/hdf5/h5p_proplist.go:80: cannot use _Cfunc_H5Pget_chunk(C.hid_t(p.Identifier.id), C.int(ndims), &c_dims[0]) (type C.int) as type C.herr_t in argument to h5err
Could anyone helps me solve this problem?
Is it possible to build the project using another version of hdf5 lib?
Thank you for your reply,
I’m totally new to the hdf5-lib and Golang, so I don’t know if I did the right modification or not:
from h5a_attribute.go file I removed this line:
cstr := (*C.char)(unsafe.Pointer(C.malloc(C.ulong(uint(unsafe.Sizeof(byte(0))) * (dlen + 1)))))
and replaced it by:
cstr := (*C.char)(unsafe.Pointer(C.malloc(C.size_t(uint(unsafe.Sizeof(byte(0))) * (dlen + 1)))))
it fixed the first issue, but the second did not because when I tried to modify the files mentioned in the link (some of them I didn’t find such as h5g.go h5t.go…) I found them already updated.