From 12fa3351168ab8ce93ef62a170f99e72de29c39b Mon Sep 17 00:00:00 2001 From: Ronny Chan Date: Wed, 14 Jan 2026 02:12:51 +0900 Subject: [PATCH] fix: properly skip fp16kernels if not enabled and allow building on ios Previously, even if fp16kernels was disabled via no-default-features, the feature check failed. --- rust/lance-linalg/build.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rust/lance-linalg/build.rs b/rust/lance-linalg/build.rs index fee023cf742..20e4ebb1370 100644 --- a/rust/lance-linalg/build.rs +++ b/rust/lance-linalg/build.rs @@ -34,9 +34,20 @@ fn main() -> Result<(), String> { return Ok(()); } + if cfg!(not(feature = "fp16kernels")) { + println!( + "cargo:warning=fp16kernels feature is not enabled, skipping build of fp16 kernels" + ); + return Ok(()); + } + if target_arch == "aarch64" && target_os == "macos" { // Build a version with NEON build_f16_with_flags("neon", &["-mtune=apple-m1"]).unwrap(); + } else if target_arch == "aarch64" && target_os == "ios" { + // Build version with NEON + // A13 bionic is the earliest supported iOS SOC + build_f16_with_flags("neon", &["-mtune=apple-a13"]).unwrap(); } else if target_arch == "aarch64" && target_os == "linux" { // Build a version with NEON build_f16_with_flags("neon", &["-march=armv8.2-a+fp16"]).unwrap();