[llvm-dev] Attempt to build MLIR.

255 views
Skip to first unread message

Sourabh Singh Tomar via llvm-dev

unread,
Dec 24, 2019, 4:37:21 AM12/24/19
to ami...@google.com, llvm...@lists.llvm.org
Hello everyone,

Since MLIR landed today. I'm trying to build it using
cmake ../llvm/ -DCMAKE_BUILD_TYPE=RELEASE -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ALL_PROJECTS="clang;lld;lldb;mlir" -DBUILD_SHARED_LIBS=ON -DCLANG_DEFAULT_LINKER:STRING=lld

and also by adding -DLLVM_ALL_PROJECTS.

It's giving this compilation error --

Building CXX object tools/mlir/lib/Analysis/CMakeFiles/obj.MLIRAnalysis.dir/AffineAnalysis.cpp.o
In file included from /home/sourabh/mirror-upstream/mlir/include/mlir/Dialect/AffineOps/AffineOps.h:22:0,
                 from /home/sourabh/mirror-upstream/mlir/lib/Analysis/AffineAnalysis.cpp:17:
/home/sourabh/mirror-upstream/mlir/include/mlir/Transforms/LoopLikeInterface.h:22:10: fatal error: mlir/Transforms/LoopLikeInterface.h.inc: No such file or directory
 #include "mlir/Transforms/LoopLikeInterface.h.inc"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Am I missing something? -- some pre-requisites ?

Thanks in anticipation!
Sourabh.
compilation terminated.

Mehdi Amini via llvm-dev

unread,
Dec 24, 2019, 12:13:15 PM12/24/19
to Sourabh Singh Tomar, llvm-dev
Hi Sourabh,

This usually indicates a missing dependency in our CMakeLists.txt, if you restart the build a couple of times it will likely succeed.

I will try to fix this missing dependency today.

-- 
Mehdi

Stephen Neuendorffer via llvm-dev

unread,
Jan 13, 2020, 1:17:48 AM1/13/20
to Mehdi Amini, llvm-dev, Sourabh Singh Tomar
These errors seem pretty pervasive for me on a clean build.  It appears that it arises because when tablegen'd headers are included in a .h file, every place where that .h file is used needs a dependency on the corresponding IncGen targets.  This seems broken in the short term and unmaintainable in the long term.  There really needs to be a way of automatically generating the right dependencies.

Steve


_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Sourabh Singh Tomar via llvm-dev

unread,
Jan 13, 2020, 4:56:19 AM1/13/20
to Stephen Neuendorffer, llvm-dev, Mehdi Amini
Not sure, tried couple of times. Seems like while building with "-DBUILD_SHARED_LIBS=ON" causes all these problems.
However, building MLIR with this FLAG disabled -- building fine.

--Sourabh.

Johan Engelen via llvm-dev

unread,
Mar 22, 2020, 6:53:48 PM3/22/20
to Sourabh Singh Tomar, llvm-dev, Mehdi Amini
Hello all,
  FWIW, I am still hitting this [*] build error on release branch 10.x (llvmorg-10.0.0-rc5) when building with:
`cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;lld;polly;mlir" -DCMAKE_INSTALL_PREFIX="/Users/johan/llvm/llvmtrunkinstall" -DLLVM_TARGETS_TO_BUILD="AArch64;ARM;Mips;MSP430;NVPTX;PowerPC;X86" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="RISCV;WebAssembly" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_APPEND_VC_REV=ON -DLLVM_INSTALL_UTILS=ON ../../llvm` .
Note that I am building with Ninja, perhaps that's the reason?

Cheers,
  Johan

[*] /Users/johan/llvm/llvm/mlir/include/mlir/Transforms/LoopLikeInterface.h:22:10: fatal error: 'mlir/Transforms/LoopLikeInterface.h.inc' file not found
#include "mlir/Transforms/LoopLikeInterface.h.inc"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Stephen Neuendorffer via llvm-dev

unread,
Mar 22, 2020, 7:18:35 PM3/22/20
to Johan Engelen, llvm-dev, Mehdi Amini, Sourabh Singh Tomar
Hi Johan,

I suspect that you're running into some missing dependencies and that running ninja -k 0; ninja -k 0 will get you a working build.  Alternatively, you might have better luck using HEAD, as I think we've worked out most of these dependency issues there.

Steve


Reply all
Reply to author
Forward
0 new messages