[Vv] Add HDF5 reading capability

Jerome Lesaint lesaint.jerome at gmail.com
Wed Nov 12 17:15:59 CET 2025


Hi all,
I am trying to add an Nexus/HDF5 file reader in vv but am struggling with
the build configuration. The error I get at the end of the compilation is :

================
[100%] Linking CXX executable ../bin/vv.app/Contents/MacOS/vv
Undefined symbols for architecture arm64:
  "_H5check_version", referenced from:
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::CanReadFile(char const*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::Read(void*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
  "_H5open", referenced from:
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::CanReadFile(char const*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::Read(void*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
  "H5::DSetAccPropList::DEFAULT", referenced from:
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::Read(void*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
  "H5::FileAccPropList::DEFAULT", referenced from:
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::CanReadFile(char const*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::Read(void*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
  "H5::FileCreatPropList::DEFAULT", referenced from:
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::CanReadFile(char const*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::Read(void*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
  "H5::DSetMemXferPropList::DEFAULT", referenced from:
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::Read(void*) in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
  "H5::PredType::NATIVE_FLOAT", referenced from:
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
      rtk::NexusHdf5ImageIO::ReadImageInformation() in
libclitkCommon.a[17](rtkNexusHdf5ImageIO.cxx.o)
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see
invocation)
make[2]: *** [bin/vv.app/Contents/MacOS/vv] Error 1
make[1]: *** [vv/CMakeFiles/vv.dir/all] Error 2
===========

What I've done :
- added files common/rtkNexusHdf5ImageIO.cxx(and .h) and
common/rtkNexusHdf5ImageIOFactory.cxx( and .h)
- added #include <H5Cpp.h> in the common/rtkNexusHdf5ImageIO.h
- updated clitkIO.cxx and (root) CMakeLists.txt.

If I run `file /opt/homebrew/opt/hdf5/lib/libhdf5_cpp.dylib`, I get
`/opt/homebrew/opt/hdf5/lib/libhdf5_cpp.dylib: Mach-O 64-bit dynamically
linked shared library arm64`.

I guess the ITK - HDF5 installation interferes badly somewhere, but cannot
figure it out properly.
Any help would be much appreciated.
Thanks in advance,
Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/vv/attachments/20251112/37dc3915/attachment.htm>


More information about the vv mailing list