Skip to content

[DRAFT] MQT Integration #1709

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
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
36 changes: 18 additions & 18 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif()
#########################

find_package(MLIR REQUIRED CONFIG)
find_package(MHLO REQUIRED CONFIG)
#find_package(MHLO REQUIRED CONFIG)

message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
Expand All @@ -41,19 +41,19 @@ set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})

# Taken from mlir-hlo/mhlo/transforms/CMakeLists.txt.
# Unfortunately, AllMhloPasses doesn't appear to be exported.
set(ALL_MHLO_PASSES
ChloPasses
MhloPasses
StablehloPasses
MhloToArithmeticConversion
MhloToMemrefConversion
MhloToStandard
HloToLinalgUtils
MhloToLinalg
MhloToStablehlo
MhloQuantToIntConversion
StablehloToMhlo
)
#set(ALL_MHLO_PASSES
# ChloPasses
# MhloPasses
# StablehloPasses
# MhloToArithmeticConversion
# MhloToMemrefConversion
# MhloToStandard
# HloToLinalgUtils
# MhloToLinalg
# MhloToStablehlo
# MhloQuantToIntConversion
# StablehloToMhlo
#)

list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
Expand Down Expand Up @@ -87,8 +87,8 @@ if(QUANTUM_ENABLE_BINDINGS_PYTHON)
mlir_configure_python_dev_packages()
endif()

list(GET MHLO_INCLUDE_DIRS 1 MLIRHLO_DIR)
list(GET MHLO_INCLUDE_DIRS 2 MLIRHLO_BUILD_DIR)
#list(GET MHLO_INCLUDE_DIRS 1 MLIRHLO_DIR)
#list(GET MHLO_INCLUDE_DIRS 2 MLIRHLO_BUILD_DIR)

set(CATALYST_MAIN_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
set(CATALYST_GEN_INCLUDE_DIR ${PROJECT_BINARY_DIR}/include)
Expand All @@ -115,7 +115,7 @@ include_directories(

add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(tools)
#add_subdirectory(tools)

if(QUANTUM_ENABLE_BINDINGS_PYTHON)
message(STATUS "Enabling Python API")
Expand Down Expand Up @@ -193,4 +193,4 @@ endif()
# End of CIRCT code #
######################

add_subdirectory(test)
#add_subdirectory(test)
9 changes: 8 additions & 1 deletion mlir/cmake/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS)
# libstim is Apache version 2.0
# QECUtils needs to be added manually since it is not in MLIR_EXPORTS
# TODO: Can we avoid adding these other export targets?
export(TARGETS ${MLIR_EXPORTS} QECUtils libstim nlohmann_json tomlplusplus_tomlplusplus FILE ${catalyst_cmake_builddir}/CatalystTargets.cmake)

# Filter out unwanted targets from MLIR_EXPORTS
get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS)
list(REMOVE_ITEM MLIR_EXPORTS qec-transforms ion-transforms CatalystCompilerDriver QuantumCAPI)

export(TARGETS ${MLIR_EXPORTS}
#QECUtils libstim nlohmann_json tomlplusplus_tomlplusplus
FILE ${catalyst_cmake_builddir}/CatalystTargets.cmake)

# Generate MlirConfig.cmake for the build tree.
set(CATALYST_CONFIG_CMAKE_DIR "${catalyst_cmake_builddir}")
Expand Down
18 changes: 9 additions & 9 deletions mlir/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
add_subdirectory(Driver)
add_subdirectory(CAPI)
add_subdirectory(Catalyst)
#add_subdirectory(Driver)
#add_subdirectory(CAPI)
#add_subdirectory(Catalyst)
add_subdirectory(Quantum)
add_subdirectory(QEC)
add_subdirectory(Gradient)
add_subdirectory(Ion)
add_subdirectory(MBQC)
add_subdirectory(Mitigation)
add_subdirectory(Test)
#add_subdirectory(QEC)
#add_subdirectory(Gradient)
#add_subdirectory(Ion)
#add_subdirectory(MBQC)
#add_subdirectory(Mitigation)
#add_subdirectory(Test)