recipe: scipy 1.18.0 + flet-libopenblas 0.3.33#90
Merged
Merged
Conversation
scipy via OpenBLAS everywhere (NOFORTRAN f2c-LAPACK) + -D_without-fortran. iOS: no patches. Android: 3 patches (clog/cpow shim, ducc no-affinity, boost binary128 long double on x86_64) + use-pythran=false. flet-libopenblas builds BLAS+LAPACK static, openblas.pc relocatable. NOTE: android still needs the libpython.so symlink fix (not yet in repo) - expected to fail at the scipy link step on CI until that lands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds scipy (flet-dev/flet#3391) and its BLAS/LAPACK backend flet-libopenblas.
Approach
-D_without-fortran=true; the only casualty is the deprecatedscipy.odr. This removes the cross-Fortran toolchain blocker entirely — scipy then needs only a BLAS/LAPACK backend.flet-libopenblasrecipe builds OpenBLAS withNOFORTRAN=1(BLAS + the f2c-converted LAPACK, no Fortran compiler) as a static lib, and scipy links it via-Dblas=openblas -Dlapack=openblason both platforms. This is scipy's most-tested BLAS path (standardsgemm_mangling), unifies iOS and Android, and sidesteps Apple Accelerate's macOS-centric gaps on iOS.scipy-openblas32isn't an option (no iOS/Android wheels).Recipes
flet-libopenblas0.3.33 —build.shcross-compiles OpenBLAS per arch (ARMV8 / NEHALEM / ARMV7), static-only, and rewritesopenblas.pcto be relocatable (and drops its baked-in-lgfortran/-lpthread). Statically linked into scipy, so it is a build-time host dep only (not in scipy's Requires-Dist).scipy1.18.0 — meson-python recipe; host depsnumpy 2.4.6,pybind11,flet-libopenblas, andflet-libcpp-shared(Android C++ runtime).Platform notes
iOS builds with no patches. Android needs four small, platform-guarded fixes for bionic/NDK gaps (each a no-op on iOS):
-Duse-pythran=false— pythran 0.18'sndarray.hpphas a ref-qualifier overload the newer NDK clang rejects (affected modules fall back to their Cython versions).android-bionic-clog-cpow.patch— bionic only declares the C99clog/cpowfrom API 26; shim them for__ANDROID_API__ < 26via functions present at API 24.android-ducc-no-affinity.patch— scipy.fft's vendored ducc pins threads with the glibc-onlypthread_{get,set}affinity_np; fall back to its no-affinity path on Android (CPU pinning is only an optimization).android-x86_64-boost-longdouble.patch— Android x86_64 uses 128-bit IEEE-quadlong double(LDBL_MANT_DIG==113), not x86's 80-bit; gate boost.math's x86 branch on==64so it falls through to boost's existing binary128 path.Forge fix
src/forge/build.py: the site-packages pkg-config glob only matched*/share/pkgconfig, missing numpy'snumpy/_core/lib/pkgconfig/numpy.pc, so scipy 1.18'sdependency('numpy')couldn't find it. Added*/lib/pkgconfigand*/_core/lib/pkgconfig— a general win for anydependency('numpy')consumer.Validation
iphoneos.arm64,iphonesimulator.arm64,iphonesimulator.x86_64) and Android (arm64-v8a,x86_64,armeabi-v7a).import scipy,scipy.linalg.solve/svd(OpenBLAS LAPACK),scipy.fft(ducc), andscipy.special.gamma(0.5)==√πall correct.