-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling for WASM #305
Comments
@lielfr there a few things that prevent compiling to WASM out of the box with emscripten. There are a few changes needed in CMake and intrinsics. After getting a successful build, you then need to work around marshaling 32-bit numbers as the default 64-bits will not work, thus limiting your precision with BFV. In addition, CKKS is limited to 53 bits of precision due to how data is marshaled to JS numbers which have a max precision of 2^53. If you want inspiration, you can look at the code of node-seal which is a TS wrapper around the WASM generated by emscripten. Full disclosure - I'm the author of node-seal. It works with both 32-bit numbers, but also 64-bit numbers (represented by BigInts) at the cost of an encoding penalty for BFV. |
@s0l0ist You are the expert on this topic. Much appreciated! |
@s0l0ist Thanks a lot |
Hi,
I have a little C++ project which uses SEAL internally, and I'm trying to make JS/WASM bindings for it.
It seems like the library cannot build for WASM using Emscripten, since running
emcmake cmake -S . -B build -DCMAKE_INSTALL_PREFIX=~/js-libs
and thencd build; emmake make -j
fails:The main issue seems to be that the system isn't a UNIX-Like or Windows system. Is there any way to build SEAL (and the code that uses it) for WebAssembly?
Thanks.
The text was updated successfully, but these errors were encountered: