Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
build-sdist:
name: 🐍 Packaging
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@setup-mlir # v1.17.4

# Builds wheels on all supported platforms using cibuildwheel.
# The wheels are uploaded as GitHub artifacts `dev-cibw-*` or `cibw-*`, depending on whether
Expand All @@ -31,9 +31,11 @@ jobs:
windows-2022,
windows-11-arm,
]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
setup-mlir: true
llvm-version: 21.1.7

# Downloads the previously generated artifacts and deploys to PyPI on published releases.
deploy:
Expand Down
55 changes: 40 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
change-detection:
name: 🔍 Change
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@setup-mlir # v1.17.4

cpp-tests-ubuntu:
name: 🇨‌ Test 🐧
Expand All @@ -30,11 +30,13 @@ jobs:
- runs-on: ubuntu-24.04
compiler: gcc
config: Debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 21.1.7

cpp-tests-macos:
name: 🇨‌ Test 🍎
Expand All @@ -50,12 +52,14 @@ jobs:
- runs-on: macos-14
compiler: clang
config: Debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
cmake-args: -DMQT_CORE_WITH_GMP=ON
setup-mlir: true
llvm-version: 21.1.7

cpp-tests-windows:
name: 🇨‌ Test 🏁
Expand All @@ -71,11 +75,13 @@ jobs:
- runs-on: windows-2022
compiler: msvc
config: Debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 21.1.7

# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
cpp-tests-extensive-ubuntu:
Expand All @@ -88,11 +94,13 @@ jobs:
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]
compiler: [gcc, clang, clang-20, clang-21]
config: [Release, Debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 21.1.7

# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
cpp-tests-extensive-macos:
Expand All @@ -105,12 +113,14 @@ jobs:
runs-on: [macos-14, macos-15, macos-15-intel]
compiler: [clang, clang-20, clang-21, gcc-14, gcc-15]
config: [Release, Debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
cmake-args: -DMQT_CORE_WITH_GMP=ON
setup-mlir: true
llvm-version: 21.1.7

# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
cpp-tests-extensive-windows:
Expand All @@ -123,17 +133,22 @@ jobs:
runs-on: [windows-2022, windows-2025, windows-11-arm]
compiler: [msvc, clang]
config: [Release]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 21.1.7

cpp-coverage:
name: 🇨‌ Coverage
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@setup-mlir # v1.17.4
with:
setup-mlir: true
llvm-version: 21.1.7
permissions:
contents: read
id-token: write
Expand All @@ -142,7 +157,7 @@ jobs:
name: 🇨‌ Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@setup-mlir # v1.17.4
with:
cmake-args: -DBUILD_MQT_CORE_BENCHMARKS=ON -DBUILD_MQT_CORE_MLIR=ON -DBUILD_MQT_CORE_BINDINGS=ON
clang-version: 21
Expand All @@ -151,6 +166,8 @@ jobs:
setup-python: true
install-pkgs: "pybind11==3.0.1"
cpp-linter-extra-args: "-std=c++20"
setup-mlir: true
llvm-version: 21.1.7

python-tests:
name: 🐍 Test
Expand All @@ -167,15 +184,17 @@ jobs:
macos-14,
windows-2022,
]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
setup-mlir: true
llvm-version: 21.1.7

python-coverage:
name: 🐍 Coverage
needs: [change-detection, python-tests]
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@setup-mlir # v1.17.4
permissions:
contents: read
id-token: write
Expand All @@ -189,23 +208,27 @@ jobs:
fail-fast: false
matrix:
runs-on: [macos-15, windows-2025]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
setup-mlir: true
llvm-version: 21.1.7

python-linter:
name: 🐍 Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@setup-mlir # v1.17.4
with:
enable-ty: true
setup-mlir: true
llvm-version: 21.1.7

build-sdist:
name: 🚀 CD
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cd)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@setup-mlir # v1.17.4

