<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D'>According to the error log, It seems that clang is the default compiler but it still uses gcc’s flags.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D'>Could you try to make a complete rebuild start with<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D'># cmake -DCOMPILER=CLANG<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></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 lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Beignet [mailto:beignet-bounces@lists.freedesktop.org] <b>On Behalf Of </b>Johannes Dieterich<br><b>Sent:</b> Thursday, November 20, 2014 5:22 AM<br><b>To:</b> beignet@lists.freedesktop.org<br><b>Subject:</b> [Beignet] porting beignet to FreeBSD<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></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...<o:p></o:p></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 :-) ).<o:p></o:p></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).<o:p></o:p></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.<o:p></o:p></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.<o:p></o:p></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! :-)<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US>Thanks a lot!<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Johannes<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></div></div></div></body></html>