Skip to content

Commit

Permalink
Fix Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Jun 29, 2024
1 parent 5479573 commit 7eb6459
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,71 @@ jobs:
name: pennylane_qrack-${{ matrix.platform }}
path: dist/

build_windows:
runs-on: windows-latest # Use a Linux runner
strategy:
matrix:
platform:
- win-amd64
dependencies: [vcpkg]
steps:
- name: Checkout PennyLane-Qrack
uses: actions/checkout@v4

- name: Checkout Qrack
uses: actions/checkout@v4
with:
repository: 'unitaryfund/qrack'
path: qrack

- name: Checkout Catalyst
uses: actions/checkout@v4
with:
repository: 'PennyLaneAI/catalyst'
path: catalyst

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools pybind11
- name: Install vcpkg dependencies
run: |
vcpkg install opencl
- name: Build Qrack Windows x86-64
run: |
cd qrack
mkdir build
cd build
powershell -c "Invoke-WebRequest -Uri 'https://github.com/ckormanyos/xxd/releases/download/v1.1/xxd-win64-msvc.zip' -OutFile 'xxd-win64-msvc.zip'"
powershell -c "Expand-Archive -Path xxd-win64-msvc.zip -DestinationPath ."
cmake .. -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DXXD_BIN="xxd.exe" -DQBCAPPOW=12 -DCPP_STD=14
cmake --build . --config Release --target install
- name: Build Catalyst Windows x86-64
run: |
powershell -c "Invoke-WebRequest -Uri 'https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip' -OutFile 'ninja-win.zip'"
powershell -c "Expand-Archive -Path ninja-win.zip -DestinationPath ."
set PATH=%PATH%;${GITHUB_WORKSPACE}
cd catalyst
git submodule update --init --depth=1
pip install -r requirements.txt
make all
- name: Build Wheel
run: |
pip install -r requirements.txt
pip install .
python setup.py bdist_wheel
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: pennylane_qrack-${{ matrix.platform }}
path: dist/

0 comments on commit 7eb6459

Please sign in to comment.