From a4d66e95d898d02f1c44c98f51d19f12f1db55cb Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Fri, 25 Jul 2025 10:52:34 -0700 Subject: [PATCH] fix: improve Python finding for Faiss in manylinux environment - Use Development.Module instead of Development component - Find Python in main Faiss CMakeLists.txt before python subdirectory - Add debug output to trace Python variable passing - Set Python_FIND_VIRTUALENV=ONLY for Faiss --- packages/leann-backend-hnsw/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/leann-backend-hnsw/CMakeLists.txt b/packages/leann-backend-hnsw/CMakeLists.txt index 940fa9e..f38167f 100644 --- a/packages/leann-backend-hnsw/CMakeLists.txt +++ b/packages/leann-backend-hnsw/CMakeLists.txt @@ -84,4 +84,8 @@ set(FAISS_BUILD_AVX512 OFF CACHE BOOL "" FORCE) # IMPORTANT: Disable building AVX versions to speed up compilation set(FAISS_BUILD_AVX_VERSIONS OFF CACHE BOOL "" FORCE) +# Force Faiss to use our Python settings +set(Python_FIND_VIRTUALENV ONLY CACHE STRING "" FORCE) +set(Python3_FIND_VIRTUALENV ONLY CACHE STRING "" FORCE) + add_subdirectory(third_party/faiss) \ No newline at end of file