Hi, I’m currently doing an internship, and I have a problem. When I try to compile VTK in wasm, I get this error, and I don’t understand why CMake is used and not Emcmake when configuring VTK compilation for wasm. Also, when I use the CMake command, I get this error: “CMake can’t find the C and C++ compilers, so you need to set the CC and CXX envONironment variables or the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER CMake cache entries with the full paths to the compilers.”
And with Emcmake: “The warning indicates that the manually specified Dawn_DIR variable has not been used by the project.”(I get the same error if I use ca Demdawnwebgpu_DIR)
Here are the commands used:
cmake -S C:/vtk/vtk -B ./build -G “Ninja” -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2:STRING=DONT_WANT -DVTK_MODULE_ENABLE_VTK_libproj=NO -DVTK_ENABLE_WEBGPU=ON -DDawn_DIR=C:/Vtk/vtk/dawn/lib/cmake/emdawnwebgpu -DVTK_BUILD_TESTING=ON
My issue is to compile with WebGPU flag On and Dawn to perform some tests with Chrome. I did a successful compilation of VTK-Wasm and successully ran Cone example. Now I would like to try and compare performance with WebGPU and Dawn. But until now all my compilation attempts have failed. I took the pre build Dawn lib such as used in the documentation, but the cmake command fails, the emdawnwebgpu_DIR is not recognized, neither is Dawn_DIR. What is a good entry point ?
Thank you for your help. We have downloaded and extracted the correct version of Dawn (dawn-7153-wasm32-emscripten.tar.gz) and verified that the emdawnwebgpu-config.cmake file is present in the specified directory.
We also tried running the emcmake command.
However, we are still encountering the same error.
We have also ensured that our development environment is correctly set up for CMake and Emscripten.
Here are the commands we entered and the errors we received :
In your table only the first command is correct. All else are invalid, so please don’t try those. emdawnwebgpu must be used with emcmake and Dawn must be used with cmake. emdawnwebgpu must point to emdawnwebgpu directory and Dawn must point to dawn directory extracted from the non-wasm tarballs
Ah! you’re using a version of VTK from March. Back then VTK did not use emdawnwebgpu. It is available in 9.5.0rc0 onwards.
I recommend you copy paste below commands in fresh powershell (since you’re on windows). I have tested these commands on my windows machine and they worked as expected. It pulls the correct versions of VTK, EMSDK, Node and emdawnwebgpu.