VTK 9.0.3 is now released. This fixes the
VTK_DEBUG_LEAKS flag in the official wheels as compared to 9.0.2.
VTK 9.0.3 is now released. This fixes the
I am testing on it while using Emscripten to compile VTK9.0.3 and errors raised like blow :
$ emcmake cmake -S … -B . -DH5_HAVE_GETPWUID:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -Wno-dev -DVTK_OPENGL_USE_GLES:BOOL=ON
[ 0%] Built target VTKData
[ 0%] Built target WrappingTools
[ 0%] Linking C executable …/…/bin/vtkWrapJava-9.0.js
wasm-ld: error: duplicate symbol: currentFunction
defined in CMakeFiles/WrapJava.dir/vtkWrapJava.c.o
defined in …/…/lib/libvtkWrappingTools-9.0.a(vtkParse.tab.c.o)
emcc: error: ‘/home/hu/emsdk/upstream/bin/wasm-ld -o …/…/bin/vtkWrapJava-9.0.wasm CMakeFiles/WrapJava.dir/vtkWrapJava.c.o …/…/lib/libvtkWrappingTools-9.0.a -L/home/hu/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lc -lcompiler_rt -lc+±noexcept -lc++abi-noexcept -ldlmalloc -lc_rt_wasm -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined --strip-debug --export main --export stackSave --export stackRestore --export stackAlloc --export __wasm_call_ctors --export __errno_location --export malloc --export free --export saveSetjmp --export setThrew --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024’ failed (returned 1)
make: *** [Wrapping/Tools/CMakeFiles/WrapJava.dir/build.make:88: bin/vtkWrapJava-9.0.js] Error 1
make: *** [CMakeFiles/Makefile2:4612: Wrapping/Tools/CMakeFiles/WrapJava.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
emmake: error: ‘make’ failed (returned 2)
---------------------- end output --------------------
So what the errors mean , please ? I suppose I should not to edit some source code to avoid this, there must be some enviroments issue , I guess.
thanks in advance !
It looks like the error message is referring to things above that message (the
defined in … output). Getting the bits above that would help. That said, I don’t know that Emscripten and the Java wrappings were ever working together. Please file an issue for this.
VTK_ENABLE_WRAPPING=OFF when building with emscripten. You might want to continue the discussion in this thread.
Thank you Ben.
Now I passed through and use dockcross/web-wasm:20210416 as toolchain , it works .
VTK/Examples/Cxx all worked . but some other example like
still can not cmake .
this is the errors :
cmake -DVTK_DIR:PATH=/work/vtk/build/ …
Skipping BooleanOperationPolyDataFilter: Could not find the VTK package with the following required components: RenderingContextOpenGL2, RenderingGL2PSOpenGL2.
– Configuring done
– Generating done
Yes the VTK I built using cmake command is like below :
It seems not including “RenderingContextOpenGL2, RenderingGL2PSOpenGL2”, should I need to set those option value to ON and re-compile the VTK ?
PS, the VTK version is commit b57618ee. after this will cause issue 18146 at : https://gitlab.kitware.com/vtk/vtk/-/issues/18146
Thanks again !!
Thank you David.
I do not set VTK_ENABLE_WRAPPING option and compiled OK via dockcross/web-wasm. and meet another issue now .
The examples guard against building if their dependencies are not met. If that example is important, yes, you’ll need to enable the
VTK::RenderingGL2PSOpenGL2 modules in your build and rebuild VTK. However, that issue indicates that the required module doesn’t work with Emscripten, so it just isn’t available for 9.0.3. If it gets resolved in time for 9.1, then that’s when it will be available again.
Note that VTK’s built-in Boolean mesh operations do not work reliably (they may randomly crash or provide wrong output for valid inputs). If you need to use Boolean mesh operations then you can use the vtkbool remote module or convert meshes to labelmaps and perform Boolean operation on images.
Thank you very much ~ Ben. It really helps me a lot !
Besides, is there any directions about how to compile vtk via Xcode on mac os (M1 chipset) ?
I have tried once but failed when CMake . Some errors like :
Cmake error in ThirdParty/build/ThirdParty/hdf5/vtkhfd5/H5Tinit.c is attached to multiple targets:
but none of there is a common dependency of the others. this is not allowed by the xcode “new build system.”
does it mean that source code need to changed or my configration is not correct ? I use default options in Cmake ( mac os)
PS, I just want to learn VTK on macpro (m1) and my work is not on it , my work is emcripten VTK.
Thanks a lot again !!
Great . This informs a lot and helps much more . Thank you very much !
I think that’s an issue with VTK under the Xcode generator. I would recommend using the