Porting C++ libraries that use threading is challenging, because the IC has turned off threads support in the wasmtime.
I get this error message when I compile my code using the experimental --target=wasm32-wasi-threads
option of WebAssembly/wasi-sdk.
The wasm is properly build, but during dfx deploy I get:
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed while trying to install all canisters.
Failed to install wasm module to canister 'greet'.
Failed during wasm installation call: The replica returned a rejection error: reject code CanisterError, reject message Wasm module of canister bkyz2-fmaaa-aaaaa-qaaaq-cai is not valid: Wasmtime failed to validate wasm module wasmtime::Module::validate() failed with threads support is not enabled (at offset 0x346e9), error code None
I really plan to run on just one thread, but it is a lot of work to strip out all the threading code.
Any chance on turning threads support on for the IC canisters or perhaps do you have any other ideas?
Thank you!