I’m front-end engineer, want to build vtk to webAssembly for read exodus file, and follow the “examples/emscripten/cxx” step, it’s work, but when i add exodus reader code, there show message “unable find vtkIOExodusModule.h”, where this file from and how can i solve this problem?
#include "vtkExodusIIReader.h"
here message is when i run cmake:
CMake Warning at Emscripten/Cxx/Exodus/CMakeLists.txt:17 (find_package):
Found package configuration file:
/work/build-vtk-wasm/vtk-config.cmake
but it set VTK_FOUND to FALSE so package "VTK" is considered to be NOT
FOUND. Reason given by package:
Could not find the VTK package with the following required components:
IOExodus.
That file is unavailable because VTK::IOExodus depends upon VTK::exodusII which in turn depends upon VTK::hdf5. The root cause is that VTK wasm build guide asks to disable VTK::hdf5 with -DVTK_MODULE_ENABLE_VTK_hdf5:STRING=N0.
VTK’s HDF5 is quite old and needs to be synced up with upstream in order to target WebAssembly.
I remove -DVTK_MODULE_ENABLE_VTK_hdf5:STRING=N0 this line and follow guide try again, I got some error when running cmake.
CMake Error at ThirdParty/hdf5/vtkhdf5/config/cmake/ConfigureChecks.cmake:355 (list):
list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
ThirdParty/hdf5/vtkhdf5/CMakeLists.txt:503 (include)
So it is not supported convert hdf5 to webAssembly now?
I have a electron project, and want to show exodus file in web. Firstly I use vtk.js with itk-wasm to do this just like paraview-glance, but I found it will lost lot of data to color mapping, such as PointData and CellData, it also happen in paraview-glance.
Now I try to use VTK → WebAssembly to do that, is this the way I need? Should I continue going on?
Yup. That’s exactly what happens if you enable hdf5 in vtk wasm. VTK vendors hdf5 source code. The thing is upstream hdf5 adapted their cmake to target webassembly, so VTK will need to sync up.
I skipped the above error in ConfigureChecks.cmake:355, there build project successfully, although I don’t know why it work.
Then I run cmake --build . show error here:
[2880/4105] Building C object ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5Tinit.c.o
FAILED: ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5Tinit.c.o
/emsdk/upstream/emscripten/emcc -D_GNU_SOURCE -I/work/src/ThirdParty/hdf5/vtkhdf5/src -I/work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5 -I/work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src -I/work/build-vtk-wasm/ThirdParty/zlib/vtkzlib -I/work/src/ThirdParty/zlib/vtkzlib -isystem /work/build-vtk-wasm/ThirdParty/zlib -isystem /work/src/ThirdParty/zlib -std=c99 -O3 -DNDEBUG -fPIC -std=gnu99 -MD -MT ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5Tinit.c.o -MF ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5Tinit.c.o.d -o ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5Tinit.c.o -c /work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src/H5Tinit.c
emcc: error: /work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src/H5Tinit.c: No such file or directory (“/work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src/H5Tinit.c” was expected to be an input file, based on the commandline arguments provided)
[2883/4105] Building C object ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5lib_settings.c.o
FAILED: ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5lib_settings.c.o
/emsdk/upstream/emscripten/emcc -D_GNU_SOURCE -I/work/src/ThirdParty/hdf5/vtkhdf5/src -I/work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5 -I/work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src -I/work/build-vtk-wasm/ThirdParty/zlib/vtkzlib -I/work/src/ThirdParty/zlib/vtkzlib -isystem /work/build-vtk-wasm/ThirdParty/zlib -isystem /work/src/ThirdParty/zlib -std=c99 -O3 -DNDEBUG -fPIC -std=gnu99 -MD -MT ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5lib_settings.c.o -MF ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5lib_settings.c.o.d -o ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5lib_settings.c.o -c /work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src/H5lib_settings.c
emcc: error: /work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src/H5lib_settings.c: No such file or directory (“/work/build-vtk-wasm/ThirdParty/hdf5/vtkhdf5/src/H5lib_settings.c” was expected to be an input file, based on the commandline arguments provided)
I tried to understand the difference of VTK:hdf5 and upstream hdf5, i know vtk current use hdf5 verison is 1.13.1, and the newest version of upstream hdf5 is 1.14.1. My question is why sync up the code can solve webAssembly compile error, and where part of vtk::hdf5 I need to sync up?
My question is why sync up the code can solve webAssembly compile error, and where part of vtk::hdf5 I need to sync up?
So, VTK relies upon a number of third-party libraries, one of them being hdf5. The source code for these open-source libraries is vendored (in layman terms, the 3rd party project is cloned inside VTK source code and built along with VTK). This means that when you configure and build VTK, CMake will also configure and build the vendored HDF5 from source. Here is our mirror for the hdf5 third-party project - https://gitlab.kitware.com/third-party/hdf5. VTK uses a specific tag named for/vtk-20220414-1.13.1. And here is how it’s updated in VTK - https://gitlab.kitware.com/vtk/vtk/-/blob/master/ThirdParty/UPDATING.md
My question is why sync up the code can solve webAssembly compile error, and where part of vtk::hdf5 I need to sync up?
Thank you for explain, but this is difficult for me as a front-end engineer to understand both vtk and hdf5, i would appreciate it if you could sync up hdf5 so that solve my problem.