Closed bondhugula closed 5 years ago
A clean build with GCC fails early with this:
| ~~~~~~~~~^~~~~~~~~~
/home/uday/llvm-project/llvm/lib/Support/YAMLTraits.cpp:417:21: note: remove ‘std::move’ call
[122/1545] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o
/home/uday/llvm-project/llvm/lib/Support/Path.cpp: In static member function ‘static llvm::Expected<llvm::sys::fs::TempFile> llvm::sys::fs::TempFile::create(const llvm::Twine&, unsigned int)’:
/home/uday/llvm-project/llvm/lib/Support/Path.cpp:1243:19: warning: redundant move in return statement [-Wredundant-move]
1243 | return std::move(Ret);
| ~~~~~~~~~^~~~~
/home/uday/llvm-project/llvm/lib/Support/Path.cpp:1243:19: note: remove ‘std::move’ call
[128/1545] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o
/usr/lib64/ccache/cc -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support -I/home/uday/llvm-project/llvm/lib/Support -I/usr/include/libxml2 -Iinclude -I/home/uday/llvm-project/llvm/include -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -g -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o -c /home/uday/llvm-project/llvm/lib/Support/regcomp.c
In file included from /home/uday/llvm-project/llvm/lib/Support/regcomp.c:51:
/home/uday/llvm-project/llvm/include/llvm/Support/Compiler.h:152:30: error: missing ')' after "__has_attribute"
152 | #if __has_cpp_attribute(clang::reinitializes)
| ^
/home/uday/llvm-project/llvm/include/llvm/Support/Compiler.h:152:31: error: ':' without preceding '?'
152 | #if __has_cpp_attribute(clang::reinitializes)
| ^
/home/uday/llvm-project/llvm/include/llvm/Support/Compiler.h:255:30: error: missing ')' after "__has_attribute"
255 | #elif __has_cpp_attribute(gnu::fallthrough)
| ^
/home/uday/llvm-project/llvm/include/llvm/Support/Compiler.h:255:31: error: ':' without preceding '?'
255 | #elif __has_cpp_attribute(gnu::fallthrough)
| ^
/home/uday/llvm-project/llvm/include/llvm/Support/Compiler.h:267:30: error: missing ')' after "__has_attribute"
267 | #if __has_cpp_attribute(clang::require_constant_initialization)
| ^
/home/uday/llvm-project/llvm/include/llvm/Support/Compiler.h:267:31: error: ':' without preceding '?'
267 | #if __has_cpp_attribute(clang::require_constant_initialization)
| ^
[135/1545] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/JSONBackend.cpp.o
/home/uday/llvm-project/llvm/lib/TableGen/JSONBackend.cpp: In member function ‘llvm::json::Value {anonymous}::JSONEmitter::translateInit(const llvm::Init&)’:
It appears to go further with clang, but fails with the messages in the original post.
Add MLIRIR to dependencies should work
diff --git a/unittests/TableGen/CMakeLists.txt b/unittests/TableGen/CMakeLists.txt
index c7ca252a..3c58db38 100644
--- a/unittests/TableGen/CMakeLists.txt
+++ b/unittests/TableGen/CMakeLists.txt
@@ -18,4 +18,4 @@ add_dependencies(MLIRTableGenTests MLIRTableGenEnumsIncGen)
add_dependencies(MLIRTableGenTests MLIRTableGenStructAttrIncGen)
target_link_libraries(MLIRTableGenTests
- PRIVATE LLVMMLIRTableGen)
+ PRIVATE LLVMMLIRTableGen MLIRIR)
The errors with GCC were LLVM related and are gone with an update to its tip. But the MLIRContext / TableGen errors are due to a missing dep as mentioned by @freedomtan
Thanks for the repot and the fix, @bondhugula and @freedomtan! https://github.com/tensorflow/mlir/commit/3776ee295d7d1b3e848a3181e1ab8b0082edd4ec should have fixed this. :)
The current master tip fails to build with these errors: HEAD: c03072b1e5648fd21a3055a9ebd6d21fc3ed403c (cmake conf same as in README