fix(diskann): add diskann into zvec core lib (#602)

This commit is contained in:
rayx 2026-07-19 12:03:35 +08:00 committed by GitHub
parent e89be98bb3
commit cb42297298
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 7 deletions

View File

@ -60,14 +60,16 @@ if(NOT RABITQ_SUPPORTED)
list(FILTER ALL_CORE_SRCS EXCLUDE REGEX ".*/algorithm/hnsw_rabitq/.*")
endif()
# Always exclude algorithm/diskann implementation files from zvec_core.
# The DiskAnn algorithm is provided by the separate core_knn_diskann library
# (STATIC+SHARED, real on Linux x86_64, stub on other platforms). The static
# variant is whole-archived into _zvec.so for the Python wheel; the shared
# variant is used by C++ tools and tests. Including the sources here would
# cause duplicate symbols.
list(FILTER ALL_CORE_SRCS EXCLUDE REGEX ".*/algorithm/diskann/.*")
# Exclude algorithm/diskann implementation files from zvec_core when not
# supported (matching the hnsw_rabitq pattern above). When DISKANN_SUPPORTED,
# the diskann sources are packed into zvec_core directly, so libzvec_core.so
# includes diskann symbols without needing a separate whole-archive step.
# The standalone core_knn_diskann library (built by algorithm/diskann) is still
# whole-archived into _zvec.so; since _zvec.so links zvec_core *normally*
# (not --whole-archive), the linker skips zvec_core's diskann objects there
# (symbols already resolved by core_knn_diskann_static) no duplicates.
if(NOT DISKANN_SUPPORTED)
list(FILTER ALL_CORE_SRCS EXCLUDE REGEX ".*/algorithm/diskann/.*")
list(FILTER ALL_CORE_SRCS EXCLUDE REGEX ".*/interface/indexes/diskann_index\\.cc")
endif()