Skip to content

Commit

Permalink
CICD: Disable delocate and manually copy over libomp
Browse files Browse the repository at this point in the history
  • Loading branch information
RUrlus committed Oct 18, 2024
1 parent 6759875 commit cd4781b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types:
- published

env:
vars:
LLVM_VERSION: "llvmorg-19.1.1"
MACOS_DEPL_VERSION: "12.0"
CIBUILD_VERSION: "2.21.2"
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Clone OpenMP repo
if: matrix.os == 'macos-latest' && steps.clone-openmp.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch ${{env.LLVM_VERSION}} https://github.com/llvm/llvm-project
git clone --depth 1 --branch ${{vars.LLVM_VERSION}} https://github.com/llvm/llvm-project
- name: Build OpenMP
Expand All @@ -78,15 +78,15 @@ jobs:
mkdir openmp_build
cmake -S openmp -B openmp_build \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{env.MACOS_DEPL_VERSION}} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{vars.MACOS_DEPL_VERSION}} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX="$HOME/.local/libomp"
cmake --build openmp_build --target install --config Release
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==${{env.CIBUILD_VERSION}}
run: python -m pip install cibuildwheel==${{vars.CIBUILD_VERSION}}

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
Expand All @@ -95,7 +95,7 @@ jobs:
CIBW_TEST_COMMAND: pytest {project}/tests && python -c "from sparse_dot_topn import _has_openmp_support;assert _has_openmp_support"
# only build for arm; x86_64 wheels are build seperately
CIBW_ARCHS_MACOS: "arm64"
CIBW_ENVIRONMENT_MACOS: PATH="$HOME/.local/:$PATH" MACOSX_DEPLOYMENT_TARGET=${{env.MACOS_DEPL_VERSION}} DYLD_LIBRARY_PATH="$HOME/.local/libomp/lib" CMAKE_ARGS="-DSDTN_ENABLE_ARCH_FLAGS=OFF -DSDTN_VENDOR_OPENMP=ON -DSDTN_ENABLE_OPENMP=ON -DSDTN_DISABLE_OPENMP=OFF -DOpenMP_ROOT=$HOME/.local/libomp"
CIBW_ENVIRONMENT_MACOS: PATH="$HOME/.local/:$PATH" MACOSX_DEPLOYMENT_TARGET=${{vars.MACOS_DEPL_VERSION}} DYLD_LIBRARY_PATH="$HOME/.local/libomp/lib" CMAKE_ARGS="-DSDTN_ENABLE_ARCH_FLAGS=OFF -DSDTN_VENDOR_OPENMP=ON -DSDTN_ENABLE_OPENMP=ON -DSDTN_DISABLE_OPENMP=OFF -DOpenMP_ROOT=$HOME/.local/libomp"

- name: Verify clean directory
run: git diff --exit-code
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Clone OpenMP repo
if: steps.clone-openmp.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch ${{env.LLVM_VERSION}} https://github.com/llvm/llvm-project
git clone --depth 1 --branch ${{vars.LLVM_VERSION}} https://github.com/llvm/llvm-project
- name: Build OpenMP
shell: bash
Expand All @@ -146,11 +146,11 @@ jobs:
-DCMAKE_INSTALL_PREFIX="/usr/local"
cmake --build openmp_build --target install --config Release
- uses: pypa/cibuildwheel@v${{env.CIBUILD_VERSION}}
- uses: pypa/cibuildwheel@v${{vars.CIBUILD_VERSION}}
env:
# only build for x86_64, arm wheels are build seperately
CIBW_ARCHS: "x86_64"
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="12.0" CMAKE_ARGS="-DSDTN_ENABLE_ARCH_FLAGS=OFF -DSDTN_ENABLE_OPENMP=ON -DSDTN_DISABLE_OPENMP=OFF -DOpenMP_ROOT=/usr/local"
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=$MACOS_DEPL_VERSION CMAKE_ARGS="-DSDTN_ENABLE_ARCH_FLAGS=OFF -DSDTN_VENDOR_OPENMP=ON -DSDTN_ENABLE_OPENMP=ON -DSDTN_DISABLE_OPENMP=OFF -DOpenMP_ROOT=/usr/local"

- name: Verify clean directory
run: git diff --exit-code
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}"
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
# Needed for full C++17 support
environment = { MACOSX_DEPLOYMENT_TARGET = "12.0", CMAKE_ARGS="-DSDTN_ENABLE_ARCH_FLAGS=OFF -DSDTN_DISABLE_OPENMP=ON" }
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
Expand Down

0 comments on commit cd4781b

Please sign in to comment.