fix: auto-detect Homebrew paths for both DiskANN and HNSW backends

- Fix DiskANN CMakeLists.txt path reference
- Add macOS environment variable detection for OpenMP_ROOT
- Support both Intel (/usr/local) and Apple Silicon (/opt/homebrew) paths
This commit is contained in:
Andy Lee
2025-08-09 23:24:48 +00:00
parent e16c369bfb
commit a620c2077a
2 changed files with 13 additions and 1 deletions

View File

@@ -119,6 +119,18 @@ jobs:
uv pip install --system delocate
fi
- name: Set macOS environment variables
if: runner.os == 'macOS'
run: |
# Detect Homebrew installation path and set environment variables
if [ -d "/opt/homebrew/opt/libomp" ]; then
echo "HOMEBREW_PREFIX=/opt/homebrew" >> $GITHUB_ENV
echo "OpenMP_ROOT=/opt/homebrew/opt/libomp" >> $GITHUB_ENV
elif [ -d "/usr/local/opt/libomp" ]; then
echo "HOMEBREW_PREFIX=/usr/local" >> $GITHUB_ENV
echo "OpenMP_ROOT=/usr/local/opt/libomp" >> $GITHUB_ENV
fi
- name: Build packages
run: |
# Build core (platform independent)

View File

@@ -5,4 +5,4 @@ project(leann_backend_diskann_wrapper)
# Tell CMake to directly enter the DiskANN submodule and execute its own CMakeLists.txt
# DiskANN will handle everything itself, including compiling Python bindings
add_subdirectory(src/third_party/DiskANN)
add_subdirectory(third_party/DiskANN)