Apologies for bothering you again, but I have encountered another difficult issue:
I have attempted to compile VTK using the code below
emcmake cmake -S F:\kuaite\VTK-master\VTK-master -B . -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_ENABLE_WEBGPU:BOOL=ON
cmake --build .
cmake --install . --prefix .\installRelease
and followed the README instructions to compile the ConeMultiBackend
example. During the compilation process, I encountered several warnings and errors:
[1/1] Linking CXX executable ConeMultiBackend.js
FAILED: [code=1] ConeMultiBackend.js
C:\WINDOWS\system32\cmd.exe /C "cd . && F:\kuaite\emscripten\emsdk\upstream\emscripten\em++.bat -sWASM=1 -sMODULARIZE=1 -sASYNCIFY=1 -sALLOW_MEMORY_GROWTH=1 -sEXPORT_NAME=createConeMultiBackendModule "-sEXPORTED_RUNTIME_METHODS=['ENV']" -fwasm-exceptions -sEXCEPTION_STACK_TRACES=1 -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=$getWasmTableEntry --js-library=F:/kuaite/VTK-master/VTK-master/Rendering/UI/vtkWebAssemblyRenderWindowInteractor.js -s FULL_ES3=1 -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2 --use-port=emdawnwebgpu @CMakeFiles\ConeMultiBackend.rsp -o ConeMultiBackend.js && C:\WINDOWS\system32\cmd.exe /C "cd /D F:\kuaite\VTK-master\VTK-master\Examples\Emscripten\Cxx\ConeMultiBackend\out\build && D:\cmake\bin\cmake.exe -E copy_directory F:/kuaite/VTK-master/VTK-master/Examples/Emscripten/Cxx/ConeMultiBackend/web F:/kuaite/VTK-master/VTK-master/Examples/Emscripten/Cxx/ConeMultiBackend/out/build""
em++: warning: ASYNCIFY=1 is not compatible with -fwasm-exceptions. Parts of the program that mix ASYNCIFY and exceptions will not compile. [-Wemcc]
unexpected expression type
UNREACHABLE executed at C:\b\s\w\ir\cache\builder\emscripten-releases\binaryen\src\passes\Asyncify.cpp:1146!
unexpected expression type
UNREACHABLE executed at em++: error: ''F:/kuaite/emscripten/emsdk/upstream\bin\wasm-opt' --asyncify --pass-arg=asyncify-asserts --pass-arg=asyncify-propagate-addlist '--pass-arg=asyncify-imports@env.invoke_*,env.__asyncjs__*,*.$asyncLoad,*.fd_sync,*.emscripten_promise_await,*.emscripten_async_load_script,*.emscripten_async_wget_data,*.emscripten_idb_load,*.emscripten_idb_store,*.emscripten_idb_delete,*.emscripten_idb_exists,*.emscripten_idb_clear,*.emscripten_idb_load_blob,*.emscripten_idb_store_blob,*.emscripten_sleep,*.emscripten_wget_data,*.emscripten_scan_registers,*._load_secondary_module,*.emscripten_fiber_swap,*.SDL_Delay,*.emwgpuWaitAny' ConeMultiBackend.wasm -o ConeMultiBackend.wasm --mvp-features --enable-bulk-memory --enable-bulk-memory-opt --enable-call-indirect-overlong --enable-exception-handling --enable-multivalue --enable-mutable-globals --enable-nontrapping-float-to-int --enable-reference-types --enable-sign-ext' failed (returned 3221226505)
ninja: build stopped: subcommand failed.
It seems that there is a conflict between ASYNCIFY=1
and -fwasm-exceptions
. I attempted to remove the -fwasm-exceptions
flag, but VTK requires exception handling during compilation, which necessitates Emscripten support. However, I recall reading somewhere that WebGPU requires ASYNCIFY support (and indeed, removing ASYNCIFY caused new errors).
Are there any compilation examples? Thanks again!