[Beignet] beignet doesnt compile with LLVM 3.6

Yang, Rong R rong.r.yang at intel.com
Mon Dec 15 18:19:34 PST 2014


I planned to support llvm3.6 before. But after fix all llvm3.6 compiler errors, there are some beignet’s utests fails.
Because llvm 3.6 seems has some bugs in that time and it’s release schedule delayed, I pending it.
Now, I will restart supporting and need some time.

Thanks
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Paulo Dias
Sent: Monday, December 15, 2014 19:47
To: Zhenyu Wang; Yang, Rong R
Cc: junyan.he at linux.intel.com; beignet at lists.freedesktop.org
Subject: Re: [Beignet] beignet doesnt compile with LLVM 3.6

Hi to you,

sorry to bother you guys again, but llvm 3.6 is almost out and beignet still doesnt compile with the latest git:

In file included from /home/groo/devel/intel/beignet/beignet/backend/src/./sys/vector.hpp:28:0,
                 from /home/groo/devel/intel/beignet/beignet/backend/src/./ir/register.hpp:27,
                 from /home/groo/devel/intel/beignet/beignet/backend/src/./ir/instruction.hpp:27,
                 from /home/groo/devel/intel/beignet/beignet/backend/src/./backend/context.hpp:23,
                 from /home/groo/devel/intel/beignet/beignet/backend/src/backend/program.hpp:29,
                 from /home/groo/devel/intel/beignet/beignet/backend/src/backend/program.cpp:26:
/usr/lib/llvm-3.6/include/llvm/Support/SpecialCaseList.h: At global scope:
/home/groo/devel/intel/beignet/beignet/backend/src/./sys/platform.hpp:263:12: error: expected ‘,’ or ‘...’ before ‘(’ token
 #define MB (KB*KB)
            ^
/usr/lib/llvm-3.6/include/llvm/Support/SpecialCaseList.h:67:70: note: in expansion of macro ‘MB’
   static std::unique_ptr<SpecialCaseList> create(const MemoryBuffer *MB,
                                                                      ^
/home/groo/devel/intel/beignet/beignet/backend/src/./sys/platform.hpp:263:12: error: expected ‘,’ or ‘...’ before ‘(’ token
 #define MB (KB*KB)
            ^
/usr/lib/llvm-3.6/include/llvm/Support/SpecialCaseList.h:92:34: note: in expansion of macro ‘MB’
   bool parse(const MemoryBuffer *MB, std::string &Error);
                                  ^
/home/groo/devel/intel/beignet/beignet/backend/src/backend/program.cpp: In function ‘bool gbe::buildModuleFromSource(const char*, llvm::Module**, llvm::LLVMContext*, std::vector<std::basic_string<char> >&, size_t, char*, size_t*)’:
/home/groo/devel/intel/beignet/beignet/backend/src/backend/program.cpp:614:44: error: cannot convert ‘std::unique_ptr<llvm::Module>’ to ‘llvm::Module*’ in initialization
     llvm::Module *module = Act->takeModule();
                                            ^
backend/src/CMakeFiles/gbe.dir/build.make:586<http://gbe.dir/build.make:586>: recipe for target 'backend/src/CMakeFiles/gbe.dir/backend/program.cpp.o<http://gbe.dir/backend/program.cpp.o>' failed
make[2]: *** [backend/src/CMakeFiles/gbe.dir/backend/program.cpp.o<http://gbe.dir/backend/program.cpp.o>] Error 1
CMakeFiles/Makefile2:114: recipe for target 'backend/src/CMakeFiles/gbe.dir/all<http://gbe.dir/all>' failed

could you guys take a look at it?

thanks in advance

Paulo Dias

On Tue Nov 04 2014 at 5:18:25 AM Zhenyu Wang <zhenyuw at linux.intel.com<mailto:zhenyuw at linux.intel.com>> wrote:
On 2014.11.03 08:46:41 +0000, Yang, Rong R wrote:
> Yes, some errors is because llvm use std:: unique_ptr as some function’s return
> value instead of the normal ptr, there are some other errors after fix std::
> unique_ptr error.
>
> As we notice that LLVM plan to release LLVM/Clang 3.6 soon, suppose the LLVM
> 3.6 approach to stable now, I am working to support LLVM 3.6 now. Hope could
> finish it soon.
>

One option is to explicitly say the llvm version that beignet does support
and refuse to go on otherwise, like below one?

From: Zhenyu Wang <zhenyuw at linux.intel.com<mailto:zhenyuw at linux.intel.com>>
Date: Tue, 4 Nov 2014 15:14:44 +0800
Subject: [PATCH] Explicitly check LLVM version when building

Instead of allowing for failure attemps to build with llvm unstable
version this trys to explicitly tell the llvm version that beignet support.

Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com<mailto:zhenyuw at linux.intel.com>>
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40cb74c..7059b2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,6 +94,9 @@ set (CMAKE_C_FLAGS_RELEASE        "-O2 -DNDEBUG -DGBE_DEBUG=0")
 # Front end stuff we need
 #INCLUDE(CMake/FindLLVM.cmake)
 Find_Package(LLVM 3.3)
+IF(LLVM_VERSION VERSION_GREATER 3.5)
+  MESSAGE(FATAL_ERROR "Don't support LLVM > 3.5 now.")
+ENDIF(LLVM_VERSION VERSION_GREATER 3.5)

 set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${LLVM_LDFLAGS}")

--
2.1.1

--
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net<http://wwwkeys.pgp.net> --recv-keys 4D781827
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20141216/de7011ea/attachment.html>


More information about the Beignet mailing list