From ba9a70bf1653e61a79887b6af38e9c4ea39cc3f9 Mon Sep 17 00:00:00 2001 From: Yashas Ambati Date: Wed, 26 Feb 2025 00:04:08 -0500 Subject: [PATCH] Add MacOS targets, modify build script for Darwin, generate type annotations --- .github/workflows/build-cibw.yml | 18 ++++++++++++++++++ build_tools/wheels/cibw_before_all.sh | 23 ++++++++++++----------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-cibw.yml b/.github/workflows/build-cibw.yml index 46516e824..1c9e47f28 100644 --- a/.github/workflows/build-cibw.yml +++ b/.github/workflows/build-cibw.yml @@ -42,6 +42,24 @@ jobs: platform_id: manylinux_aarch64 manylinux_image: manylinux2014 + # MacOS x86_64 + - os: macos-13 + python_version: "3.10" + cibw_python_version: 310 + platform_id: macosx_x86_64 + # - os: macos-13 + # python_version: "3.11" + # cibw_python_version: 311 + # platform_id: macosx_x86_64 + # - os: macos-13 + # python_version: "3.12" + # cibw_python_version: 312 + # platform_id: macosx_x86_64 + # - os: macos-13 + # python_version: "3.13" + # cibw_python_version: 313 + # platform_id: macosx_x86_64 + steps: - name: Checkout uses: actions/checkout@v4 diff --git a/build_tools/wheels/cibw_before_all.sh b/build_tools/wheels/cibw_before_all.sh index f91c13dce..f5c6c7f0c 100644 --- a/build_tools/wheels/cibw_before_all.sh +++ b/build_tools/wheels/cibw_before_all.sh @@ -8,25 +8,25 @@ set -x PYTHON_VERSION="$1" PROJECT_DIR="$2" +ARCH=$(uname -m) export PYTHON="python${PYTHON_VERSION}" -ARCH=$(uname -m) -if [[ $ARCH == x86_64* ]]; then - yum install -y wget ninja-build -elif [[ $ARCH == arm* ]] || [[ $ARCH = aarch64 ]]; then +if [ "$(uname)" == "Linux" ]; then yum install -y wget + + # Install Boost from source + wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz --quiet + tar -xzf boost_1_87_0.tar.gz + cd boost_1_87_0 + ./bootstrap.sh --prefix=/opt/boost + ./b2 install --prefix=/opt/boost --with=all +elif [ "$(uname)" == "Darwin" ]; then + brew install wget cmake boost fi $(which $PYTHON) -m pip install -r $PROJECT_DIR/python/dev_requirements.txt -# Install Boost -wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz --quiet -tar -xzf boost_1_87_0.tar.gz -cd boost_1_87_0 -./bootstrap.sh --prefix=/opt/boost -./b2 install --prefix=/opt/boost --with=all - # Remove build/cache files that were generated on host cd .. rm -rf $PROJECT_DIR/build @@ -50,3 +50,4 @@ cmake $PROJECT_DIR \ cd $PROJECT_DIR/build/python make -j $(nproc) install +make -j $(nproc) python-stubs