# About integration of CFSReader

**URL:** https://discourse.paraview.org/t/about-integration-of-cfsreader/9111
**Category:** Development
**Created:** [March 3, 2022, 11:24pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111 "2022-03-03T23:24:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 3, 2022, 11:24pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/1 "2022-03-03T23:24:29Z")

</div>

I’m a developer of the free coupled field FEM and structural optimization tool openCFS [https://www.opencfs.org](https://www.opencfs.org)  
It originates in academia and is now free and open (MIT-License). Our data format is based on hdf5 and we used to have an own reader since paraview 3.x.

The reader has some useful features in handling complex valued datasets, transforming harmonic results to time animations, … - so it is slightly more than just reading data.

While I always have issues in bringing the plugin and paraview together, it all compiles and runs smoothly when this is done (just now with PV 10 on arm64 macOS). Especially for the three platforms Linux, Windows and macOS this is always a hassle.

My aim is to make our CFSReader part of the official paraview distribution and I’d like to start a discussion on this.

What makes things more complicated, is, that we are using the vtkMultiBlockDataSet which seems to be planned to be depreciated soon?

I’m ready to attempt to migrate this when this is ultimately necessary and clearly understand that the reader would be removed from paraview if I do not succeed with that. However having at least one official paraview binary with CFSReader would already be a great help and benefit.

So I have two questions:

1. what is the way to bring our reader for openCFS to the official paraview release
2. is our current usage of vtkMultiBlockDataSet a show stopper?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 4, 2022, 9:21am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/2 "2022-03-04T09:21:12Z")

</div>

Hi and welcome @Fabian !

> what is the way to bring our reader for openCFS to the official paraview release

The would depend on the dependencies of your reader. If there is none, it can be trivial with a simple MR into VTK/ParaVIew or into a ParaView plugin.

> is our current usage of vtkMultiBlockDataSet a show stopper?

Definitelly not, while a transition to partitioned dataset will be needed at some point, integrating an existing code using multiblock is fine. I’d advocate to put your reader into a ParaView plugin in that case though.

That being said, the integration process is a bit complex so do not hesitate to reach out for help.

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 4, 2022, 10:21am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/3 "2022-03-04T10:21:05Z")

</div>

Thanks for the (positive) response! 🙂 We have the dependencies hdf5cpp which is prepared in paraview and boost filesystem, which is available.

I’ll clean and document our plugin a little more and will then come back for further questions.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 8, 2022, 8:34am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/4 "2022-03-08T08:34:28Z")

</div>

Great, do not hesitate to tag me, either here or on gitlab.

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 8, 2022, 11:27pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/5 "2022-03-08T23:27:46Z")

</div>

