compile a reader plugin using HDF5

(Jean M. Favre) #1

in my reader plugin, I include <vtk_hdf5.h>

At compilation time, it does find vtk_hdf5.h, but it fails on finding H5pubconf.h which is located in my $INSTALL_PATH/include/paraview-5.6/vtkhdf5

/local/apps/ParaView/dev/include/paraview-5.6/vtkhdf5/src/H5public.h:29:10: fatal error: H5pubconf.h: No such file or directory
#include “H5pubconf.h” /*from configure

I can fix the error by forcing it to look in the right place, but I thought it ought to just work magically. I also have to add the path to vtkhdf5/src. Here is what I use:

vtk_module_include(Foo
PRIVATE
/local/apps/ParaView/dev/include/paraview-5.6/vtkhdf5
/local/apps/ParaView/dev/include/paraview-5.6/vtkhdf5/src)

Is this right, or should cmake find it by itself?

(Ben Boeckel) #2

Do you link against VTK::hdf5?

(Jean M. Favre) #3

No. I do not give any link instructions. Cmake correctly pulls in the
/local/apps/ParaView/dev/lib/libvtkhdf5-pv5.6.so.5.6 /local/apps/ParaView/dev/lib/libvtkhdf5_hl-pv5.6.so.5.6 to link with. But the error comes earlier during the compilation, not the linking.

I only specify
PRIVATE_DEPENDS
VTK::hdf5

and I thought that what used to be the ${vtkhdf5_LIBRARIES} and ${vtkhdf5_INCLUDE_DIRS} would be pulled in auto-magically. (I’ll admit I still feel lost in the new module stuff)

(Ben Boeckel) #4

Hmm. Adding VTK::hdf5 to PRIVATE_DEPENDS should work. Is your plugin publicly available?

(Jean M. Favre) #5

@ben.boeckel I have made a skeleton of my plugin which can be used to test. It can [partially] read the Test1.h5 file from the ParaView test infrastructure. (ExternalData/Testing/Data/Test1.h5)

https://github.com/jfavre/TestingToShare.git

(Ben Boeckel) #6

https://gitlab.kitware.com/vtk/vtk/merge_requests/5562