-
-
Notifications
You must be signed in to change notification settings - Fork 994
Description
This was discussed in #211 I would like to reformulate the issue so it's easier for someone to continue working on it.
Scipy requires BLAS and LAPACK to build. Note: my earlier comments in #211 (comment) about LAPACK being optional due to the note at the and of this paragraph in scipy docs were actually not true, as was confirmed on the scipy-dev mailing list.
Currently in #211 we link LAPACK statically, which means that it gets included in around ~8 compiled C extensions , with a resulting size of 170MB lz4 compressed / 650MB uncompressed. Different compile flags where tried in #211 but ultimately it doesn't improve size much.
The most clean way to improve the package size would be to link dynamically, which would also allow to get rid of some hacks in pyodide_build/pywasmcross.py (#211 (comment)). More information about dynamic linking in emscripten can be found in https://github.com/kripken/emscripten/wiki/Linking
Some of this was tried in #211 (comment) but didn't succeed. In retrospective, disabling validation of output in emcc / asm2wasm could be a first step. Then one would need to manually open the needed modules with dlopen, since ldd does not exist in emscripten (#211 (comment)).