Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a release with the QI2 integration test branch #506

Open
wants to merge 76 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
637777e
WIP: test_qi2_integration_test is failing with 'Error: Usage error: i…
rturrado Oct 1, 2023
e86382e
OpenQL now compiles test_x90_q12__cnot_q1_q0.cqasm.
rturrado Oct 1, 2023
37867a5
Merge branch 'develop' into qi2_integration_test
rturrado Oct 3, 2023
4423c85
Updated qi2_integration_test to develop, so we have conan profiles no…
rturrado Oct 3, 2023
7f79bfa
CMakeLists.txt: updated lemon version to a one fixing some warnings.
rturrado Oct 5, 2023
083d0a2
src/ql/ir/cqasm/write.cc:
rturrado Oct 5, 2023
add8c42
test/ql/ir/cqasm/read.cc: updated 'read, version_3_0' test.
rturrado Oct 5, 2023
90aa312
Updated test_qi2_integration_test.cc and test_x90_q12__cnot_q1_q0.qasm.
rturrado Oct 5, 2023
4afd69c
Updated to latest libqasm/qi2_integration_test commit.
rturrado Oct 5, 2023
20e390a
Updated to latest rturrado/lemon commit.
rturrado Oct 6, 2023
de97b69
Updated to latest libqasm/qi2_integration_test commit.
rturrado Oct 6, 2023
1b5d178
assets.yml:
rturrado Oct 6, 2023
8f5d31c
assets.yml: fixed Publish job.
rturrado Oct 6, 2023
da5ed52
assets.yml: added 'Build wheel' steps to manylinux jobs.
rturrado Oct 6, 2023
401ea36
Manylinux/x64 build are failing because they cannot find Conan, which…
rturrado Oct 6, 2023
2d3e98c
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
2b17411
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
a40f432
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
c67c759
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
859856d
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
11b8d63
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
64f8ff6
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
7ee3b04
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
9ca1655
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
23aa6f4
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
3ab0d05
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
624a0dd
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
4610bcc
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
afb174b
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
993f996
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
5214c17
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
fa362a6
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
66bf852
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
94592b7
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
f93b109
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
c62ef75
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
ee903a4
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
d15c08d
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
d0733af
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
86c4974
Trying to fix Manylinux/x64 builds.
rturrado Oct 6, 2023
b22accb
Enabling Python 3.8, 3.9, and 3.10 for Manylinux/x64, and Manylinux/A…
rturrado Oct 6, 2023
2a142f0
Testing Manylinux/ARM64 with Python 3.11.
rturrado Oct 6, 2023
8507897
Trying to fix Manylinux/ARM64.
rturrado Oct 6, 2023
59ba969
Trying to fix Manylinux/ARM64.
rturrado Oct 6, 2023
a3895e5
Trying to fix Manylinux/ARM64.
rturrado Oct 6, 2023
aa4e15f
Trying to fix Manylinux/ARM64.
rturrado Oct 6, 2023
1795a40
Trying to fix Manylinux/ARM64.
rturrado Oct 6, 2023
1001536
Trying to fix Manylinux/ARM64.
rturrado Oct 6, 2023
7dfdef3
assets.yml, test.yml: enabled everything.
rturrado Oct 7, 2023
5b67be3
assets.yml: removed repair wheel lines.
rturrado Oct 7, 2023
e15d4e6
Revert "assets.yml: removed repair wheel lines."
rturrado Oct 7, 2023
4132369
Trying to fix C++ tests (gcc/Linux/ARM64) and PyPI wheels for Manylin…
rturrado Oct 7, 2023
e26ede3
Trying to fix C++ tests (gcc/Linux/ARM64) and PyPI wheels for Manylin…
rturrado Oct 7, 2023
28bbf39
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 7, 2023
2d4b3d7
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 7, 2023
ffaf995
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 7, 2023
aeae9a7
Fixed minor PEP suggestions. [skip ci]
rturrado Oct 7, 2023
5e576b1
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 7, 2023
6b83f58
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 7, 2023
15f3df8
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 8, 2023
72c7cd6
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 8, 2023
9c2cecd
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 8, 2023
808384c
Revert "Trying to fix PyPI wheels for Manylinux/ARM64."
rturrado Oct 8, 2023
b6d5b9b
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 8, 2023
5f15e05
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 8, 2023
c055a39
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 8, 2023
07b67f6
Trying to fix PyPI wheels for Manylinux/ARM64.
rturrado Oct 8, 2023
9f7ea83
We may have hitting some problems when creating the wheel.
rturrado Oct 9, 2023
412b1e4
Trying to fix PyPI wheels for Windows/x64.
rturrado Oct 9, 2023
22e4219
Removed reference to Python 3.7. [skip ci]
rturrado Oct 9, 2023
298790a
Changes needed to read in v1.0 input but write out v3.0 output.
rturrado Oct 9, 2023
fe4d541
Trying to publish a wheel.
rturrado Oct 9, 2023
704ede5
Added python_executable Conan option and used it in setup.py's build_…
rturrado Oct 10, 2023
ffa8c7d
Changed cqasm version from 3.0 to 1.0 for test_x90_q12__cnot_q1_q0.
rturrado Oct 10, 2023
e9ba18a
WIP: debugging op(1) issue.
rturrado Oct 18, 2023
aa53929
Revert "WIP: debugging op(1) issue."
rturrado Oct 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 115 additions & 57 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,27 @@ on:
branches:
- 'release**'

