Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown CMake command "tablegen"

Tags:

llvm

cmake

I'm trying to compile MLIR with the command:

cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS=“mlir” ../mlir

Then came the CMake Error:

...

CMake Error at CMakeLists.txt:10 (tablegen):
  Unknown CMake command "tablegen".
Call Stack (most recent call first):
  include/mlir/Analysis/CMakeLists.txt:2 (mlir_tablegen)

...

I can't figure out what went wrong, how can I fix it?

like image 577
zhanghb97 Avatar asked Jan 17 '26 11:01

zhanghb97


1 Answers

Whichever llvm project you want to build, you still need to run cmake for the source directory corresponding to top-level llvm directory, not for its subdirectory.

Top-level directory is where you clone the project https://github.com/llvm/llvm-project.

like image 129
Tsyvarev Avatar answered Jan 21 '26 08:01

Tsyvarev