Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
fix windows?
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed May 15, 2024
1 parent 3536701 commit 9c98afe
Show file tree
Hide file tree
Showing 14 changed files with 1,005 additions and 118 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ inputs:
ARCH:
description: 'matrix.arch'
required: true
PY_VERSION:
description: 'matrix.py_version'
required: true

description: ''

outputs:
BOOST_ROOT:
description: ''
value: ${{ steps.install_boost.outputs.BOOST_ROOT }}
BOOST_VERSION:
description: ''
value: 1.74.0

runs:
using: "composite"
Expand All @@ -22,12 +28,16 @@ runs:
uses: aminya/setup-cpp@v1
with:
compiler: gcc
vcvarsall: ${{ contains(inputs.OS, 'windows') }}
vcvarsall: ${{ contains(inputs.OS, 'windows') }} # evaluate to the string 'true'
msvc: ${{ contains(inputs.OS, 'windows') }}
choco: ${{ contains(inputs.OS, 'windows') }}
cmake: true
ninja: true

- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.PY_VERSION }}

- uses: makslevental/mlir-wheels/actions/setup_ccache@d77bf5dc69c46a8c2738b44528749768888eb361
id: setup_ccache
with:
Expand All @@ -36,8 +46,39 @@ runs:
WORKSPACE_ROOT: ${{ github.workspace }}

- name: Install boost for XRT
if: contains(inputs.OS, 'windows') || contains(inputs.OS, 'ubuntu')
uses: MarkusJx/install-boost@v2.4.5
id: install_boost
with:
boost_version: 1.73.0
boost_version: 1.74.0

- name: Build and install system deps
shell: bash
run: |
if [ ${{ inputs.OS }} == 'windows-2019' ]; then
choco install -y pkgconfiglite protoc
else
sudo apt install -y libdrm-dev ocl-icd-opencl-dev rapidjson-dev libprotobuf-dev systemtap-sdt-dev uuid-dev python3-dev
fi
- name: Remove path limit and export VCTOOLSVERSION
if: contains(inputs.OS, 'windows')
shell: pwsh
run: |
pwsh.exe .\util\remove_path_limit.ps1
- name: export VCTOOLSVERSION
if: contains(inputs.OS, 'windows')
shell: bash
run: |
VCTOOLSVERSION=${VCTOOLSVERSION:0:4}
echo "VCTOOLSVERSION=$VCTOOLSVERSION" >> $GITHUB_ENV
- name: Install python deps
shell: bash
run: |
ls -lah
pip install -r requirements-dev.txt
56 changes: 16 additions & 40 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ jobs:
shell: bash

steps:

- name: Checkout actions
uses: actions/checkout@v3
with:
submodules: true

- name: Get recursive submodules
- name: Get Submodules
run: |
git submodule update --init --recursive
Expand All @@ -43,30 +44,18 @@ jobs:
with:
OS: ${{ matrix.OS }}
ARCH: ${{ matrix.ARCH }}

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PY_VERSION }}

- name: Build and install protoc
if: contains(matrix.OS, 'windows') || contains(matrix.OS, 'ubuntu')
run: |
if [ ${{ matrix.OS }} == 'windows-2019' ]; then
choco install -y pkgconfiglite protoc
else
sudo apt install -y libdrm-dev ocl-icd-opencl-dev rapidjson-dev libprotobuf-dev systemtap-sdt-dev uuid-dev python3-dev
fi
PY_VERSION: ${{ matrix.PY_VERSION }}

- name: build wheel
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
REPO_SRC_DIR=$PWD bash patches/apply_patches.sh
pip install -r requirements-dev.txt
pip wheel . -v -w wheelhouse --no-build-isolation
CIBW_BUILD=${{ matrix.PY_VERSION }}
CIBW_BUILD="cp${CIBW_BUILD//./}-*"
echo "CIBW_BUILD=$CIBW_BUILD" | tee -a $GITHUB_ENV
cibuildwheel --output-dir wheelhouse
- name: test
run: |
Expand Down Expand Up @@ -99,52 +88,39 @@ jobs:
PY_VERSION: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

steps:

- name: Checkout actions
uses: actions/checkout@v3
with:
submodules: true

- name: Get recursive submodules
- name: Get Submodules
run: |
git submodule update --init --recursive
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: gcc
cmake: true
ninja: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: aarch64

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PY_VERSION }}

- uses: ./.github/workflows/base
id: base
with:
OS: ${{ matrix.OS }}
ARCH: ${{ matrix.ARCH }}

- name: Install XRT deps
run: |
sudo apt install -y libdrm-dev ocl-icd-opencl-dev rapidjson-dev libprotobuf-dev systemtap-sdt-dev uuid-dev python3-dev
PY_VERSION: ${{ matrix.PY_VERSION }}

- name: build wheel
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
REPO_SRC_DIR=$PWD bash patches/apply_patches.sh
pip install -r requirements-dev.txt
pip wheel . -v -w wheelhouse --no-build-isolation
CIBW_BUILD=${{ matrix.PY_VERSION }}
CIBW_BUILD="cp${CIBW_BUILD//./}-*"
echo "CIBW_BUILD=$CIBW_BUILD" | tee -a $GITHUB_ENV
cibuildwheel --output-dir wheelhouse
- name: test
run: |
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,26 @@ jobs:
with:
submodules: true

- name: Get recursive submodules
- name: Get Submodules
run: |
git submodule update --init --recursive
- uses: ./.github/workflows/base
if: contains(matrix.OS, 'windows')
id: base
with:
OS: ${{ matrix.OS }}
ARCH: ${{ matrix.ARCH }}

- name: Build and install protoc
if: contains(matrix.OS, 'windows')
run: |
choco install -y pkgconfiglite protoc
PY_VERSION: '3.10'

# build

- name: cibuildwheel python bindings
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
# done
Expand All @@ -85,30 +78,36 @@ jobs:

steps:

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: aarch64

- name: Checkout actions
uses: actions/checkout@v3
with:
submodules: true

- name: Get recursive submodules
- name: Get Submodules
run: |
git submodule update --init --recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- uses: ./.github/workflows/base
id: base
with:
platforms: aarch64
OS: ubuntu-20.04
ARCH: aarch64
PY_VERSION: '3.10'

# build

- name: cibuildwheel python bindings aarch64
env:
BOOST_ROOT: ${{ steps.base.outputs.BOOST_ROOT }}
BOOST_VERSION: 1.73.0
BOOST_VERSION: ${{ steps.base.outputs.BOOST_VERSION }}
run: |
pip install cibuildwheel
cibuildwheel --output-dir wheelhouse
# done
Expand Down
18 changes: 15 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
cmake-build-debug
cmake-build-release
.envrc
cmake-build-*
.envrc
*.whl
*.zip
*.ilk
*.pyd
*.lib
*.exp
*.pdb
*.dll
*.json
*.pdi
*.bif
*.bin
*.xclbin
Loading

0 comments on commit 9c98afe

Please sign in to comment.