<div dir="ltr"><div><div>Hi,<br><br>thanks for your mail! I tried, using llvm35 and clang35 as follows:<br><br>cmake ../ -DLLVM_INSTALL_DIR=/usr/local/llvm35/bin/ -DCOMPILER=CLANG<br><br></div>and get the same errors:<br><br>/usr/include/c++/v1/memory:1568:28: error: cannot initialize a parameter of type 'pointer' (aka 'std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>,<br>      std::__1::allocator<char> >, gbe::ir::Function *>, void *> *') with an lvalue of type 'gbe::ir::Function **'<br>            {__a.construct(__p, _VSTD::forward<_Args>(__args)...);}<br>                           ^~~<br>/usr/include/c++/v1/memory:1449:14: note: in instantiation of function template specialization 'std::__1::allocator_traits<gbe::Allocator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char,<br>      std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *>, void *> > >::__construct<gbe::ir::Function *>' requested here<br>            {__construct(__has_construct<allocator_type, pointer, _Args...>(),<br>             ^<br>/usr/include/c++/v1/tr1/unordered_map:1340:20: note: in instantiation of function template specialization<br>      'std::__1::allocator_traits<gbe::Allocator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *>, void *> ><br>      >::construct<gbe::ir::Function *>' requested here<br>    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));<br>                   ^<br>/usr/include/c++/v1/tr1/unordered_map:1363:25: note: in instantiation of member function 'std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *,<br>      std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >,<br>      gbe::Allocator<std::__1::pair<const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *> > >::__construct_node_with_key' requested here<br>    __node_holder __h = __construct_node_with_key(__k);<br>                        ^<br>/usr/home/sid/software/beignet/backend/src/ir/unit.cpp:45:14: note: in instantiation of member function 'std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >,<br>      gbe::ir::Function *, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>,<br>      std::__1::allocator<char> > >, gbe::Allocator<std::__1::pair<const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *> > >::operator[]' requested here<br>    functions[name] = fn;<br>             ^<br>/usr/home/sid/software/beignet/backend/src/./sys/alloc.hpp:159:35: note: passing argument to parameter 'p' here<br>    INLINE void construct(pointer p, const T& t = T()) { ::new(p) T(t); }<br><br></div>Johannes<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 21, 2014 at 1:14 AM, Zhigang Gong <span dir="ltr"><<a href="mailto:zhigang.gong@linux.intel.com" target="_blank">zhigang.gong@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="#0563C1" vlink="#954F72" lang="ZH-CN"><div><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">According to the error log, It seems that clang is the default compiler but it still uses gcc’s flags.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US">Could you try to make a complete rebuild start with<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US"># cmake -DCOMPILER=CLANG<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" lang="EN-US"> Beignet [mailto:<a href="mailto:beignet-bounces@lists.freedesktop.org" target="_blank">beignet-bounces@lists.freedesktop.org</a>] <b>On Behalf Of </b>Johannes Dieterich<br><b>Sent:</b> Thursday, November 20, 2014 5:22 AM<br><b>To:</b> <a href="mailto:beignet@lists.freedesktop.org" target="_blank">beignet@lists.freedesktop.org</a><br><b>Subject:</b> [Beignet] porting beignet to FreeBSD<u></u><u></u></span></p></div></div><div><div class="h5"><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><div><div><div><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Hi,<br><br>I am currently looking into porting beignet over to FreeBSD. My motivation is strictly based on wanting to use my preferred system for OpenCL development so please bear with me that I am a bit shaky in some stuff especially in the grittier C++ details...<u></u><u></u></span></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">I should start by saying in general the "graphics" support within FreeBSD is currently lagging behind Linux a bit but we are fortunate to have a few talented and driven developers working on that and hopefully changing that eventually (I am not one of them :-) ).<u></u><u></u></span></p></div><p class="MsoNormal"><span lang="EN-US">Please find attached a few patches that enable configuring and the first few compilations on FreeBSD. Namely, those are:<br><br>* FindLLVM.patch: adds FreeBSD names of llvm-config to the search list (both llvm 3.4 and 3.5).<u></u><u></u></span></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>* alloc.patch: for backend/src/sys/alloc.cpp , adds a FreeBSD clause to the alignedMalloc function, using the POSIX standard function posix_memalign.<u></u><u></u></span></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">My next issue is the hash_map.hpp. You use std::tr1::unordered_map while FreeBSD (according to my research) requires the use of std::unordered_map instead (see a patch to that extend attached as hash_map.patch). However, I am uncertain as I get the following errors at compile time:<br><br>[  8%] Building CXX object backend/src/CMakeFiles/gbe.dir/ir/unit.cpp.o<br>cd /usr/home/sid/software/beignet/build/backend/src && /usr/local/bin/clang++34   -DEMULATE_GEN=0 -DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND -DUSE_FULSIM=0 -Dgbe_EXPORTS -funroll-loops -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -fPIC -Wall -mfpmath=sse -Wcast-align -Wl,-E -std=c++0x -Wno-invalid-offsetof -fno-rtti -I/usr/local/llvm34/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DGBE_DEBUG_MEMORY=0  -DGBE_COMPILER_AVAILABLE=1 -fvisibility=hidden -O2 -g -DGBE_DEBUG=1 -fPIC -I/usr/home/sid/software/beignet/build -I/usr/home/sid/software/beignet -I/usr/local/include -I/usr/local/include/libdrm -I/usr/home/sid/software/beignet/build/backend -I/usr/home/sid/software/beignet/backend/src/.    -D__sid__ -DLLVM_34 -o CMakeFiles/gbe.dir/ir/unit.cpp.o -c /usr/home/sid/software/beignet/backend/src/ir/unit.cpp<br>clang: warning: -Wl,-E: 'linker' input unused<br>In file included from /usr/home/sid/software/beignet/backend/src/ir/unit.cpp:24:<br>In file included from /usr/home/sid/software/beignet/backend/src/./ir/unit.hpp:27:<br>In file included from /usr/home/sid/software/beignet/backend/src/./ir/constant.hpp:28:<br>In file included from /usr/home/sid/software/beignet/backend/src/./sys/vector.hpp:28:<br>In file included from /usr/home/sid/software/beignet/backend/src/./sys/platform.hpp:26:<br>In file included from /usr/include/c++/v1/iostream:38:<br>In file included from /usr/include/c++/v1/ios:216:<br>In file included from /usr/include/c++/v1/__locale:15:<br>In file included from /usr/include/c++/v1/string:439:<br>In file included from /usr/include/c++/v1/algorithm:627:<br>/usr/include/c++/v1/memory:1568:28: error: cannot initialize a parameter of type 'pointer' (aka 'std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>,<br>      std::__1::allocator<char> >, gbe::ir::Function *>, void *> *') with an lvalue of type 'gbe::ir::Function **'<br>            {__a.construct(__p, _VSTD::forward<_Args>(__args)...);}<br>                           ^~~<br>/usr/include/c++/v1/memory:1449:14: note: in instantiation of function template specialization 'std::__1::allocator_traits<gbe::Allocator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char,<br>      std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *>, void *> > >::__construct<gbe::ir::Function *>' requested here<br>            {__construct(__has_construct<allocator_type, pointer, _Args...>(),<br>             ^<br>/usr/include/c++/v1/tr1/unordered_map:1340:20: note: in instantiation of function template specialization<br>      'std::__1::allocator_traits<gbe::Allocator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *>, void *> ><br>      >::construct<gbe::ir::Function *>' requested here<br>    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));<br>                   ^<br>/usr/include/c++/v1/tr1/unordered_map:1363:25: note: in instantiation of member function 'std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *,<br>      std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >,<br>      gbe::Allocator<std::__1::pair<const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *> > >::__construct_node_with_key' requested here<br>    __node_holder __h = __construct_node_with_key(__k);<br>                        ^<br>/usr/home/sid/software/beignet/backend/src/ir/unit.cpp:45:14: note: in instantiation of member function 'std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >,<br>      gbe::ir::Function *, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>,<br>      std::__1::allocator<char> > >, gbe::Allocator<std::__1::pair<const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, gbe::ir::Function *> > >::operator[]' requested here<br>    functions[name] = fn;<br>             ^<br>/usr/home/sid/software/beignet/backend/src/./sys/alloc.hpp:159:35: note: passing argument to parameter 'p' here<br>    INLINE void construct(pointer p, const T& t = T()) { ::new(p) T(t); }<br>                                  ^<br>1 error generated.<br>*** Error code 1<br><br>Stop.<br>make[2]: stopped in /usr/home/sid/software/beignet/build<br>*** Error code 1<br><br>Stop.<u></u><u></u></span></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">I hope somebody can shed some light on what the cause of this is and where I can look to fix this! :-)<u></u><u></u></span></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Thanks a lot!<u></u><u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US">Johannes<u></u><u></u></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div></div></div></div></div></div></div></blockquote></div><br></div>