Skip to content

Commit

Permalink
Merge pull request #182 from QuTech-Delft/release-0.5.0
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
rturrado authored Dec 22, 2023
2 parents 32eadff + c8ad934 commit 077ab84
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 22 deletions.
6 changes: 5 additions & 1 deletion .github/actions/cpp-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ runs:
shell: ${{ inputs.shell }}
- name: Get latest CMake
uses: lukka/get-cmake@latest
# We clean the Conan cache as a preventive measure for our runs in self-hosted runners
# Self-hosted runners use containers that cache Conan packages from previous runs,
# and that can cause different type of problems
- name: Configure and build
run: |
conan profile detect --force
conan remove -c "*/*"
conan_profile=${{ inputs.conan_profile }}
lowercase_conan_profile=$(echo ${conan_profile} | tr '[:upper:]' '[:lower:]')
conan build . -pr=conan/profiles/${lowercase_conan_profile} -b missing
shell: ${{ inputs.shell }}
- name: Test
working-directory: build/${{ inputs.build_type }}
run: ctest -C ${{ inputs.build_type }} --output-on-failure
run: ctest -C ${{ inputs.build_type }} --output-on-failure --parallel 10
shell: ${{ inputs.shell }}
45 changes: 35 additions & 10 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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 @@ -56,6 +56,8 @@ jobs:
name: PyPI wheels for Manylinux (x64)
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux${{ matrix.manylinux }}_x86_64:latest
env:
SWIG_VERSION: ${{ matrix.swig_version }}
strategy:
matrix:
manylinux:
Expand All @@ -66,21 +68,27 @@ jobs:
- "cp310-cp310"
- "cp311-cp311"
- "cp312-cp312"
include:
- manylinux: _2_28
swig_version: 'swig-3.0.12-19.module_el8.3.0+6167+838326ab'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
yum install -y bison-$BISON_VERSION swig3-$SWIG_VERSION
/opt/python/${{ matrix.cpython_version }}/bin/python -m pip install --upgrade conan wheel auditwheel
dnf install -y $SWIG_VERSION
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
python -m pip install --upgrade conan wheel auditwheel
- name: Build wheel
run: |
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
conan remove -c "*/*"
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel
/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 @@ -102,6 +110,11 @@ jobs:
- "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 }}
strategy:
matrix:
manylinux:
Expand All @@ -112,21 +125,33 @@ jobs:
- "cp310-cp310"
- "cp311-cp311"
- "cp312-cp312"
# 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.21.0.9-2.el8'
swig_version: 'swig-3.0.12-19.module_el8.4.0+2254+838326ab'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
/opt/python/${{ matrix.cpython_version }}/bin/python -m pip install --upgrade pip conan wheel auditwheel
dnf install -y $BISON_VERSION $FLEX_VERSION $JAVA_VERSION $SWIG_VERSION
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
python -m pip install --upgrade pip conan wheel auditwheel
- name: Build wheel
run: |
conan remove -c "qx/*"
/opt/python/${{ matrix.cpython_version }}/bin/python setup.py bdist_wheel
/opt/python/${{ matrix.cpython_version }}/bin/python -m auditwheel repair pybuild/dist/*.whl
export PATH="/opt/python/${{ matrix.cpython_version }}/bin:$PATH"
conan remove -c "*/*"
python setup.py bdist_wheel
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 Down Expand Up @@ -165,7 +190,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 Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: ./.github/actions/cpp-tests
with:
build_type: ${{ matrix.build_type }}
conan_profile: tests-${{ matrix.build_type }}-macos-x64
conan_profile: tests-${{ matrix.build_type }}-apple_clang-macos-x64
shell: bash

cpp-windows-x64:
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: ./.github/actions/cpp-tests
with:
build_type: ${{ matrix.build_type }}
conan_profile: tests-${{ matrix.build_type }}-windows-x64
conan_profile: tests-${{ matrix.build_type }}-msvc-windows-x64
shell: bash

cpp-linux-arm64:
Expand All @@ -83,14 +83,14 @@ jobs:
# 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
- name: Install bison, flex and java
- name: Install dependencies
run: |
apt-get update
apt-get install -y bison flex default-jre
- uses: ./.github/actions/cpp-tests
with:
build_type: ${{ matrix.build_type }}
conan_profile: tests-${{ matrix.build_type }}-linux-arm64
conan_profile: tests-${{ matrix.build_type }}-gcc-linux-arm64
shell: bash

cpp-macos-arm64:
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- uses: ./.github/actions/cpp-tests
with:
build_type: ${{ matrix.build_type }}
conan_profile: tests-${{ matrix.build_type }}-macos-arm64
conan_profile: tests-${{ matrix.build_type }}-apple_clang-macos-arm64
shell: bash

python-linux-x64:
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Change Log

All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [ 0.5.0 ] - [ 2023-12-16 ]

### Added

- cQasm 3.0 parser. MVP (Minimum Viable Product) implemented. Extended v3 is a WIP.
- Conan as package manager.
- res folder for resources.

### Changed

- Different upgrades: C++20, CMake 3.12, Python 3.8 to 3.12.
- GitHub workflows and jobs.
- File reorganization to accommodate v3 parser: v10, v1x, and v3x folders. tests folder is now called test.

### Removed

- Git submodules.
- GitHub Conda job.
- CMake folder.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions conan/profiles/tests-debug-clang-linux-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include(tests-debug)

[settings]
compiler=clang
compiler.version=14

[conf]
tools.build:cxxflags=["-stdlib=libc++"]
tools.build:compiler_executables={ 'c' : 'clang', 'cpp' : 'clang++' }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions conan/profiles/tests-release-clang-linux-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include(tests-release)

[settings]
compiler=clang
compiler.version=14

[conf]
tools.build:cxxflags=["-stdlib=libc++"]
tools.build:compiler_executables={ 'c' : 'clang', 'cpp' : 'clang++' }
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion include/version.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once

#define LIBQASM_VERSION "0.4.1"
#define LIBQASM_VERSION "0.5.0"
#define LIBQASM_RELEASE_YEAR "2023"
8 changes: 3 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Packages
#-------------------------------------------------------------------------------

include(FetchContent)

find_package(antlr4-runtime)
find_package(BISON 3.0)
find_package(FLEX 2.6.4)
Expand All @@ -36,11 +38,8 @@ if(WIN32)
else()
set(flex_win_compat)
endif()
find_package(fmt 10.1.1)
find_package(Python3 REQUIRED)

include(FetchContent)

# fmt
set(fmt_VERSION_REQUIRED 10.1.1)
find_package(fmt ${fmt_VERSION_REQUIRED})
Expand Down Expand Up @@ -321,8 +320,7 @@ else()
message(SEND_ERROR "Unknown compiler!")
endif()

# Main cQASM library in shared or static form as managed by cmake's
# internal BUILD_SHARED_LIBS variable.
# Main cQASM library in shared or static form as managed by CMake's internal BUILD_SHARED_LIBS variable.
add_library(cqasm
$<TARGET_OBJECTS:cqasm-lib-obj>
)
Expand Down

0 comments on commit 077ab84

Please sign in to comment.