Skip to content

armgit / LEANN

Public Imported from GitHub
0

[MLsys2026 Best Paper]: https://arxiv.org/abs/2506.08276. RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.

build(diskann): force USE_TCMALLOC off via root CMakeLists

Aakash Suresh1225df97aa43
diff --git a/packages/leann-backend-diskann/CMakeLists.txt b/packages/leann-backend-diskann/CMakeLists.txt
new file mode 100644
index 0000000..a944399
--- /dev/null
+++ b/packages/leann-backend-diskann/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Wrapper so USE_TCMALLOC is OFF before DiskANN's option() runs. DiskANN's
+# FetchContent(tcmalloc) pulls protobuf/re2/fuzztest and fails on Linux CI when
+# Abseil CMake targets are missing (e.g. ubuntu arm64 with apt protobuf only).
+cmake_minimum_required(VERSION 3.24)
+project(leann_backend_diskann_wrapper NONE)
+
+set(USE_TCMALLOC OFF CACHE BOOL "Use tcmalloc from gperftools" FORCE)
+
+add_subdirectory(third_party/DiskANN)
diff --git a/packages/leann-backend-diskann/pyproject.toml b/packages/leann-backend-diskann/pyproject.toml
index 8745111..e8f3858 100644
--- a/packages/leann-backend-diskann/pyproject.toml
+++ b/packages/leann-backend-diskann/pyproject.toml
@@ -8,8 +8,8 @@ version = "0.3.7"
dependencies = ["leann-core==0.3.7", "numpy", "protobuf>=3.19.0"]
[tool.scikit-build]
-# Key: simplified CMake path
-cmake.source-dir = "third_party/DiskANN"
+# Root CMake forces USE_TCMALLOC=OFF before DiskANN options (see CMakeLists.txt).
+cmake.source-dir = "."
# Key: Python package in root directory, paths match exactly
wheel.packages = ["leann_backend_diskann"]
# Use default redirect mode