KhronosGroup / webcl-validator

WebCL Validator
Other
38 stars 8 forks source link

Not building on Ubuntu 13.10 64 #79

Closed VincentSC closed 10 years ago

VincentSC commented 10 years ago

Trying to build it a fresh checkout, but when at 95% an error is hit. llvm (3.2), webcl-clang-dev and webcl-validator are up-to-date. What I did different was creating symbolic links to clang and webcl. What is going wrong?

[ 95%] Building CXX object tools/clang/tools/webcl-validator/lib/CMakeFiles/libclv.dir/WebCLPass.cpp.o
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp: In member function ‘virtual bool WebCLImageSamplerSafetyHandler::TypeAccessCheckerImage2d::validateParmVarAccess(const clang::ParmVarDecl&, std::string&) const’:
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:650:34: error: ‘OpenCLImageAccessAttr’ is not a member of ‘clang’
         if (!parmVarDecl.hasAttr<clang::OpenCLImageAccessAttr>()) {
                                  ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:650:34: error: ‘OpenCLImageAccessAttr’ is not a member of ‘clang’
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:650:64: error: no matching function for call to ‘clang::ParmVarDecl::hasAttr() const’
         if (!parmVarDecl.hasAttr<clang::OpenCLImageAccessAttr>()) {
                                                                ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:650:64: note: candidate is:
In file included from /home/vincent/Projects/webcl-validator/llvm/tools/clang/include/clang/AST/Decl.h:18:0,
                 from /home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLTypes.hpp:27,
                 from /home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLVisitor.hpp:29,
                 from /home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:26:
/home/vincent/Projects/webcl-validator/llvm/tools/clang/include/clang/AST/DeclBase.h:452:29: note: template<class T> bool clang::Decl::hasAttr() const
   template<typename T> bool hasAttr() const {
                             ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/include/clang/AST/DeclBase.h:452:29: note:   template argument deduction/substitution failed:
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:650:64: error: template argument 1 is invalid
         if (!parmVarDecl.hasAttr<clang::OpenCLImageAccessAttr>()) {
                                                                ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:653:49: error: ‘OpenCLImageAccessAttr’ is not a member of ‘clang’
             int qualifier = parmVarDecl.getAttr<clang::OpenCLImageAccessAttr>()->getAccess();
                                                 ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:653:49: error: ‘OpenCLImageAccessAttr’ is not a member of ‘clang’
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:653:79: error: no matching function for call to ‘clang::ParmVarDecl::getAttr() const’
             int qualifier = parmVarDecl.getAttr<clang::OpenCLImageAccessAttr>()->getAccess();
                                                                               ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:653:79: note: candidate is:
In file included from /home/vincent/Projects/webcl-validator/llvm/tools/clang/include/clang/AST/Decl.h:18:0,
                 from /home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLTypes.hpp:27,
                 from /home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLVisitor.hpp:29,
                 from /home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:26:
/home/vincent/Projects/webcl-validator/llvm/tools/clang/include/clang/AST/DeclBase.h:449:27: note: template<class T> T* clang::Decl::getAttr() const
   template<typename T> T *getAttr() const {
                           ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/include/clang/AST/DeclBase.h:449:27: note:   template argument deduction/substitution failed:
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:653:79: error: template argument 1 is invalid
             int qualifier = parmVarDecl.getAttr<clang::OpenCLImageAccessAttr>()->getAccess();
                                                                               ^
/home/vincent/Projects/webcl-validator/llvm/tools/clang/tools/webcl-validator/lib/WebCLPass.cpp:656:5: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
make[2]: *** [tools/clang/tools/webcl-validator/lib/CMakeFiles/libclv.dir/WebCLPass.cpp.o] Fout 1
make[1]: *** [tools/clang/tools/webcl-validator/lib/CMakeFiles/libclv.dir/all] Fout 2
make: *** [all] Fout 2
elhigu commented 10 years ago

We recently updated validator to work with unmodified llvm/clang 3.4 unfortunately readme.md was not updated in change. I'll update build instructions tomorrow. Issue #71 is about readme update.

VincentSC commented 10 years ago

Thank you for the quick answer. I think I saw it in the mailinglist, now you say so. I now did:

git clone http://llvm.org/git/llvm.git
git clone http://llvm.org/git/clang.git
ln -s ../../webcl-validator/ clang/tools/webcl-validator
ln -s ../../webcl-validator/ clang/
cd build
make -j4

That seems to be working. Great!