# compile a reader plugin using HDF5

**URL:** https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864
**Category:** ParaView Support
**Created:** [May 15, 2019, 6:20pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864 "2019-05-15T18:20:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [May 15, 2019, 6:20pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864/1 "2019-05-15T18:20:05Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 16, 2019, 1:13pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864/2 "2019-05-16T13:13:08Z")

</div>

Do you link against `VTK::hdf5`?

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [May 16, 2019, 1:44pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864/3 "2019-05-16T13:44:14Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 16, 2019, 1:59pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864/4 "2019-05-16T13:59:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [May 17, 2019, 1:56pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864/5 "2019-05-17T13:56:19Z")

</div>

@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](https://github.com/jfavre/TestingToShare.git)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 20, 2019, 3:45pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864/6 "2019-05-20T15:45:37Z")

</div>

[https://gitlab.kitware.com/vtk/vtk/merge\_requests/5562](https://gitlab.kitware.com/vtk/vtk/merge_requests/5562)

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [May 23, 2019, 3:04pm UTC](https://discourse.paraview.org/t/compile-a-reader-plugin-using-hdf5/1864/7 "2019-05-23T15:04:26Z")

</div>

Thanks @ben.boeckel. The patch has now landed in ParaView master and I was able to compile cleanly.