build-wheel:
name: 🚀 CD
Expand All @@ -223,9 +246,11 @@ jobs:
windows-2022,
windows-11-arm,
]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
setup-mlir: true
llvm-version: 21.1.7

mlir-tests:
name: 🐉 Test
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ jobs:
fail-fast: false
matrix:
runs-on: [ubuntu-24.04, macos-14, windows-2022]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@setup-mlir # v1.17.4
with:
runs-on: ${{ matrix.runs-on }}
setup-z3: true
setup-mlir: true
llvm-version: 21.1.7

create-issue-on-failure:
name: Create issue on failure
needs: qiskit-upstream-tests
if: ${{ always() }}
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@89734354f64f30a80dd16602d4e271df34348987 # v1.17.4
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@setup-mlir # v1.17.4
with:
tests-result: ${{ needs.qiskit-upstream-tests.result }}
permissions:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ endif()

set(MQT_CORE_TARGET_NAME "mqt-core")

option(BUILD_MQT_CORE_MLIR "Build the MLIR submodule of the MQT Core project" OFF)
option(BUILD_MQT_CORE_MLIR "Build the MLIR submodule of the MQT Core project" ON)
if(BUILD_MQT_CORE_MLIR)
include(SetupMLIR)
endif()
Expand Down
3 changes: 3 additions & 0 deletions cmake/AddMQTCoreLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ function(add_mqt_core_library name)
PROPERTIES VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
EXPORT_NAME Core${ARG_ALIAS_NAME})

# Make version available
target_compile_definitions(${name} PRIVATE MQT_CORE_VERSION="${MQT_CORE_VERSION}")
endfunction()
9 changes: 9 additions & 0 deletions cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,21 @@ set(SPDLOG_SYSTEM_INCLUDES
ON
CACHE INTERNAL "Treat the library headers like system headers")
cmake_dependent_option(SPDLOG_INSTALL "Install spdlog library" ON "MQT_CORE_INSTALL" OFF)
cmake_dependent_option(SPDLOG_BUILD_SHARED "Build spdlog as shared library" ON
"BUILD_MQT_CORE_SHARED_LIBS" OFF)
FetchContent_Declare(spdlog URL ${SPDLOG_URL} FIND_PACKAGE_ARGS ${SPDLOG_VERSION})
list(APPEND FETCH_PACKAGES spdlog)

# Make all declared dependencies available.
FetchContent_MakeAvailable(${FETCH_PACKAGES})

