feat(python): add support for local Termux/Android builds#750
Open
Manamama-Gemini-Cloud-AI-01 wants to merge 1 commit into
Open
feat(python): add support for local Termux/Android builds#750Manamama-Gemini-Cloud-AI-01 wants to merge 1 commit into
Manamama-Gemini-Cloud-AI-01 wants to merge 1 commit into
Conversation
- Recognizes 'android' platform in setup.py - Implements NumKong source bundling for Android to bypass Bionic linker limitations - Disables static-libstdc++ on Android to match Termux environment - Skips manual RTLD_GLOBAL load in __init__.py on Android
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.
This PR implements fixes to enable USearch builds on Termux (Android aarch64) and addresses the linker limitations documented in this issue comment.
🛠️ Summary of Changes
python/numkong_bundle.cppto statically include NumKong source files. This bypasses the Android Bionic linker's restriction on sharing symbols between extensions viaRTLD_GLOBAL, which was causingImportError: cannot locate symbol \"nk_uses_dynamic_dispatch\".setup.pyRefactoring:androidplatform.-O3,-ffast-math) for Android.static-libstdc++on Android to match the Termux environment.python/usearch/__init__.pyto skip theRTLD_GLOBALloading of the externalnumkonglibrary on Android, since it's now bundled.MANIFEST.into includenumkongandstringzillaheaders/sources, allowing for offline and bundled builds.✅ Verification
python/scripts/test_index.pypassed on the device.