-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
To build scipy on WASM, pyodide carries several patches. Some of them might make sense to just include to scipy, and this issue is to track this. There are fourteen patches in total at https://github.com/hoodmane/pyodide/tree/main/packages/scipy/patches. Here's a rough grouping with an initial shot at a triage. The grouping and proposed decisions are very much up to discussion!
Low-hanging fruits, SciPy-specific, look straightforward to pick up: EDIT: the decision in gh-17414 is to not merge these three:
-
https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0004-int-to-string.patch Fixes an implicit int-to-character conversion. The whole code looks very much Fortran-66. Yikes. -
https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0009-Rename-_page_trend_test.py-to-prevent-test-unvendori.patch This is AFAICS specific to pyodide process, but looks harmless for us. -
https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0013-Add-extra-END-to-prini.f.patch something weird in id_decom in scipy/linalg. Looks harmless. If it fixes it for pyodide, it does I guess.EDIT: Was considered and rejected in MAINT Add an extra END to prini.f #15954. - https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0014-BUG-Fix-signature-of-D_IIR_forback-1-2.patch
Has been applied already in BUG Fix signature of D_IIR_forback(1,2) #15955
Maybe hold on
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0001-Fix-dstevr-in-special-lapack_defs.h.patch
These lines were last touched in 0ad7e3a3f55 which added ILP64 support to distutils-based builds. Hold on this patch until ILP64 is supported in regular meson builds.
Apply to scipy and submit to SuperLU upstream
SuperLU appears to be active, https://github.com/xiaoyeli/superlu, so they might be interested in these three patches
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0007-gemm_-no-const.patch
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0008-make-int-return-values.patch
-
https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0010-sasum-returns-double-not-float.patchThis patch seems incorrect, cf pyodide patches #17413 (comment)
A right course of action seems to be to submit them upstream, and apply to SciPy if accepted.
Distutils-specific
I think these can be ignored as distutils is on its way out:
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0005-disable-blas-detection.patch
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0011-skip-fortran-fails-to-link.patch
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0012-Disable-lapack-detection.patch
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0003-Add-lapack_extras-to-linalg-setup.py.patch
pyodide specific
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0002-loadDynamicLibrary-flapack.patch
- https://github.com/hoodmane/pyodide/blob/main/packages/scipy/patches/0006-fix-fotran-files-minpack.patch
The second one we certainly do not want to apply: it undoes the recursive subroutine
definitions. If pyodide needs it, it will need to also undo #15997 and #16053 which came in for scipy 1.9.
Am going to submit a PR for low-hanging fruits already.