<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial">You misunderstand what I mean. I just want to build my application program with static libraries including libcl.a and libgbeinterp.a.<br><br><div></div><div id="divNeteaseMailCard"></div><br>在 2014-12-31 19:07:25,"Guo, Yejun" <yejun.guo@intel.com> 写道:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">



<style></style>


<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Just build libcl.so and libgbeinterp.so in the old c/c++ environment, and use the offline compiler that built in mainstream c/c++ environment. It will make
 beignet workable with CL_EMBEDDED_PROFILE in the old c/c++ environment, please refer to my next two patches of this patch set.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> spring_wind [mailto:<a href="mailto:spring_wind@yeah.net">spring_wind@yeah.net</a>]
<br>
<b>Sent:</b> Wednesday, December 31, 2014 4:30 PM<br>
<b>To:</b> Guo, Yejun<br>
<b>Cc:</b> <a href="mailto:beignet@lists.freedesktop.org">beignet@lists.freedesktop.org</a><br>
<b>Subject:</b> Re:[Beignet] [PATCH 1/3] add option BUILD_STATIC_GBE_COMPILER to build static compiler<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black">Do you have plan to support to build libcl and libgbe_interp in static way? Only add static in CMakeList.txt will not work, because
 init function will not be called if we use libcl.a and libgbe_interp.a, but it works for libcl.so and libgbe_interp.so.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black"><o:p> </o:p></span></p>
