Skip to content

cmake fails to build AIE target with enums not able to be generated #2780

@ai-mannamalai

Description

@ai-mannamalai
  1. cmake fails to build AIE target with enums not able to be generated;
    I had to make the following change; sorry seems like ordering was an issue.
  2. turning off python binding was not building cmake correctly.

Change item 2

commented out here but should be if(NOT ${AI_ENABLE_BINDINGS_PYTHON}) else macro in CMake.

 # Last because each of these has its own CMakeLists.txt which reloads/re-finds LLVM, thus resettings globals.
-add_subdirectory(programming_examples)
-add_subdirectory(programming_guide)
-add_subdirectory(test)
-add_subdirectory(mlir_exercises)
+#add_subdirectory(programming_examples)
+#add_subdirectory(programming_guide)
+#add_subdirectory(test)
+#add_subdirectory(mlir_exercises)
 add_subdirectory(cmake/modules)

Change item 1

diff --git a/include/aie/Dialect/AIE/IR/CMakeLists.txt b/include/aie/Dialect/AIE/IR/CMakeLists.txt
index 75d578d..0c43298 100644
--- a/include/aie/Dialect/AIE/IR/CMakeLists.txt
+++ b/include/aie/Dialect/AIE/IR/CMakeLists.txt
@@ -9,6 +9,13 @@
 # https://xilinx.github.io/mlir-aie/AIEDialect.html
 add_mlir_doc(AIEDocs AIEDialect ./ -gen-dialect-doc -dialect=aie)
 
+# Add AIE enums
+set(LLVM_TARGET_DEFINITIONS AIEAttrs.td)
+mlir_tablegen(AIEEnums.h.inc -gen-enum-decls)
+mlir_tablegen(AIEEnums.cpp.inc -gen-enum-defs)
+add_public_tablegen_target(MLIRAIEEnumsIncGen)
+add_dependencies(aie-headers MLIRAIEEnumsIncGen)
+
 # Add AIE dialect
 set(LLVM_TARGET_DEFINITIONS AIE.td)
 mlir_tablegen(AIEDialect.h.inc -gen-dialect-decls -dialect=aie)
@@ -37,13 +44,6 @@ mlir_tablegen(AIEOps.cpp.inc -gen-op-defs)
 add_public_tablegen_target(MLIRAIEOpsIncGen)
 add_dependencies(aie-headers MLIRAIEOpsIncGen)
 
-# Add AIE enums
-set(LLVM_TARGET_DEFINITIONS AIEAttrs.td)
-mlir_tablegen(AIEEnums.h.inc -gen-enum-decls)
-mlir_tablegen(AIEEnums.cpp.inc -gen-enum-defs)
-add_public_tablegen_target(MLIRAIEEnumsIncGen)
-add_dependencies(aie-headers MLIRAIEEnumsIncGen)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions