HDF-NI / hdf5.node

A node module for reading/writing the HDF5 file format.
MIT License
123 stars 40 forks source link

h5lt.makeDataset failed with "not a location ID" #33

Closed zszszsz closed 7 years ago

zszszsz commented 7 years ago

nodejs 7.1.0 hdf5.node 0.2.1 hdf5 1.10.0_patch 1-1 linux 4.8.8.2, x86-64, archlinux compiled with gcc, I will check the version later.

related code here

'use strict';
const h5 = require('hdf5');
const h5var = require('hdf5/lib/globals');

var file = new h5.hdf5.File('./test.h5', h5var.Access.ACC_TRUNC);
//file id is 72057594037927940
var gp = file.createGroup('test');
//group id is 144115188075855870

var buf = Buffer.alloc(8*10*8,0);
buf.rank=2;
buf.rows=8;
buf.columns=10;
buf.type=H5Type.H5T_NATIVE_DOUBLE;

h5.h5lt.makeDataset(gp.id,'test',buf);

this trigger the error: H5D.c line 121 in H5Dcreate2(): not a location ID major: Invalid arguments to routine minor: Inappropriate type

H5Gloc.c line 253 H5G_loc(): invalid object ID major: Invalid arguments to routine minor: bad value

rimmartin commented 7 years ago

Hi, yes hdf5 1.10.0_patch 1-1 doesn't work with v0.2.1. This has been addressed in the github repository. I will publish the next release to npm sometime this weekend. There are other fixes well worth a publish too

rimmartin commented 7 years ago

As it turns out hdf5 went to long long in 1.10 for id's. This needed a int64 to represent in javascript which was custom added to this project and now works

zszszsz commented 7 years ago

thanks. And Will the current github version solve the problem?

rimmartin commented 7 years ago

Yes, I', running from github with hdf5 1.10.0_patch 1-1. Will test with node v7.x soon.but should work

zszszsz commented 7 years ago

It works with nodejs 7.1.