NIX fails to build with HDF5 1.10
achilleas-k opened this issue · 2 comments
The following error occurs when building NIX against HDF5 1.10.
I'm running Arch Linux and 1.10 landed in the main repositories a few days ago.
In file included from /usr/include/cppunit/TestCase.h:6:0,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/achilleas/code/gnode/nix/test/hdf5/TestDataSet.hpp:21,
from /home/achilleas/code/gnode/nix/test/hdf5/TestDataSet.cpp:9:
/home/achilleas/code/gnode/nix/test/hdf5/RefTester.hpp: In instantiation of ‘void test_refcounting(hid_t, hid_t) [with T = nix::hdf5::DataSet; hid_t = long int]’:
/home/achilleas/code/gnode/nix/test/hdf5/TestDataSet.cpp:173:61: required from here
/home/achilleas/code/gnode/nix/test/hdf5/RefTester.hpp:51:5: error: no matching function for call to ‘assertEquals(int, hid_t, CppUnit::SourceLine, const char [1])’
CPPUNIT_ASSERT_EQUAL(H5I_INVALID_HID, obj_invalid.h5id());
^
/usr/include/cppunit/TestAssert.h:109:6: note: candidate: template<class T> void CppUnit::assertEquals(const T&, const T&, CppUnit::SourceLine, const string&)
void assertEquals( const T& expected,
^
/usr/include/cppunit/TestAssert.h:109:6: note: template argument deduction/substitution failed:
/home/achilleas/code/gnode/nix/test/hdf5/RefTester.hpp:51:5: note: deduced conflicting types for parameter ‘const T’ (‘int’ and ‘hid_t {aka long int}’)
CPPUNIT_ASSERT_EQUAL(H5I_INVALID_HID, obj_invalid.h5id());
^
Full make error output can be found here.
1.10 is a major release, so it doesn't seem to be landing in most distributions yet.
Perhaps a temporary note in the README can warn about this, in case any users are running rolling distributions or use unstable repositories, until it is fixed.
For a first quick look it may be this change, c.f. Release.txt:
The hid_t type was changed from 32-bit to a 64-bit value.
As expected, H5I_INVALID_HID
is using a integer literal in a define directives, which is of type int
and most likely has 32 bit (w.g. in LLP64 and LP64).
λ ~/C/s/hdf5-1.10.0 → find . -name "*.h" | xargs grep H5I_INVALID_HID
./src/H5Ipublic.h:#define H5I_INVALID_HID (-1)
Fix for this is going to be some casts.