From 07f8129f650b60254039aa74e41ed06fed021f33 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Mon, 1 Sep 2025 15:21:06 -0700 Subject: [PATCH] fix: Apply ARM64 compatibility fix directly to Faiss submodule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Modify faiss/impl/pq.cpp to use x86-specific preprocessor conditions - Remove patch file approach in favor of direct submodule modification - Update CMakeLists.txt to reflect the submodule changes - Fixes ARM64 Linux compilation by preventing x86 SIMD header inclusion This resolves the "xmmintrin.h: No such file or directory" error when building ARM64 Linux wheels for Docker compatibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- packages/leann-backend-hnsw/CMakeLists.txt | 3 +++ packages/leann-backend-hnsw/third_party/faiss | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/leann-backend-hnsw/CMakeLists.txt b/packages/leann-backend-hnsw/CMakeLists.txt index 2eff141..6ca6d55 100644 --- a/packages/leann-backend-hnsw/CMakeLists.txt +++ b/packages/leann-backend-hnsw/CMakeLists.txt @@ -60,6 +60,9 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") # Use SVE optimization level for ARM64 (as seen in Faiss conda build) set(FAISS_OPT_LEVEL "sve" CACHE STRING "" FORCE) message(STATUS "Setting FAISS_OPT_LEVEL to 'sve' for ARM64") + + # ARM64 compatibility: Faiss submodule has been modified to fix x86 header inclusion + message(STATUS "Using ARM64-compatible Faiss submodule") endif() # Additional optimization options from INSTALL.md diff --git a/packages/leann-backend-hnsw/third_party/faiss b/packages/leann-backend-hnsw/third_party/faiss index a036185..021ced0 160000 --- a/packages/leann-backend-hnsw/third_party/faiss +++ b/packages/leann-backend-hnsw/third_party/faiss @@ -1 +1 @@ -Subproject commit a0361858fc9cbc95239ef304d9c85d48bb2701c8 +Subproject commit 021ced0d9039a6a92a89e27555d55aee43c00a2e