BLD: allow targeting webassembly without emscripten#29053
BLD: allow targeting webassembly without emscripten#29053rgommers merged 1 commit intonumpy:mainfrom
Conversation
|
Thanks @zebreus. This change seems reasonable to me, and can be merged as is I think. I see a CPython interpreter can be built on WASIX, so note that the NumPy test suite has a lot of test skips for WASM, controlled by this boolean: IS_WASM = platform.machine() in ["wasm32", "wasm64"]Those skips are for things that don't work in Emscripten-based interpreters like Pyodide (file system access, |
|
Any reason why this PR is Draft? |
|
Thanks for the quick feedback @rgommers . This PR is still a draft because I didn't come around to verify that everything is working as expected with WASIX last week. I have now done so, and I am marking this as ready. For now, the test skips are still needed. While Python on WASIX supports |
This pull request updates NumPy's platform detection logic to support WebAssembly (WASM) targets compiled with Clang, independent of Emscripten.
Currently, the CPU architecture is only set to wasm when emscripten is detected (by checking for
__EMSCRIPTEN__). However, Clang can compile to WebAssembly without Emscripten. By also including a check for__wasm__, this patch allows NumPy to detect WebAssembly targets compiled without Emscripten.This broadens NumPy's compatibility with WebAssembly toolchains and environments other than emscripten, such as WASIX.