From a57c800d35943276e28241bfe258901748d1bc9f Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Thu, 4 Dec 2025 01:29:39 +0100 Subject: [PATCH 01/17] Test development version of workflows --- .github/workflows/cd.yml | 6 ++-- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++---------- .github/workflows/upstream.yml | 4 +-- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f14896b765..540a85bb44 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -12,7 +12,7 @@ permissions: jobs: build-sdist: name: 🐍 Packaging - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@setup-mlir # v1.17.3 # Builds wheels on all supported platforms using cibuildwheel. # The wheels are uploaded as GitHub artifacts `dev-cibw-*` or `cibw-*`, depending on whether @@ -31,9 +31,11 @@ jobs: windows-2022, windows-11-arm, ] - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 # Downloads the previously generated artifacts and deploys to PyPI on published releases. deploy: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab5a9142a6..dc8517824a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ concurrency: jobs: change-detection: name: 🔍 Change - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@setup-mlir # v1.17.3 cpp-tests-ubuntu: name: 🇨‌ Test 🐧 @@ -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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 cpp-tests-macos: name: 🇨‌ Test 🍎 @@ -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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} cmake-args: -DMQT_CORE_WITH_GMP=ON + setup-mlir: true + setup-mlir-tag: 2025.11.25 cpp-tests-windows: name: 🇨‌ Test 🏁 @@ -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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 # run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label cpp-tests-extensive-ubuntu: @@ -95,11 +101,13 @@ jobs: compiler: clang - runs-on: ubuntu-22.04-arm compiler: clang - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 # run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label cpp-tests-extensive-macos: @@ -118,12 +126,14 @@ jobs: compiler: gcc-14 - runs-on: macos-15 compiler: gcc-15 - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} cmake-args: -DMQT_CORE_WITH_GMP=ON + setup-mlir: true + setup-mlir-tag: 2025.11.25 # run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label cpp-tests-extensive-windows: @@ -136,17 +146,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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@setup-mlir # v1.17.3 + with: + setup-mlir: true + setup-mlir-tag: 2025.11.25 permissions: contents: read id-token: write @@ -155,7 +170,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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@setup-mlir # v1.17.3 with: cmake-args: -DBUILD_MQT_CORE_BENCHMARKS=ON -DBUILD_MQT_CORE_MLIR=ON -DBUILD_MQT_CORE_BINDINGS=ON clang-version: 21 @@ -164,6 +179,8 @@ jobs: setup-python: true install-pkgs: "pybind11==3.0.1" cpp-linter-extra-args: "-std=c++20" + setup-mlir: true + setup-mlir-tag: 2025.11.25 python-tests: name: 🐍 Test @@ -180,15 +197,17 @@ jobs: macos-14, windows-2022, ] - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@setup-mlir # v1.17.3 permissions: contents: read id-token: write @@ -202,23 +221,27 @@ jobs: fail-fast: false matrix: runs-on: [ubuntu-22.04, ubuntu-22.04-arm, macos-15, windows-2025] - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@setup-mlir # v1.17.3 with: enable-ty: true + setup-mlir: true + setup-mlir-tag: 2025.11.25 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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@setup-mlir # v1.17.3 build-wheel: name: 🚀 CD @@ -236,9 +259,11 @@ jobs: windows-2022, windows-11-arm, ] - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} + setup-mlir: true + setup-mlir-tag: 2025.11.25 mlir-tests: name: 🐉 Test diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 55ead7eece..87e8acd163 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -19,7 +19,7 @@ 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@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} setup-z3: true @@ -28,7 +28,7 @@ jobs: name: Create issue on failure needs: qiskit-upstream-tests if: ${{ always() }} - uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3 + uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@setup-mlir # v1.17.3 with: tests-result: ${{ needs.qiskit-upstream-tests.result }} permissions: From 934918be010e8af8e07df0d721b1581d78e4d0ec Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Thu, 4 Dec 2025 01:36:13 +0100 Subject: [PATCH 02/17] Set up MLIR also in Qiskit upstream tests --- .github/workflows/upstream.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 87e8acd163..d5907dbad6 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -22,7 +22,8 @@ jobs: uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} - setup-z3: true + setup-mlir: true + setup-mlir-tag: 2025.11.25 create-issue-on-failure: name: Create issue on failure From fe58dc02ae12232399832176f9d317fa94b34c90 Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:32:41 +0100 Subject: [PATCH 03/17] Enable MLIR build by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cd8e95518..9193c42de4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() From fe909c9aa863b1f1d3fbc4049bbd5e9142ada5a4 Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:40:04 +0100 Subject: [PATCH 04/17] Disable QIR runner to see if the problem is there --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9193c42de4..96e51e1176 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,8 +96,7 @@ option(BUILD_MQT_CORE_MLIR "Build the MLIR submodule of the MQT Core project" ON if(BUILD_MQT_CORE_MLIR) include(SetupMLIR) endif() -cmake_dependent_option(BUILD_MQT_CORE_QIR_RUNNER "Build the QIR runner of the MQT Core project" ON - "BUILD_MQT_CORE_MLIR" OFF) +option(BUILD_MQT_CORE_QIR_RUNNER "Build the QIR runner of the MQT Core project" OFF) # add main library code add_subdirectory(src) From b89e020c00aa0ab73ccb235e2a8404337ee923d3 Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:19:29 +0100 Subject: [PATCH 05/17] Remove ubuntu-22.04 runners from extensive matrices --- .github/workflows/ci.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc8517824a..343c010e19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,15 +92,9 @@ jobs: fail-fast: false matrix: runs-on: - [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm] + [ubuntu-24.04, ubuntu-24.04-arm] compiler: [gcc, clang, clang-19, clang-20] config: [Release, Debug] - exclude: - # both combinations do not support C++20 due to the compiler being too old - - runs-on: ubuntu-22.04 - compiler: clang - - runs-on: ubuntu-22.04-arm - compiler: clang uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} @@ -220,7 +214,7 @@ jobs: strategy: fail-fast: false matrix: - runs-on: [ubuntu-22.04, ubuntu-22.04-arm, macos-15, windows-2025] + runs-on: [macos-15, windows-2025] uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} From d28d92f307c429462e22a51256748ddb43a0d8c7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:19:58 +0000 Subject: [PATCH 06/17] =?UTF-8?q?=F0=9F=8E=A8=20pre-commit=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 343c010e19..c4275fd5f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,8 +91,7 @@ jobs: strategy: fail-fast: false matrix: - runs-on: - [ubuntu-24.04, ubuntu-24.04-arm] + runs-on: [ubuntu-24.04, ubuntu-24.04-arm] compiler: [gcc, clang, clang-19, clang-20] config: [Release, Debug] uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@setup-mlir # v1.17.3 From 146f063539dd6c22b968773ce3b8d879741006bd Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 00:52:15 +0100 Subject: [PATCH 07/17] =?UTF-8?q?=F0=9F=90=9B=20fix=20empty=20link=20libs?= =?UTF-8?q?=20for=20QIR=20Runner=20target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- src/qir/runner/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qir/runner/CMakeLists.txt b/src/qir/runner/CMakeLists.txt index 3134001ca8..bc2155e40e 100644 --- a/src/qir/runner/CMakeLists.txt +++ b/src/qir/runner/CMakeLists.txt @@ -15,8 +15,13 @@ if(NOT TARGET ${TARGET_NAME}) add_llvm_tool(${TARGET_NAME} Runner.cpp DEPENDS intrinsics_gen) export_executable_symbols(${TARGET_NAME}) endif() + + # Get the native target libraries + llvm_map_components_to_libnames(llvm_native_libs native) + # Add link libraries - target_link_libraries(${TARGET_NAME} PRIVATE MQT::CoreQIRRuntime ${llvm_libs}) + target_link_libraries(${TARGET_NAME} PRIVATE MQT::CoreQIRRuntime LLVMOrcDebugging + ${llvm_native_libs}) # Set versioning information set_target_properties(${TARGET_NAME} PROPERTIES VERSION ${PROJECT_VERSION} EXPORT_NAME From 7e362ec5250b70fd6ce31db60d332f65202182b8 Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 00:52:36 +0100 Subject: [PATCH 08/17] =?UTF-8?q?=E2=8F=AA=20revert=20to=20cmake=20depende?= =?UTF-8?q?nt=20option=20for=20QIR=20runner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96e51e1176..9193c42de4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,7 +96,8 @@ option(BUILD_MQT_CORE_MLIR "Build the MLIR submodule of the MQT Core project" ON if(BUILD_MQT_CORE_MLIR) include(SetupMLIR) endif() -option(BUILD_MQT_CORE_QIR_RUNNER "Build the QIR runner of the MQT Core project" OFF) +cmake_dependent_option(BUILD_MQT_CORE_QIR_RUNNER "Build the QIR runner of the MQT Core project" ON + "BUILD_MQT_CORE_MLIR" OFF) # add main library code add_subdirectory(src) From a968dbd03888c2a5447cd94025e558d2aed2fe1c Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Fri, 5 Dec 2025 01:06:04 +0100 Subject: [PATCH 09/17] Copy over changes from #1359 to see what the CI says --- .github/workflows/ci.yml | 12 +++--------- cmake/StandardProjectSettings.cmake | 12 ++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4275fd5f1..674a13a6d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,7 +92,7 @@ jobs: fail-fast: false matrix: runs-on: [ubuntu-24.04, ubuntu-24.04-arm] - compiler: [gcc, clang, clang-19, clang-20] + compiler: [gcc, clang, clang-20, clang-21] config: [Release, Debug] uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@setup-mlir # v1.17.3 with: @@ -110,15 +110,9 @@ jobs: strategy: fail-fast: false matrix: - runs-on: [macos-14, macos-15-intel, macos-15] - compiler: [clang, clang-19, clang-20, gcc-14, gcc-15] + runs-on: [macos-14, macos-15, macos-15-intel] + compiler: [clang, clang-20, clang-21, gcc-14, gcc-15] config: [Release, Debug] - exclude: - # see https://github.com/munich-quantum-toolkit/core/issues/979 - - runs-on: macos-15 - compiler: gcc-14 - - runs-on: macos-15 - compiler: gcc-15 uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@setup-mlir # v1.17.3 with: runs-on: ${{ matrix.runs-on }} diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake index 4178af7fad..ffeb8670e8 100644 --- a/cmake/StandardProjectSettings.cmake +++ b/cmake/StandardProjectSettings.cmake @@ -85,3 +85,15 @@ endif() set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON CACHE BOOL "Export all symbols on Windows") + +# on macOS with GCC, disable module scanning +# https://www.reddit.com/r/cpp_questions/comments/1kwlkom/comment/ni5angh/ +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.28") + set(CMAKE_CXX_SCAN_FOR_MODULES OFF) + else() + message(WARNING "CMake 3.28+ is required to disable C++ module scanning on macOS with GCC. " + "Current version: ${CMAKE_VERSION}. " + "Consider upgrading CMake to avoid potential build issues.") + endif() +endif() From d48c3e778966e72dd0c230fd3c23d944d2605be3 Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 09:58:33 +0100 Subject: [PATCH 10/17] =?UTF-8?q?=F0=9F=8F=81=20try=20`std::system`=20on?= =?UTF-8?q?=20Windows=20as=20well?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- test/qir/runner/test_qir_runner.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/test/qir/runner/test_qir_runner.cpp b/test/qir/runner/test_qir_runner.cpp index 7d6ebeeaeb..55828e9b18 100644 --- a/test/qir/runner/test_qir_runner.cpp +++ b/test/qir/runner/test_qir_runner.cpp @@ -13,12 +13,6 @@ #include #include -#ifdef _WIN32 -#define SYSTEM _wsystem -#else -#define SYSTEM std::system -#endif - namespace qir { class QIRRunnerTest : public testing::TestWithParam {}; @@ -38,7 +32,7 @@ TEST_P(QIRRunnerTest, QIRFile) { const auto& file = GetParam(); std::ostringstream command; command << EXECUTABLE_PATH << " " << file; - const auto result = SYSTEM(command.str().c_str()); + const auto result = std::system(command.str().c_str()); EXPECT_EQ(result, 0); } } // namespace qir From 1c0ae20e444f4e89b057f2dcf5117cbb0ce4cd42 Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 10:23:10 +0100 Subject: [PATCH 11/17] =?UTF-8?q?=F0=9F=94=A7=20working=20wheel=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3f4c255c73..d6eef07e60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,8 @@ build.targets = [ "mqt-core-fomac-bindings", "mqt-core-na-fomac", "mqt-core-na-fomac-bindings", + "quantum-opt", + "MLIRMQTRefTranslation", ] metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" From 8c8d6463087f164d15931ba080b98566d00d3767 Mon Sep 17 00:00:00 2001 From: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Date: Fri, 5 Dec 2025 18:33:32 +0100 Subject: [PATCH 12/17] Update to new Action version --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 24 ++++++++++++------------ .github/workflows/upstream.yml | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5b59d80cfe..6c256102b1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -35,7 +35,7 @@ jobs: with: runs-on: ${{ matrix.runs-on }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 # Downloads the previously generated artifacts and deploys to PyPI on published releases. deploy: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c63f1d4dc..33930d4b44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 cpp-tests-macos: name: 🇨‌ Test 🍎 @@ -59,7 +59,7 @@ jobs: config: ${{ matrix.config }} cmake-args: -DMQT_CORE_WITH_GMP=ON setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 cpp-tests-windows: name: 🇨‌ Test 🏁 @@ -81,7 +81,7 @@ jobs: compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 # run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label cpp-tests-extensive-ubuntu: @@ -100,7 +100,7 @@ jobs: compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 # run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label cpp-tests-extensive-macos: @@ -120,7 +120,7 @@ jobs: config: ${{ matrix.config }} cmake-args: -DMQT_CORE_WITH_GMP=ON setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 # run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label cpp-tests-extensive-windows: @@ -139,7 +139,7 @@ jobs: compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 cpp-coverage: name: 🇨‌ Coverage @@ -148,7 +148,7 @@ jobs: uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@setup-mlir # v1.17.4 with: setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 permissions: contents: read id-token: write @@ -167,7 +167,7 @@ jobs: install-pkgs: "pybind11==3.0.1" cpp-linter-extra-args: "-std=c++20" setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 python-tests: name: 🐍 Test @@ -188,7 +188,7 @@ jobs: with: runs-on: ${{ matrix.runs-on }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 python-coverage: name: 🐍 Coverage @@ -212,7 +212,7 @@ jobs: with: runs-on: ${{ matrix.runs-on }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 python-linter: name: 🐍 Lint @@ -222,7 +222,7 @@ jobs: with: enable-ty: true setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 build-sdist: name: 🚀 CD @@ -250,7 +250,7 @@ jobs: with: runs-on: ${{ matrix.runs-on }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 mlir-tests: name: 🐉 Test diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index aec5bdf5fc..8336fb871a 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -23,7 +23,7 @@ jobs: with: runs-on: ${{ matrix.runs-on }} setup-mlir: true - setup-mlir-tag: 2025.11.25 + llvm-version: 21.1.7 create-issue-on-failure: name: Create issue on failure From f2b516243e5bacbc39551c61de844feb25297dad Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 13:38:12 +0100 Subject: [PATCH 13/17] =?UTF-8?q?=F0=9F=94=A7=20explicitly=20set=20linker?= =?UTF-8?q?=20language=20for=20QIR=20executables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- test/qir/runtime/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/qir/runtime/CMakeLists.txt b/test/qir/runtime/CMakeLists.txt index e7726dd09e..6dd8e361ae 100644 --- a/test/qir/runtime/CMakeLists.txt +++ b/test/qir/runtime/CMakeLists.txt @@ -21,6 +21,7 @@ macro(ADD_QIR_CIRCUIT target_name circuit_path) COMMENT "Compiling ${circuit_path} to ${circuit_name}.o") add_executable(${target_name} ${circuit_name}.o) target_link_libraries(${target_name} PRIVATE MQT::CoreQIRRuntime) + set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE CXX) endif() endmacro() From bbcbaa644d759f901f0a331b39ce9bb4a9cc912c Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 13:44:42 +0100 Subject: [PATCH 14/17] =?UTF-8?q?=F0=9F=9A=B8=20expose=20MQT=5FCORE=5FVERS?= =?UTF-8?q?ION=20as=20part=20of=20the=20`add=5Fmqt=5Fcore=5Flibrary`=20mac?= =?UTF-8?q?ro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- cmake/AddMQTCoreLibrary.cmake | 3 +++ src/na/device/CMakeLists.txt | 15 ++------------- src/qdmi/dd/CMakeLists.txt | 3 +-- src/qdmi/sc/CMakeLists.txt | 15 ++------------- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/cmake/AddMQTCoreLibrary.cmake b/cmake/AddMQTCoreLibrary.cmake index 521d6bff45..ddb2fae6d7 100644 --- a/cmake/AddMQTCoreLibrary.cmake +++ b/cmake/AddMQTCoreLibrary.cmake @@ -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() diff --git a/src/na/device/CMakeLists.txt b/src/na/device/CMakeLists.txt index f6dcda1759..c1e2066d65 100644 --- a/src/na/device/CMakeLists.txt +++ b/src/na/device/CMakeLists.txt @@ -132,30 +132,19 @@ if(NOT TARGET ${TARGET_NAME}) target_link_libraries( ${TARGET_NAME} PUBLIC qdmi::qdmi - PRIVATE MQT::ProjectOptions MQT::ProjectWarnings spdlog::spdlog) + PRIVATE spdlog::spdlog) # Always compile with position independent code such that the library can be used in shared # libraries set_target_properties(${TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) - # set c++ standard - target_compile_features(${TARGET_NAME} PRIVATE cxx_std_20) - - # set versioning information - set_target_properties( - ${TARGET_NAME} - PROPERTIES VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - EXPORT_NAME CoreQDMINaDevice) - # add to list of MQT core targets set(MQT_CORE_TARGETS ${MQT_CORE_TARGETS} ${TARGET_NAME} PARENT_SCOPE) # Make QDMI and MQT Core Version available - target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}" - MQT_CORE_VERSION="${MQT_CORE_VERSION}") + target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}") # Generate additional alias for the target required for generate_device_defs_executable function # in the tests diff --git a/src/qdmi/dd/CMakeLists.txt b/src/qdmi/dd/CMakeLists.txt index 6b5c7065ac..5e6ac5c6c1 100644 --- a/src/qdmi/dd/CMakeLists.txt +++ b/src/qdmi/dd/CMakeLists.txt @@ -54,8 +54,7 @@ if(NOT TARGET ${TARGET_NAME}) PARENT_SCOPE) # Make QDMI and MQT Core Version available - target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}" - MQT_CORE_VERSION="${MQT_CORE_VERSION}") + target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}") # Generate additional alias for the target required for generate_device_defs_executable function # in the tests diff --git a/src/qdmi/sc/CMakeLists.txt b/src/qdmi/sc/CMakeLists.txt index f83c70bbac..09e76a4695 100644 --- a/src/qdmi/sc/CMakeLists.txt +++ b/src/qdmi/sc/CMakeLists.txt @@ -132,30 +132,19 @@ if(NOT TARGET ${TARGET_NAME}) target_link_libraries( ${TARGET_NAME} PUBLIC qdmi::qdmi - PRIVATE MQT::ProjectOptions MQT::ProjectWarnings spdlog::spdlog) + PRIVATE spdlog::spdlog) # Always compile with position independent code such that the library can be used in shared # libraries set_target_properties(${TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) - # set c++ standard - target_compile_features(${TARGET_NAME} PRIVATE cxx_std_20) - - # set versioning information - set_target_properties( - ${TARGET_NAME} - PROPERTIES VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - EXPORT_NAME CoreQDMIScDevice) - # add to list of MQT core targets set(MQT_CORE_TARGETS ${MQT_CORE_TARGETS} ${TARGET_NAME} PARENT_SCOPE) # Make QDMI and MQT Core Version available - target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}" - MQT_CORE_VERSION="${MQT_CORE_VERSION}") + target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}") # Generate additional alias for the target required for generate_device_defs_executable function # in the tests From 977a5080699ae545f6d93c36e83f6c8c5d565cfd Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 13:46:32 +0100 Subject: [PATCH 15/17] =?UTF-8?q?=F0=9F=94=A7=20also=20install=20the=20dyn?= =?UTF-8?q?amic=20QDMI=20devices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- pyproject.toml | 3 +++ src/na/device/CMakeLists.txt | 10 ++++++---- src/qdmi/sc/CMakeLists.txt | 8 +++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d6eef07e60..f14180d1a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,10 @@ build.targets = [ "mqt-core-ir-bindings", "mqt-core-dd-bindings", "mqt-core-qdmi-na-device", + "mqt-core-qdmi-na-device-dyn", "mqt-core-qdmi-ddsim-device", + "mqt-core-qdmi-sc-device", + "mqt-core-qdmi-sc-device-dyn", "mqt-core-fomac-bindings", "mqt-core-na-fomac", "mqt-core-na-fomac-bindings", diff --git a/src/na/device/CMakeLists.txt b/src/na/device/CMakeLists.txt index c1e2066d65..c34e2226d8 100644 --- a/src/na/device/CMakeLists.txt +++ b/src/na/device/CMakeLists.txt @@ -43,7 +43,7 @@ if(NOT TARGET ${TARGET_NAME}) target_compile_features(${TARGET_NAME} PRIVATE cxx_std_20) # add to list of MQT core targets - set(MQT_CORE_TARGETS ${MQT_CORE_TARGETS} ${TARGET_NAME}) + list(APPEND MQT_CORE_TARGETS ${TARGET_NAME}) # Make version available target_compile_definitions(${TARGET_NAME} PRIVATE MQT_CORE_VERSION="${MQT_CORE_VERSION}") @@ -139,9 +139,7 @@ if(NOT TARGET ${TARGET_NAME}) set_target_properties(${TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) # add to list of MQT core targets - set(MQT_CORE_TARGETS - ${MQT_CORE_TARGETS} ${TARGET_NAME} - PARENT_SCOPE) + list(APPEND MQT_CORE_TARGETS ${TARGET_NAME}) # Make QDMI and MQT Core Version available target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}") @@ -190,6 +188,10 @@ if(NOT TARGET ${TARGET_NAME}) SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} EXPORT_NAME CoreQDMINaDeviceDyn) add_library(MQT::CoreQDMINaDeviceDyn ALIAS ${DYN_TARGET_NAME}) + list(APPEND MQT_CORE_TARGETS ${DYN_TARGET_NAME}) endif() endif() endif() +set(MQT_CORE_TARGETS + ${MQT_CORE_TARGETS} + PARENT_SCOPE) diff --git a/src/qdmi/sc/CMakeLists.txt b/src/qdmi/sc/CMakeLists.txt index 09e76a4695..a6af9caa40 100644 --- a/src/qdmi/sc/CMakeLists.txt +++ b/src/qdmi/sc/CMakeLists.txt @@ -139,9 +139,7 @@ if(NOT TARGET ${TARGET_NAME}) set_target_properties(${TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) # add to list of MQT core targets - set(MQT_CORE_TARGETS - ${MQT_CORE_TARGETS} ${TARGET_NAME} - PARENT_SCOPE) + list(APPEND MQT_CORE_TARGETS ${TARGET_NAME}) # Make QDMI and MQT Core Version available target_compile_definitions(${TARGET_NAME} PRIVATE QDMI_VERSION="${QDMI_VERSION}") @@ -190,6 +188,10 @@ if(NOT TARGET ${TARGET_NAME}) SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} EXPORT_NAME CoreQDMIScDeviceDyn) add_library(MQT::CoreQDMIScDeviceDyn ALIAS ${DYN_TARGET_NAME}) + list(APPEND MQT_CORE_TARGETS ${DYN_TARGET_NAME}) endif() endif() endif() +set(MQT_CORE_TARGETS + ${MQT_CORE_TARGETS} + PARENT_SCOPE) From 2a264a82e3d441f580ef6c9f92ce66e8c0fc3a5e Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 16:17:09 +0100 Subject: [PATCH 16/17] =?UTF-8?q?=F0=9F=91=A8=E2=80=8D=F0=9F=92=BB?= =?UTF-8?q?=F0=9F=93=A6=20build=20QDMI=20generators=20and=20spdlog=20as=20?= =?UTF-8?q?shared=20libraries=20on=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- cmake/ExternalDependencies.cmake | 9 +++++++++ src/na/device/CMakeLists.txt | 25 +++++++------------------ src/qdmi/sc/CMakeLists.txt | 24 +++++------------------- 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/cmake/ExternalDependencies.cmake b/cmake/ExternalDependencies.cmake index d96db70872..d01766db31 100644 --- a/cmake/ExternalDependencies.cmake +++ b/cmake/ExternalDependencies.cmake @@ -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) diff --git a/src/na/device/CMakeLists.txt b/src/na/device/CMakeLists.txt index c34e2226d8..92d3c14496 100644 --- a/src/na/device/CMakeLists.txt +++ b/src/na/device/CMakeLists.txt @@ -13,11 +13,7 @@ set(TARGET_NAME ${MQT_CORE_TARGET_NAME}-qdmi-na-device-gen) if(NOT TARGET ${TARGET_NAME}) # Add library for device generation - # - # Note: We use a static library here to avoid issues with RPATH and finding the executable during - # the build process in Python builds - add_library(${TARGET_NAME} STATIC) - add_library(MQT::CoreQDMINaDeviceGen ALIAS ${TARGET_NAME}) + add_mqt_core_library(${TARGET_NAME} ALIAS_NAME QDMINaDeviceGen) # add sources to target target_sources(${TARGET_NAME} PRIVATE Generator.cpp) @@ -30,23 +26,16 @@ if(NOT TARGET ${TARGET_NAME}) target_link_libraries( ${TARGET_NAME} PUBLIC nlohmann_json::nlohmann_json - PRIVATE spdlog::spdlog MQT::ProjectOptions MQT::ProjectWarnings) - - # set versioning information - set_target_properties( - ${TARGET_NAME} - PROPERTIES VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - EXPORT_NAME CoreNaDeviceGen) - - # set c++ standard - target_compile_features(${TARGET_NAME} PRIVATE cxx_std_20) + PRIVATE spdlog::spdlog) # add to list of MQT core targets list(APPEND MQT_CORE_TARGETS ${TARGET_NAME}) - # Make version available - target_compile_definitions(${TARGET_NAME} PRIVATE MQT_CORE_VERSION="${MQT_CORE_VERSION}") + # place the generated library in a predictable location where the executable can find it + set_target_properties( + ${TARGET_NAME} + PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") endif() # Set target name diff --git a/src/qdmi/sc/CMakeLists.txt b/src/qdmi/sc/CMakeLists.txt index a6af9caa40..a1915b0d9a 100644 --- a/src/qdmi/sc/CMakeLists.txt +++ b/src/qdmi/sc/CMakeLists.txt @@ -13,11 +13,7 @@ set(TARGET_NAME ${MQT_CORE_TARGET_NAME}-qdmi-sc-device-gen) if(NOT TARGET ${TARGET_NAME}) # Add library for device generation - # - # Note: We use a static library here to avoid issues with RPATH and finding the executable during - # the build process in Python builds - add_library(${TARGET_NAME} STATIC) - add_library(MQT::CoreQDMIScDeviceGen ALIAS ${TARGET_NAME}) + add_mqt_core_library(${TARGET_NAME} ALIAS_NAME QDMIScDeviceGen) # add sources to target target_sources(${TARGET_NAME} PRIVATE Generator.cpp) @@ -30,23 +26,13 @@ if(NOT TARGET ${TARGET_NAME}) target_link_libraries( ${TARGET_NAME} PUBLIC nlohmann_json::nlohmann_json - PRIVATE spdlog::spdlog MQT::ProjectOptions MQT::ProjectWarnings) + PRIVATE spdlog::spdlog) - # set versioning information + # place the generated library in a predictable location where the executable can find it set_target_properties( ${TARGET_NAME} - PROPERTIES VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - EXPORT_NAME CoreScDeviceGen) - - # set c++ standard - target_compile_features(${TARGET_NAME} PRIVATE cxx_std_20) - - # add to list of MQT core targets - set(MQT_CORE_TARGETS ${MQT_CORE_TARGETS} ${TARGET_NAME}) - - # Make version available - target_compile_definitions(${TARGET_NAME} PRIVATE MQT_CORE_VERSION="${MQT_CORE_VERSION}") + PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") endif() # Set target name From 030c62318c1f9421b2a7c1f8a2db00497333dcc8 Mon Sep 17 00:00:00 2001 From: burgholzer Date: Fri, 5 Dec 2025 19:09:15 +0100 Subject: [PATCH 17/17] =?UTF-8?q?=F0=9F=93=A6=20allow=20building=20MLIR=20?= =?UTF-8?q?libraries=20as=20shared=20libraries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- mlir/CMakeLists.txt | 7 +++++++ mlir/lib/Conversion/MQTOptToMQTRef/CMakeLists.txt | 13 ++++++++++++- mlir/lib/Conversion/MQTRefToMQTOpt/CMakeLists.txt | 13 ++++++++++++- mlir/lib/Conversion/MQTRefToQIR/CMakeLists.txt | 13 ++++++++++++- mlir/lib/Conversion/QIRToMQTRef/CMakeLists.txt | 11 ++++++++++- mlir/lib/Dialect/MQTOpt/IR/CMakeLists.txt | 12 ++++++++++-- mlir/lib/Dialect/MQTRef/IR/CMakeLists.txt | 12 ++++++++++-- mlir/lib/Dialect/MQTRef/Translation/CMakeLists.txt | 1 + 8 files changed, 74 insertions(+), 8 deletions(-) diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt index 70879df3de..24fc8fc7fa 100644 --- a/mlir/CMakeLists.txt +++ b/mlir/CMakeLists.txt @@ -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) diff --git a/mlir/lib/Conversion/MQTOptToMQTRef/CMakeLists.txt b/mlir/lib/Conversion/MQTOptToMQTRef/CMakeLists.txt index 0b8e9cc3c3..5d936cfbab 100644 --- a/mlir/lib/Conversion/MQTOptToMQTRef/CMakeLists.txt +++ b/mlir/lib/Conversion/MQTOptToMQTRef/CMakeLists.txt @@ -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) diff --git a/mlir/lib/Conversion/MQTRefToMQTOpt/CMakeLists.txt b/mlir/lib/Conversion/MQTRefToMQTOpt/CMakeLists.txt index d08135c396..c0e4cf86e3 100644 --- a/mlir/lib/Conversion/MQTRefToMQTOpt/CMakeLists.txt +++ b/mlir/lib/Conversion/MQTRefToMQTOpt/CMakeLists.txt @@ -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) diff --git a/mlir/lib/Conversion/MQTRefToQIR/CMakeLists.txt b/mlir/lib/Conversion/MQTRefToQIR/CMakeLists.txt index 5336be4af6..f4cb895fc9 100644 --- a/mlir/lib/Conversion/MQTRefToQIR/CMakeLists.txt +++ b/mlir/lib/Conversion/MQTRefToQIR/CMakeLists.txt @@ -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) diff --git a/mlir/lib/Conversion/QIRToMQTRef/CMakeLists.txt b/mlir/lib/Conversion/QIRToMQTRef/CMakeLists.txt index 91cb08c6a6..c1e83431cf 100644 --- a/mlir/lib/Conversion/QIRToMQTRef/CMakeLists.txt +++ b/mlir/lib/Conversion/QIRToMQTRef/CMakeLists.txt @@ -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) diff --git a/mlir/lib/Dialect/MQTOpt/IR/CMakeLists.txt b/mlir/lib/Dialect/MQTOpt/IR/CMakeLists.txt index 8e962287d3..63250c798d 100644 --- a/mlir/lib/Dialect/MQTOpt/IR/CMakeLists.txt +++ b/mlir/lib/Dialect/MQTOpt/IR/CMakeLists.txt @@ -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") diff --git a/mlir/lib/Dialect/MQTRef/IR/CMakeLists.txt b/mlir/lib/Dialect/MQTRef/IR/CMakeLists.txt index 7f1b275ebc..055e8f7f3d 100644 --- a/mlir/lib/Dialect/MQTRef/IR/CMakeLists.txt +++ b/mlir/lib/Dialect/MQTRef/IR/CMakeLists.txt @@ -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") diff --git a/mlir/lib/Dialect/MQTRef/Translation/CMakeLists.txt b/mlir/lib/Dialect/MQTRef/Translation/CMakeLists.txt index c093fd04f0..1ae205a64c 100644 --- a/mlir/lib/Dialect/MQTRef/Translation/CMakeLists.txt +++ b/mlir/lib/Dialect/MQTRef/Translation/CMakeLists.txt @@ -10,6 +10,7 @@ add_compile_options(-fexceptions) add_mlir_library( MLIRMQTRefTranslation + ${MQT_CORE_MLIR_LIBRARY_TYPE} ImportQuantumComputation.cpp LINK_LIBS MLIRArithDialect