tensorflow / mlir

"Multi-Level Intermediate Representation" Compiler Infrastructure
1.74k stars 260 forks source link

Compilation error from the "getting started" instructions? #138

Closed mvermeulen closed 5 years ago

mvermeulen commented 5 years ago

I see the following compilation error when I follow these getting started instructions on Ubuntu 16.04 modified to use "Unix Makefiles" since ninja-build wasn't new enough

git clone https://github.com/llvm/llvm-project.git
git clone https://github.com/tensorflow/mlir llvm-project/llvm/projects/mlir
mkdir llvm-project/build
cd llvm-project/build
cmake -G "Unix Makefiles" ../llvm -DLLVM_BUILD_EXAMPLES=ON -DLLVM_TARGETS_TO_BUILD="host"
cmake --build . --target check-mlir

Here is the compilation error

In file included from /media/mev/EXTRA/mlir/llvm-project/llvm/projects/mlir/lib/Analysis/LoopAnalysis.cpp:28:0:
/media/mev/EXTRA/mlir/llvm-project/llvm/projects/mlir/include/mlir/Dialect/VectorOps/VectorOps.h:207:50: fatal error: mlir/Dialect/VectorOps/VectorOps.h.inc: No such file or directory
compilation terminated.
projects/mlir/lib/Analysis/CMakeFiles/MLIRAnalysis.dir/build.make:134: recipe for target 'projects/mlir/lib/Analysis/CMakeFiles/MLIRAnalysis.dir/LoopAnalysis.cpp.o' failed
make[2]: *** [projects/mlir/lib/Analysis/CMakeFiles/MLIRAnalysis.dir/LoopAnalysis.cpp.o] Error 1
CMakeFiles/Makefile2:10953: recipe for target 'projects/mlir/lib/Analysis/CMakeFiles/MLIRAnalysis.dir/all' failed
make[1]: *** [projects/mlir/lib/Analysis/CMakeFiles/MLIRAnalysis.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

I notice there was a change 779430563412498d069e81bd7286e7e142df424c to move Linalg and VectorOps dialects to Dialect subdir.

So I tried checking out MLIR sources from the commit just before that one (f9d4405e0d28af25dfd2a3c95a9dccf0a71f8d9a) and then my build and "check-mlir" succeeds.

Is there something I am missing? @nicolasvasilache

joker-eph commented 5 years ago

I suspect there is a missing dependency which makes it pass depending on "luck" if the target is already built or not. I suspect that if you re-rerun cmake --build . --target check-mlir after the original failures it'll end-up passing.

(If you click the green check mark next to each commit you can see our CI results: https://github.com/tensorflow/mlir/commits/master )