# Note: 'actions/upload-release-asset@v1' often fails with 'read ECONNRESET'
# According to https://github.com/actions/upload-release-asset, it is no longer maintained
# To increase the chances of obtaining all assets - potentially after manually retrying - we set
# 'jobs.<job_id>.strategy.fail-fast: false' until a proper solution is implemented
jobs:
macos:
name: PyPI wheels for macOS
macos-x64:
if: ${{ false }} # disable for now
name: 'PyPI wheels for MacOS/x64'
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python:
- '3.8'
- '3.9'
- '3.10'
#- '3.8'
#- '3.9'
#- '3.10'
- '3.11'
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
brew install bison flex swig xquartz
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH
python -m pip install --upgrade pip setuptools wheel
brew install swig xquartz
python -m pip install --upgrade pip conan setuptools wheel
- name: Checkout
uses: actions/checkout@v3
- name: Build wheel
Expand All @@ -43,7 +38,7 @@ jobs:
- name: Wheel path
id: wheel
working-directory: pybuild/dist/
run: echo "##[set-output name=wheel;]$(ls *.whl)"
run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: pypi-macos-py${{ matrix.python }}
Expand All @@ -58,55 +53,124 @@ jobs:
asset_name: ${{ steps.wheel.outputs.wheel }}
asset_content_type: application/zip

manylinux:
name: PyPI wheels for Manylinux
manylinux-x64:
#if: ${{ false }} # disable for now
name: 'PyPI wheels for Manylinux/x64'
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux${{ matrix.manylinux }}_x86_64:latest
env:
FLEX_VERSION: '2.6.4'
BISON_VERSION: ${{ matrix.bison_version }}
SWIG_VERSION: ${{ matrix.swig_version }}
CMAKE_VERSION: '3.1.3'
CMAKE_VERSION: '3.12'
strategy:
fail-fast: false
matrix:
manylinux:
- 2014
- _2_28
cpython_version:
- 'cp38-cp38'
- 'cp39-cp39'
- 'cp310-cp310'
#- 'cp38-cp38'
#- 'cp39-cp39'
#- 'cp310-cp310'
- 'cp311-cp311'
include:
- manylinux: 2014
bison_version: 'bison-3.0.4-2.el7'
swig_version: 'swig3-3.0.12-17.el7'
- manylinux: _2_28
bison_version: 'bison-3.0.4-10.el8'
swig_version: 'swig-3.0.12-19.module_el8.3.0+6167+838326ab'

