feat(android): enable aarch64-linux-android cross-compilation#99
Merged
Conversation
96efd8d to
f3831ce
Compare
Gate `extern crate blas_src` and the ndarray `blas` feature behind platform-specific cfg so the codebase builds for Android, which has no system BLAS. On Android, ndarray falls back to its pure-Rust matrixmultiply path; all existing platforms (Linux/FreeBSD/macOS/ Windows) retain their BLAS backends unchanged. Affected crates: larql-compute, larql-inference, larql-kv. Build requirements (not committed — machine-local): - Android NDK r27+ with .cargo/config.toml for linker/ar - Cross-compiled OpenSSL for aarch64-linux-android (OPENSSL_DIR) - RUSTFLAGS="-C target-feature=+dotprod" (sdot in q4k kernel)
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.
Summary
Cherry-picked from #94 — credits @metavacua as the original author of this change. Pulls in only the BLAS-gating commit. None of #94's other scope (workflow rewrites, REUSE/AGPL re-licensing, wasmtime→wasmi swap, compliance pipeline) is included here.
extern crate blas_srcand the ndarrayblasfeature behind a 4-OScfg(linux/freebsd/macos/windows).Affected crates:
larql-compute,larql-inference,larql-kv.Build instructions (machine-local, not committed)
NDK linker/ar entries in
.cargo/config.tomlplus:#94 confirmed this produces valid Android ELF64 PIE binaries.
Test plan
cargo test -p larql-compute --lib— 162 passed / 0 failedcargo test -p larql-inference --lib— 907 passed / 0 failedcargo test -p larql-inference --tests— 14 passed / 0 failedcargo test -p larql-kv --lib— 200 passed / 0 failedcargo build --target aarch64-linux-android(requires NDK; verified upstream in feat(android): enable aarch64-linux-android cross-compilation #94)Notes
dotprodrequirement inq4k_q8k_dot.rstargets ARMv8.2+ (Cortex-A55 / ~2017+); a#[cfg(target_feature = "dotprod")]scalar fallback would broaden device coverage but is out of scope here.armv7-linux-androideabi(32-bit) is blocked upstream by Cranelift lacking a 32-bit ARM backend — also out of scope.Supersedes scope from #94 (which should be closed in favour of focused follow-ups).