<pre><span style="color:black"><br>At 2014-12-31 15:34:22, "Guo Yejun" <<a href="mailto:yejun.guo@intel.com">yejun.guo@intel.com</a>> wrote:<o:p></o:p></span></pre>
<pre><span style="color:black">>The offline compiler (gbe_bin_generater), depending on LLVM/clang,<o:p></o:p></span></pre>
<pre><span style="color:black">>could only be built with C++11 features. To make it workable within<o:p></o:p></span></pre>
<pre><span style="color:black">>old c/c++ version environment, add one CMAKE option to link against<o:p></o:p></span></pre>
<pre><span style="color:black">>all static libraries.<o:p></o:p></span></pre>
<pre><span style="color:black">><o:p> </o:p></span></pre>
<pre><span style="color:black">>Signed-off-by: Guo Yejun <<a href="mailto:yejun.guo@intel.com">yejun.guo@intel.com</a>><o:p></o:p></span></pre>
<pre><span style="color:black">>---<o:p></o:p></span></pre>
<pre><span style="color:black">> backend/src/CMakeLists.txt | 33 +++++++++++++++++++++++----------<o:p></o:p></span></pre>
<pre><span style="color:black">> 1 file changed, 23 insertions(+), 10 deletions(-)<o:p></o:p></span></pre>
<pre><span style="color:black">><o:p> </o:p></span></pre>
<pre><span style="color:black">>diff --git a/backend/src/CMakeLists.txt b/backend/src/CMakeLists.txt<o:p></o:p></span></pre>
<pre><span style="color:black">>index bec0d2a..118a745 100644<o:p></o:p></span></pre>
<pre><span style="color:black">>--- a/backend/src/CMakeLists.txt<o:p></o:p></span></pre>
<pre><span style="color:black">>+++ b/backend/src/CMakeLists.txt<o:p></o:p></span></pre>
<pre><span style="color:black">>@@ -117,22 +117,22 @@ set (GBE_SRC<o:p></o:p></span></pre>
<pre><span style="color:black">>     backend/gen8_encoder.cpp<o:p></o:p></span></pre>
<pre><span style="color:black">>     )<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>+set (GBE_LINK_LIBRARIES<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${DRM_INTEL_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${DRM_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${CLANG_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${LLVM_MODULE_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${LLVM_SYSTEM_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${CMAKE_THREAD_LIBS_INIT}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    ${CMAKE_DL_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>+    )<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> include_directories (.)<o:p></o:p></span></pre>
<pre><span style="color:black">> link_directories (${LLVM_LIBRARY_DIRS} ${DRM_LIBDIR})<o:p></o:p></span></pre>
<pre><span style="color:black">> include_directories(${LLVM_INCLUDE_DIRS})<o:p></o:p></span></pre>
<pre><span style="color:black">> add_library (gbe SHARED ${GBE_SRC})<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>-<o:p></o:p></span></pre>
<pre><span style="color:black">>-target_link_libraries(<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      gbe<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${DRM_INTEL_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${DRM_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${CLANG_LIBRARIES}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${LLVM_MODULE_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${LLVM_SYSTEM_LIBS}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${CMAKE_THREAD_LIBS_INIT}<o:p></o:p></span></pre>
<pre><span style="color:black">>-                      ${CMAKE_DL_LIBS})<o:p></o:p></span></pre>
<pre><span style="color:black">>+target_link_libraries(gbe ${GBE_LINK_LIBRARIES})<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> add_library(gbeinterp SHARED gbe_bin_interpreter.cpp)<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">>@@ -149,8 +149,21 @@ if (LLVM_VERSION_NODOT VERSION_EQUAL 34)<o:p></o:p></span></pre>
<pre><span style="color:black">> endif(LLVM_VERSION_NODOT VERSION_EQUAL 34)<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> link_directories (${LLVM_LIBRARY_DIR} ${DRM_LIBDIR})<o:p></o:p></span></pre>
<pre><span style="color:black">>+<o:p></o:p></span></pre>
<pre><span style="color:black">>+if (BUILD_STATIC_GBE_COMPILER STREQUAL "true")<o:p></o:p></span></pre>
<pre><span style="color:black">>+macro(remove_cxx_flag flag)<o:p></o:p></span></pre>
<pre><span style="color:black">>+  string(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")<o:p></o:p></span></pre>
<pre><span style="color:black">>+endmacro()<o:p></o:p></span></pre>
<pre><span style="color:black">>+<o:p></o:p></span></pre>
<pre><span style="color:black">>+remove_cxx_flag("-Wl,-E")<o:p></o:p></span></pre>
<pre><span style="color:black">>+ADD_EXECUTABLE(gbe_bin_generater gbe_bin_generater.cpp ${GBE_SRC})<o:p></o:p></span></pre>
<pre><span style="color:black">>+set_target_properties(gbe_bin_generater PROPERTIES LINK_FLAGS "-static")<o:p></o:p></span></pre>
<pre><span style="color:black">>+TARGET_LINK_LIBRARIES(gbe_bin_generater ${GBE_LINK_LIBRARIES})<o:p></o:p></span></pre>
<pre><span style="color:black">>+else (BUILD_STATIC_GBE_COMPILER STREQUAL "true")<o:p></o:p></span></pre>
<pre><span style="color:black">> ADD_EXECUTABLE(gbe_bin_generater gbe_bin_generater.cpp)<o:p></o:p></span></pre>
<pre><span style="color:black">> TARGET_LINK_LIBRARIES(gbe_bin_generater gbe)<o:p></o:p></span></pre>
<pre><span style="color:black">>+endif (BUILD_STATIC_GBE_COMPILER STREQUAL "true")<o:p></o:p></span></pre>
<pre><span style="color:black">>+<o:p></o:p></span></pre>
<pre><span style="color:black">> <o:p></o:p></span></pre>
<pre><span style="color:black">> install (TARGETS gbe LIBRARY DESTINATION ${BEIGNET_INSTALL_DIR})<o:p></o:p></span></pre>
<pre><span style="color:black">> install (TARGETS gbeinterp LIBRARY DESTINATION ${BEIGNET_INSTALL_DIR})<o:p></o:p></span></pre>
<pre><span style="color:black">>-- <o:p></o:p></span></pre>
<pre><span style="color:black">>1.9.1<o:p></o:p></span></pre>
<pre><span style="color:black">><o:p> </o:p></span></pre>
<pre><span style="color:black">>_______________________________________________<o:p></o:p></span></pre>
<pre><span style="color:black">>Beignet mailing list<o:p></o:p></span></pre>
<pre><span style="color:black">><a href="mailto:Beignet@lists.freedesktop.org">Beignet@lists.freedesktop.org</a><o:p></o:p></span></pre>
<pre><span style="color:black">><a href="http://lists.freedesktop.org/mailman/listinfo/beignet">http://lists.freedesktop.org/mailman/listinfo/beignet</a><o:p></o:p></span></pre>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>


</blockquote></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"><span title="neteasefooter"><span id="netease_mail_footer"><a href="#" target="_blank"></a></span></span>
</span></span>