# Ensure external shared libraries end up in a common lib layout used by our RUNPATH
if(TARGET spdlog)
set_target_properties(
spdlog PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
endif()

# Patch for spdlog cmake files to be installed in a common cmake directory
if(SPDLOG_INSTALL)
include(GNUInstallDirs)
Expand Down
7 changes: 7 additions & 0 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ if(ENABLE_COVERAGE)
add_link_options(--coverage)
endif()

# Conditionally set SHARED keyword for shared library builds
if(BUILD_MQT_CORE_SHARED_LIBS)
set(MQT_CORE_MLIR_LIBRARY_TYPE SHARED)
else()
set(MQT_CORE_MLIR_LIBRARY_TYPE)
endif()

# add main library code
add_subdirectory(include)
add_subdirectory(lib)
Expand Down
13 changes: 12 additions & 1 deletion mlir/lib/Conversion/MQTOptToMQTRef/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@

file(GLOB CONVERSION_SOURCES *.cpp)

add_mlir_library(MQTOptToMQTRef ${CONVERSION_SOURCES} DEPENDS MQTOptToMQTRefIncGen)
add_mlir_library(
MQTOptToMQTRef
${CONVERSION_SOURCES}
DEPENDS
MQTOptToMQTRefIncGen
LINK_LIBS
MLIRMQTOpt
MLIRMQTRef
MLIRMemRefDialect
MLIRTransforms
MLIRFuncDialect
MLIRFuncTransforms)
13 changes: 12 additions & 1 deletion mlir/lib/Conversion/MQTRefToMQTOpt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@

file(GLOB CONVERSION_SOURCES *.cpp)

add_mlir_library(MQTRefToMQTOpt ${CONVERSION_SOURCES} DEPENDS MQTRefToMQTOptIncGen)
add_mlir_library(
MQTRefToMQTOpt
${CONVERSION_SOURCES}
DEPENDS
MQTRefToMQTOptIncGen
LINK_LIBS
MLIRMQTOpt
MLIRMQTRef
MLIRMemRefDialect
MLIRTransforms
MLIRFuncDialect
MLIRFuncTransforms)
13 changes: 12 additions & 1 deletion mlir/lib/Conversion/MQTRefToQIR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@

file(GLOB CONVERSION_SOURCES *.cpp)

add_mlir_library(MQTRefToQIR ${CONVERSION_SOURCES} DEPENDS MQTRefToQIRIncGen)
add_mlir_library(
MQTRefToQIR
${CONVERSION_SOURCES}
DEPENDS
MQTRefToQIRIncGen
LINK_LIBS
MLIRMQTRef
MLIRMemRefDialect
MLIRTransforms
MLIRLLVMDialect
MLIRFuncToLLVM
MLIRReconcileUnrealizedCasts)
11 changes: 10 additions & 1 deletion mlir/lib/Conversion/QIRToMQTRef/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@

file(GLOB CONVERSION_SOURCES *.cpp)

add_mlir_library(QIRToMQTRef ${CONVERSION_SOURCES} DEPENDS QIRToMQTRefIncGen)
add_mlir_library(
QIRToMQTRef
${CONVERSION_SOURCES}
DEPENDS
QIRToMQTRefIncGen
LINK_LIBS
MLIRMQTRef
MLIRMemRefDialect
MLIRTransforms
MLIRLLVMDialect)
12 changes: 10 additions & 2 deletions mlir/lib/Dialect/MQTOpt/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
#
# Licensed under the MIT License

add_mlir_dialect_library(MLIRMQTOpt MQTOptOps.cpp DEPENDS MLIRMQTOptOpsIncGen
MLIRMQTOptInterfacesIncGen)
add_mlir_dialect_library(
MLIRMQTOpt
${MQT_CORE_MLIR_LIBRARY_TYPE}
MQTOptOps.cpp
DEPENDS
MLIRMQTOptOpsIncGen
MLIRMQTOptInterfacesIncGen
LINK_LIBS
MLIRIR
MLIRInferTypeOpInterface)
# collect header files
file(GLOB_RECURSE IR_HEADERS_SOURCE "${MQT_MLIR_SOURCE_INCLUDE_DIR}/mlir/Dialect/MQTOpt/IR/*.h")
file(GLOB_RECURSE IR_HEADERS_BUILD "${MQT_MLIR_BUILD_INCLUDE_DIR}/mlir/Dialect/MQTOpt/IR/*.inc")
Expand Down
12 changes: 10 additions & 2 deletions mlir/lib/Dialect/MQTRef/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
#
# Licensed under the MIT License

add_mlir_dialect_library(MLIRMQTRef MQTRefOps.cpp DEPENDS MLIRMQTRefOpsIncGen
MLIRMQTRefInterfacesIncGen)
add_mlir_dialect_library(
MLIRMQTRef
${MQT_CORE_MLIR_LIBRARY_TYPE}
MQTRefOps.cpp
DEPENDS
MLIRMQTRefOpsIncGen
MLIRMQTRefInterfacesIncGen
LINK_LIBS
MLIRIR
MLIRInferTypeOpInterface)

# collect header files
file(GLOB_RECURSE IR_HEADERS_SOURCE "${MQT_MLIR_SOURCE_INCLUDE_DIR}/mlir/Dialect/MQTRef/IR/*.h")
Expand Down
Loading
Loading