Hi everyone,
I’m trying to build LLVM + MLIR from source on a Linux EC2 instance - everything builds with no errors, and all of the example binaries (toy, etc.) work fine.
I used the following commands to build MLIR:
> git clone --depth 1 https://github.com/llvm/llvm-project.git
> cd llvm-project
> mkdir build
> cd build
> cmake -G "Unix Makefiles" ../llvm -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_BUILD_EXAMPLES=ON -DLLVM_TARGETS_TO_BUILD="Native" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON
> make -j8
I am currently working on creating a new dialect and a few simple passes for the dialect following the tutorial at MLIR — Defining a New Dialect || Math ∩ Programming, with some slight modifications (mostly just name changes), and am not using bazel.
When I try to create a binary like mlir-opt to test out my passes, I encounter the following error:
> [ec2-user@ip-172-31-65-76 ensemble-compilation]$ g++ ./ensemble-compilation/qe_opt.cpp -o qeOpt -I llvm-project/mlir/include -I ensemble_compilation/
> In file included from llvm-project/mlir/include/mlir/IR/UseDefLists.h:16,
> from llvm-project/mlir/include/mlir/IR/Value.h:17,
> from llvm-project/mlir/include/mlir/IR/AffineMap.h:18,
> from llvm-project/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h:12,
> from llvm-project/mlir/include/mlir/IR/BuiltinTypes.h:12,
> from llvm-project/mlir/include/mlir/IR/OpImplementation.h:16,
> from llvm-project/mlir/include/mlir/IR/DialectImplementation.h:17,
> from ./ensemble-compilation/lib/Dialect/QuantumEnsemble/QuantumEnsembleDialect.h:6,
> from ./ensemble-compilation/qe_opt.cpp:1:
> llvm-project/mlir/include/mlir/IR/Location.h:137:10: fatal error: mlir/IR/BuiltinLocationAttributes.h.inc: No such file or directory
> 137 | #include "mlir/IR/BuiltinLocationAttributes.h.inc"
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> compilation terminated.
After looking through the llvm/mlir/include folder, I found that none of the .h.inc files were generated from the .td files - for example, see the screenshot below, which lists some the files in my llvm/mlir/include/mlir/IR folder. There are some .td files, but none of the associated .h.inc or .cpp.inc files are present.
Could anyone please let me know what I need to change in my setup to fix this?
Thank you in advance, and I apologize if this is a particularly egregious oversight on my part.

