fix: add missing dependencies for CI builds
- Add libomp for macOS to fix OpenMP linking error - Add python3-devel for Linux (though may not be needed in manylinux) - Install numpy before building to satisfy faiss CMake requirements - Add before-build configuration to cibuildwheel
This commit is contained in:
28
.github/workflows/build-cibuildwheel.yml
vendored
28
.github/workflows/build-cibuildwheel.yml
vendored
@@ -53,11 +53,15 @@ jobs:
|
|||||||
# Linux dependencies - 使用yum因为manylinux2014基于CentOS 7
|
# Linux dependencies - 使用yum因为manylinux2014基于CentOS 7
|
||||||
CIBW_BEFORE_ALL_LINUX: |
|
CIBW_BEFORE_ALL_LINUX: |
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3
|
yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3 python3-devel
|
||||||
ln -sf /usr/bin/cmake3 /usr/bin/cmake
|
ln -sf /usr/bin/cmake3 /usr/bin/cmake
|
||||||
|
|
||||||
|
# Install numpy before building
|
||||||
|
CIBW_BEFORE_BUILD: |
|
||||||
|
pip install numpy
|
||||||
|
|
||||||
CIBW_BEFORE_ALL_MACOS: |
|
CIBW_BEFORE_ALL_MACOS: |
|
||||||
brew install boost zeromq openblas cmake
|
brew install boost zeromq openblas cmake libomp
|
||||||
|
|
||||||
# Test the wheel
|
# Test the wheel
|
||||||
CIBW_TEST_COMMAND: |
|
CIBW_TEST_COMMAND: |
|
||||||
@@ -68,6 +72,12 @@ jobs:
|
|||||||
CMAKE_BUILD_PARALLEL_LEVEL=8
|
CMAKE_BUILD_PARALLEL_LEVEL=8
|
||||||
Python_FIND_VIRTUALENV=ONLY
|
Python_FIND_VIRTUALENV=ONLY
|
||||||
Python3_FIND_VIRTUALENV=ONLY
|
Python3_FIND_VIRTUALENV=ONLY
|
||||||
|
|
||||||
|
# Linux-specific environment variables
|
||||||
|
CIBW_ENVIRONMENT_LINUX: |
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL=8
|
||||||
|
Python_FIND_VIRTUALENV=ONLY
|
||||||
|
Python3_FIND_VIRTUALENV=ONLY
|
||||||
|
|
||||||
- name: Build leann-backend-diskann wheels
|
- name: Build leann-backend-diskann wheels
|
||||||
uses: pypa/cibuildwheel@v2.20.0
|
uses: pypa/cibuildwheel@v2.20.0
|
||||||
@@ -83,11 +93,15 @@ jobs:
|
|||||||
|
|
||||||
CIBW_BEFORE_ALL_LINUX: |
|
CIBW_BEFORE_ALL_LINUX: |
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3
|
yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3 python3-devel
|
||||||
ln -sf /usr/bin/cmake3 /usr/bin/cmake
|
ln -sf /usr/bin/cmake3 /usr/bin/cmake
|
||||||
|
|
||||||
|
# Install numpy before building
|
||||||
|
CIBW_BEFORE_BUILD: |
|
||||||
|
pip install numpy
|
||||||
|
|
||||||
CIBW_BEFORE_ALL_MACOS: |
|
CIBW_BEFORE_ALL_MACOS: |
|
||||||
brew install boost zeromq openblas cmake
|
brew install boost zeromq openblas cmake libomp
|
||||||
|
|
||||||
CIBW_TEST_COMMAND: |
|
CIBW_TEST_COMMAND: |
|
||||||
python -c "import leann_backend_diskann; print('DiskANN backend imported successfully')"
|
python -c "import leann_backend_diskann; print('DiskANN backend imported successfully')"
|
||||||
@@ -96,6 +110,12 @@ jobs:
|
|||||||
CMAKE_BUILD_PARALLEL_LEVEL=8
|
CMAKE_BUILD_PARALLEL_LEVEL=8
|
||||||
Python_FIND_VIRTUALENV=ONLY
|
Python_FIND_VIRTUALENV=ONLY
|
||||||
Python3_FIND_VIRTUALENV=ONLY
|
Python3_FIND_VIRTUALENV=ONLY
|
||||||
|
|
||||||
|
# Linux-specific environment variables
|
||||||
|
CIBW_ENVIRONMENT_LINUX: |
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL=8
|
||||||
|
Python_FIND_VIRTUALENV=ONLY
|
||||||
|
Python3_FIND_VIRTUALENV=ONLY
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -73,10 +73,17 @@ manylinux-aarch64-image = "manylinux2014"
|
|||||||
[tool.cibuildwheel.linux]
|
[tool.cibuildwheel.linux]
|
||||||
before-all = """
|
before-all = """
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3
|
yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3 python3-devel
|
||||||
ln -sf /usr/bin/cmake3 /usr/bin/cmake
|
ln -sf /usr/bin/cmake3 /usr/bin/cmake
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# macOS系统依赖
|
# macOS系统依赖
|
||||||
[tool.cibuildwheel.macos]
|
[tool.cibuildwheel.macos]
|
||||||
before-all = "brew install boost zeromq openblas cmake"
|
before-all = "brew install boost zeromq openblas cmake libomp"
|
||||||
|
|
||||||
|
# 环境变量配置
|
||||||
|
[tool.cibuildwheel.environment]
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL = "8"
|
||||||
|
|
||||||
|
# 构建前安装必要的Python包
|
||||||
|
before-build = "pip install numpy"
|
||||||
|
|||||||
Reference in New Issue
Block a user