I hope I followed the right path: I forked paraview and created a branch there: [https://gitlab.kitware.com/fabian.wein/para-view-cfs-reader-plugin/-/tree/add\_CFSReader\_plugin](https://gitlab.kitware.com/fabian.wein/para-view-cfs-reader-plugin/-/tree/add_CFSReader_plugin)  
There I added our plugin to Plugins. It is dirty work in progress and not cleaned yet.

I then create a superbuild with paraview\_SOURCE\_SELECTION=source and paraview\_SOURCE\_DIR set.

In principle I can build paraview and my plugin and it works! However I still struggle with hdf’s cpp. I could not figure out, how to trigger building hdf5 with cpp. Currently I configure it manually and additionally need to add the hdf5cpp lib manually.

E.g.` find_package(HDF5 REQUIRED COMPONENTS C HL CXX)` only finds C and HL.

I did not succeed with Aaron’s suggestion in [how to enable hdf5cpp in superbuild?](https://discourse.paraview.org/t/how-to-enable-hdf5cpp-in-superbuild/9025)  
Adding hdf5cpp to my vtk.module

```auto
NAME
  CFSReaderModules
LIBRARY_NAME
  vtkCFSReader
DEPENDS
  VTK::CommonCore
  VTK::CommonExecutionModel
  hdf5cpp
PRIVATE_DEPENDS
  VTK::vtksys
  VTK::hdf5

```

results in

```auto
-- HDF5 C compiler wrapper is unable to compile a minimal HDF5 program.
-- HDF5 CXX compiler wrapper is unable to compile a minimal HDF5 program.
-- Found HDF5: /opt/homebrew/Cellar/hdf5/1.12.1/lib/libhdf5.dylib;/Users/fwein/code/pv_10/sb_build_branch/install/lib/libhdf5.dylib;/Users/fwein/code/pv_10/sb_build_branch/install/lib/libhdf5_cpp.dylib;/Users/fwein/code/pv_10/sb_build_branch/install/lib/libhdf5.dylib (found version "1.12.1") found components: C HL CXX 
CMake Error at CMake/ParaViewPlugin.cmake:1064 (message):
  Failed to find the required module hdf5cpp.
Call Stack (most recent call first):
  Plugins/CFSReader/CMakeLists.txt:71 (paraview_add_plugin))

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 9, 2022, 8:43am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/6 "2022-03-09T08:43:17Z")

</div>

`VTK::hdf5` in you vtk.module should be enough, but you should include the right file, which is: `vtk_hdf5.h`.

Take a look at `VTK/IO/HDF/vtkHDFReaderImplementation.cxx` for an example usage.

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 9, 2022, 10:47am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/7 "2022-03-09T10:47:28Z")

</div>

Are you sure, you use hdf5cpp in vtkHDFReaderImplementation.cxx?  
Maybe the issue is because I’m in macOS on arm64, but I don’t think so.

I did a complete clean superbuild

```auto
LIBRARY_PATH=/opt/homebrew/lib cmake ../paraview-superbuild -Dsuperbuild_download_location=/Users/fwein/code/cfsdepscache/paraview -DENABLE_boost=ON -DENABLE_hdf5=ON -DENABLE_qt5=ON -DQt5_DIR=/opt/homebrew/Cellar/qt@5/5.15.2_1/lib/cmake/Qt5 -Dparaview_SOURCE_SELECTION=source -Dparaview_SOURCE_DIR=/Users/fwein/code/pv_10/sb_build_branch/superbuild/paraview/src
Re-run cmake no build system arguments
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check size of void*
-- Check size of void* - done
-- Found Git: /usr/bin/git (found version "2.32.0 (Apple Git-132)")
-- Determined source version for paraview: 5.10.0-730-g9d42d12261
-- Enabling cxx11 as requested.
-- Enabling boost as requested.
-- Enabling zlib for: hdf5
-- Enabling szip for: hdf5
-- Enabling hdf5 as requested.
-- Enabling nlohmannjson as requested.
-- Enabling qt5 as requested.
-- Enabling paraview as requested.
-- Building projects: cxx11, boost, zlib, szip, hdf5, nlohmannjson, qt5, paraview
CMake Warning (dev) at superbuild/cmake/SuperbuildMacros.cmake:213 (message):
Optional dependencies for hdf5 not found: hdf5cpp
Call Stack (most recent call first):
superbuild/projects/hdf5.cmake:6 (superbuild_add_project)
superbuild/cmake/SuperbuildMacros.cmake:1061 (include)
superbuild/CMakeLists.txt:170 (superbuild_process_dependencies)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/fwein/code/pv_10/sb_build_killme

```

---

<div class="post-metadata">

### Author: ![timothee.chabat](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee.chabat/32/5729_2.png) [@timothee.chabat](https://discourse.paraview.org/u/timothee.chabat)
#### Post date: [March 9, 2022, 1:47pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/8 "2022-03-09T13:47:20Z")

</div>

Hey-

Using both targets `hdf5cpp` (coming from a `find_package`) and `VTK::hdf5` seems wrong. The clean way to do it would be that `VTK::hdf5` provides all needed components (that is C, HL and CXX).

Looking quickly into `VTK/ThirdParty/hdf5/CMakeLists.txt` it seems it only provides HDF5 with C and HL :

```auto
vtk_module_third_party(
  INTERNAL
    LICENSE_FILES "vtkhdf5/COPYING"
                  "vtkhdf5/COPYING_LBNL_HDF5"
    VERSION "1.12.1"
    STANDARD_INCLUDE_DIRS
    INTERFACE
  EXTERNAL
    PACKAGE HDF5
    COMPONENTS C HL <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    TARGETS hdf5::hdf5
                  hdf5::hdf5_hl
    USE_VARIABLES HDF5_IS_PARALLEL
    STANDARD_INCLUDE_DIRS)

[...]

```

I don’t how easy (or hard) it is to make `VTK::hdf5` provide the `CXX` component, so maybe integrating your plugin will not be as trivial as Mathieu first said.

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 9, 2022, 2:32pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/9 "2022-03-09T14:32:33Z")

</div>

hdf5cpp is given in

`superbuild/.gitlab/ci/configure_common.cmake`: `enable_project(hdf5cpp)`

But I found no usage of H5Cpp.h in paraview, only in `VTK/CMake/patches/99/FindHDF5.cmake`

It “only” is the question of enabling the existing hdf5 option but not the question of an additional external dependency.

In general I see two options:

- enable cpp dynamically or fixed in paraview
- I change our plugin to the C interface.

Can you please share your thoughts on the two possibilities? Probably you plan to go to hdf5\_cpp internally anyway or you think, that the C api is just fine enough.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 9, 2022, 4:33pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/10 "2022-03-09T16:33:49Z")

</div>

In that case, using the C api would be the safest way to go forward.

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 9, 2022, 4:35pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/11 "2022-03-09T16:35:16Z")

</div>

OK, I should not be that hard but will take some time. I’ll come back 🙂

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 12, 2022, 6:01pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/12 "2022-03-12T18:01:01Z")

</div>

@timothee.chabat I forgot to thank you for this insight, this explained a lot for me. When I’m done with the plugin I can offer the small patch removing remaining hdf5cpp artefacts from paraview to prevent future confusion.

---

<div class="post-metadata">

### Author: ![timothee.chabat](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee.chabat/32/5729_2.png) [@timothee.chabat](https://discourse.paraview.org/u/timothee.chabat)
#### Post date: [March 14, 2022, 7:26am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/13 "2022-03-14T07:26:59Z")

</div>

Happy I could help ! Sounds cool thanks for your contribution 🙂

---

<div class="post-metadata">

### Author: ![aron.helser](https://discourse.paraview.org/user_avatar/discourse.paraview.org/aron.helser/32/13_2.png) [@aron.helser](https://discourse.paraview.org/u/aron.helser)
#### Post date: [March 14, 2022, 11:44am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/14 "2022-03-14T11:44:51Z")

</div>

Just to clarify, `hdf5cpp` is used by other superbuild projects, specifically ITK, and so should not be removed from the superbuild.  
Thanks,  
Aron

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 14, 2022, 1:23pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/15 "2022-03-14T13:23:02Z")

</div>

Fixing this in ParaView would be good I think.

---

<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: [March 21, 2022, 3:11am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/16 "2022-03-21T03:11:00Z")

</div>

> [@Fabian](#):
>
> Adding hdf5cpp to my vtk.module

`hdf5cpp` is a superbuild project, not a VTK module, so this won’t work. Note that `VTK::hdf5` only ever provides C bindings (never C++ bindings), so you won’t be able to use `VTK::hdf5` at all unless you migrate to a C-only usage.

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 21, 2022, 7:12am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/17 "2022-03-21T07:12:31Z")

</div>

I finished migrating to C-bindings yesterday. Just need some more code cleaning and testing.

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 28, 2022, 11:12am UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/18 "2022-03-28T11:12:41Z")

</div>

I switched our hdf5 reader to c-api (incl. high level). I also cleaned the cmake configuration a lot. The reader is not ready, I want to do some more code cleanup.

I renamed my fork of ParaView to ParaView: [https://gitlab.kitware.com/fabian.wein/para-view-cfs-reader-plugin/-/tree/add\_CFSReader\_plugin](https://gitlab.kitware.com/fabian.wein/para-view-cfs-reader-plugin/-/tree/add_CFSReader_plugin). I’m not sure if this worked but it is not easy to create a new fork once there is already a fork.

I build superbuild with  
`-DENABLE_boost=ON -DENABLE_hdf5=ON -DENABLE_qt5=ON -DQt5_DIR=... -Dparaview_SOURCE_SELECTION=source -Dparaview_SOURCE_DIR=...`

My plugin is recognized, but in `superbuild/paraview/build/` it has `PARAVIEW_PLUGIN_ENABLE_CFSReader:BOOL=OFF`. When I enable it an do make there, I get a paraview where I can load the the reader and it works 🙂 A make in the superbuild build directory does not have any effect.

How are plugin builds enabled automatically?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 28, 2022, 12:37pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/19 "2022-03-28T12:37:02Z")

</div>

Hi @Fabian ,

> [@Fabian](#):
>
> I renamed my fork of ParaView to ParaView:

You need to rename your fork, not only the branch. It’s in the general settings/housekeeeping of your project.

> How are plugin builds enabled automatically?

CMakeLists.txt:257

```auto
set(paraview_default_plugins...

```

---

<div class="post-metadata">

### Author: ![Fabian](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/f6c823/32.png) [@Fabian](https://discourse.paraview.org/u/Fabian)
#### Post date: [March 28, 2022, 2:22pm UTC](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111/20 "2022-03-28T14:22:54Z")

</div>

I did already rename the fork as you described, but it does not change the link name. If it does not work I could register with another login and create a new fork. Currently a second fork seems no really possible with gitlab.

 ![Bildschirmfoto 2022-03-28 um 16.06.28](https://discourse.paraview.org/uploads/default/original/2X/5/5648b21ca6e3e94089ed208e13c37e4c7509f35d.png)

Thanks for the hint with enabling. I greped for some plugins (e.g. GmshIO) but did not check that I picked the ones which were not enabled.

[Next page](https://discourse.paraview.org/t/about-integration-of-cfsreader/9111.md?page=2)