steps:
- name: Install dependencies
run: |
yum install -y $BISON_VERSION $SWIG_VERSION
/opt/python/${{ matrix.cpython_version }}/bin/python -m pip install auditwheel
- name: Install flex
dnf install -y $SWIG_VERSION
python_bin="/opt/python/${{ matrix.cpython_version }}/bin/python"
${python_bin} -m pip install auditwheel conan wheel-inspect
pip_installation_folder=$(${python_bin} -m pip show --files conan | grep 'Location:' | sed 's/Location: //')
conan_installation_folder_relative_path=$(${python_bin} -m pip show --files conan | grep '/bin/' | sed 's#\s\+\(.*\)/conan#\1#')
conan_installation_folder="${pip_installation_folder}/${conan_installation_folder_relative_path}"
echo "Conan installation folder: ${conan_installation_folder}"
echo "${conan_installation_folder}" >> $GITHUB_PATH
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v3
- name: Build wheel
env:
NPROCS: 5
run: |
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel
wheel2json pybuild/dist/*.whl
/opt/python/${{ matrix.cpython_version }}/bin/python -m auditwheel repair pybuild/dist/*.whl
shell: bash
- name: Wheel path
id: wheel
working-directory: wheelhouse
run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: pypi-linux-${{ matrix.cpython_version }}
path: wheelhouse/${{ steps.wheel.outputs.wheel }}
- uses: actions/upload-release-asset@v1
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: wheelhouse/${{ steps.wheel.outputs.wheel }}
asset_name: ${{ steps.wheel.outputs.wheel }}
asset_content_type: application/zip

manylinux-arm64:
if: ${{ false }} # disable for now
name: 'PyPI wheels for Manylinux/ARM64'
runs-on: [self-hosted, ARM64, Linux]
container: quay.io/pypa/manylinux${{ matrix.manylinux }}_aarch64:latest
env:
BISON_VERSION: ${{ matrix.bison_version }}
FLEX_VERSION: ${{ matrix.flex_version }}
JAVA_VERSION: ${{ matrix.java_version }}
SWIG_VERSION: ${{ matrix.swig_version }}
CMAKE_VERSION: '3.12'
strategy:
fail-fast: false
matrix:
manylinux:
- _2_28
cpython_version:
#- 'cp38-cp38'
#- 'cp39-cp39'
#- 'cp310-cp310'
- 'cp311-cp311'
# We are having problems when using the m4 and zulu-opendjk Conan packages on an armv8 architecture
# m4 is required by flex/bison and zulu-openjdk provides the Java JRE required by the ANTLR generator
# So, for the time being, we are installing flex/bison and java manually for this platform
include:
- manylinux: _2_28
bison_version: 'bison-3.0.4-10.el8'
flex_version: 'flex-2.6.1-9.el8'
java_version: 'java-11-openjdk-11.0.20.0.8-3.el8'
swig_version: 'swig-3.0.12-19.module_el8.4.0+2254+838326ab'
steps:
- name: Install dependencies
run: |
mkdir -p $HOME/flex
curl -L https://github.com/westes/flex/releases/download/v$FLEX_VERSION/flex-$FLEX_VERSION.tar.gz | tar xz --strip-components=1 -C $HOME/flex
cd $HOME/flex
./configure
make -j
make install
dnf install -y $BISON_VERSION $FLEX_VERSION $JAVA_VERSION $SWIG_VERSION
python_bin="/opt/python/${{ matrix.cpython_version }}/bin/python"
${python_bin} -m pip install auditwheel conan wheel-inspect
pip_installation_folder=$(${python_bin} -m pip show --files conan | grep 'Location:' | sed 's/Location: //')
conan_installation_folder_relative_path=$(${python_bin} -m pip show --files conan | grep '/bin/' | sed 's#\s\+\(.*\)/conan#\1#')
conan_installation_folder="${pip_installation_folder}/${conan_installation_folder_relative_path}"
echo "Conan installation folder: ${conan_installation_folder}"
echo "${conan_installation_folder}" >> $GITHUB_PATH
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v3
- name: Build wheel
env:
NPROCS: 5
run: |
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel
wheel2json pybuild/dist/*.whl
/opt/python/${{ matrix.cpython_version }}/bin/python -m auditwheel repair pybuild/dist/*.whl
- name: Wheel path
id: wheel
working-directory: wheelhouse
run: echo "##[set-output name=wheel;]$(ls *.whl)"
run: echo "{wheel}={$(ls *.whl)}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: pypi-linux-${{ matrix.cpython_version }}
Expand All @@ -121,33 +185,25 @@ jobs:
asset_name: ${{ steps.wheel.outputs.wheel }}
asset_content_type: application/zip

windows:
name: PyPI wheels for Windows
windows-x64:
if: ${{ false }} # disable for now
name: 'PyPI wheels for Windows/x64'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python:
- '3.8'
- '3.9'
- '3.10'
#- '3.8'
#- '3.9'
#- '3.10'
- '3.11'
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v3
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey-python-1
restore-keys: |
${{ runner.os }}-chocolatey-python-
${{ runner.os }}-chocolatey-
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
choco install winflexbison3 --version 2.5.18.20190508
#choco install swig --version 4.0.1
python -m pip install --upgrade pip conan setuptools wheel
- name: Checkout
uses: actions/checkout@v3
- name: Build wheel
Expand All @@ -157,7 +213,7 @@ jobs:
- name: Wheel path
id: wheel
working-directory: pybuild/dist/
run: echo "##[set-output name=wheel;]$(Get-ChildItem -name *.whl)"
run: echo "{wheel}={$(Get-ChildItem -name *.whl)}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: pypi-windows-py${{ matrix.python }}
Expand All @@ -174,11 +230,13 @@ jobs:

publish:
name: Publish
#if: ${{ false }} # disable for now
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
needs:
- macos
- manylinux
- windows
#- macos-x64
- manylinux-x64
#- manylinux-arm64
#- windows-x64
runs-on: ubuntu-latest
steps:
- name: Download artifacts
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
cpp-linux-macos-windows:
if: ${{ false }} # disable for now
name: 'C++ tests (Linux-MacOS-Windows/x64)'
strategy:
fail-fast: false
Expand Down Expand Up @@ -59,7 +60,7 @@ jobs:
matrix:
os:
- Linux
- macOS
#- macOS
steps:
- if: matrix.os == 'Linux'
name: Install gcc and python (Linux)
Expand Down Expand Up @@ -96,6 +97,7 @@ jobs:
run: ctest -C Release --output-on-failure

python:
if: ${{ false }} # disable for now
name: Python
runs-on: ${{ matrix.os }}
strategy:
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ find_package(nlohmann_json REQUIRED)

include(FetchContent)


# QI2 integration test: temporarily using a commit from libqasm/qi2_integration_test
message(STATUS "Fetching cqasm")
FetchContent_Declare(cqasm
message(STATUS "Fetching cqasm")
GIT_REPOSITORY https://github.com/QuTech-Delft/libqasm.git
GIT_TAG "9879dcc9ce5f750f9d2110d1cc81162be63ad9d7"
GIT_TAG "89b3194d10073ca2028dac75df87c27697ef6443"
)
FetchContent_MakeAvailable(cqasm)

Expand All @@ -194,7 +196,7 @@ FetchContent_MakeAvailable(cqasm)
message(STATUS "Fetching lemon")
FetchContent_Declare(lemon
GIT_REPOSITORY https://github.com/rturrado/lemon.git
GIT_TAG "e70acea5764a97ab3b6d31b883300f3ce1587cde"
GIT_TAG "98949a86b83572f66f79ac21516ff44dfd4c40db"
)
FetchContent_MakeAvailable(lemon)

Expand Down
4 changes: 4 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class OpenQLConan(ConanFile):
"debug_symbols": [True, False],
"disable_unitary": [True, False],
"python_dir": [None, "ANY"],
"python_executable": [None, "ANY"],
"python_ext": [None, "ANY"]
}
default_options = {
Expand All @@ -25,6 +26,7 @@ class OpenQLConan(ConanFile):
"debug_symbols": False,
"disable_unitary": True,
"python_dir": None,
"python_executable": None,
"python_ext": None
}

Expand All @@ -44,6 +46,7 @@ def build_requirements(self):
if self.settings.arch != "armv8":
self.tool_requires("flex/2.6.4")
self.tool_requires("bison/3.8.2")
self.requires("range-v3/0.12.0")
if self.settings.arch != "armv8":
self.tool_requires("zulu-openjdk/11.0.19")
if self.options.build_tests:
Expand Down Expand Up @@ -76,6 +79,7 @@ def generate(self):
tc.variables["OPENQL_DEBUG_SYMBOLS"] = self.options.debug_symbols
tc.variables["OPENQL_PYTHON_DIR"] = self.options.python_dir
tc.variables["OPENQL_PYTHON_EXT"] = self.options.python_ext
tc.variables["PYTHON_EXECUTABLE"] = not self.options.python_executable
tc.variables["WITH_UNITARY_DECOMPOSITION"] = not self.options.disable_unitary
tc.generate()

Expand Down
14 changes: 0 additions & 14 deletions include/ql/ir/cqasm/read.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,6 @@ struct ReadOptions {
* the filename if one exists for the purpose of generating better error
* messages.
*/
void read_v1(
const Ref &ir,
const utils::Str &data,
const utils::Str &fname = "<unknown>",
const ReadOptions &options = {}
);

void read_v3(
const Ref &ir,
const utils::Str &data,
const utils::Str &fname = "<unknown>",
const ReadOptions &options = {}
);

void read(
const Ref &ir,
const utils::Str &data,
Expand Down
13 changes: 7 additions & 6 deletions include/ql/ir/cqasm/write.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

#include "ql/ir/ir.h"

namespace ql {
namespace ir {
namespace cqasm {
#include <compare> // strong_ordering


namespace ql::ir::cqasm {

/**
* The manner in which wait instructions are printed.
Expand Down Expand Up @@ -135,6 +136,6 @@ utils::Str to_string(
const WriteOptions &options = {}
);

} // namespace cqasm
} // namespace ir
} // namespace ql
std::strong_ordering version_compare(const utils::Vec<utils::UInt> &lhs, const utils::Vec<utils::UInt> &rhs);

} // namespace ql::ir::cqasm
2 changes: 1 addition & 1 deletion include/ql/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*
* OPENQL_VERSION_STRING is also decoded by setup.py
*/
#define OPENQL_VERSION_STRING "0.11.1"
#define OPENQL_VERSION_STRING "0.11.2"
Loading
Loading