<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Ying, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/undefined-reference-to-sgemm-Eigen3-MKL/m-p/1146754#M26749</link>
    <description>&lt;P&gt;Hi Ying,&lt;/P&gt;

&lt;P&gt;thanks for your fast reply!&lt;/P&gt;

&lt;P&gt;The issue resolved itself now. I had been building another library in the same CMakeFile, which also used MKL, but forgot to add the MKL libraries there :/. Now that it is added, it works fine! :)&lt;/P&gt;

&lt;P&gt;Thanks and best regards,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; Dnaiel&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jul 2017 13:25:20 GMT</pubDate>
    <dc:creator>Daniel_P_Intel1</dc:creator>
    <dc:date>2017-07-14T13:25:20Z</dc:date>
    <item>
      <title>undefined reference to `sgemm'  Eigen3 + MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/undefined-reference-to-sgemm-Eigen3-MKL/m-p/1146752#M26747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a project that runs fine in Windows with Eigen 3. When enabling MKL in Visual Studio with EIGEN_USE_MKL_ALL, I see speed-ups of about 5-15 percent.&lt;/P&gt;

&lt;P&gt;When trying to get this to run in Linux, it causes problems during linking. I am using Eigen3 (3.2.92) together with MKL (2017.4.196)&amp;nbsp; in an Ubuntu 14.04 project. For the preprocessor I defined in the CMakeFile:&lt;/P&gt;

&lt;P&gt;ADD_DEFINITIONS(-DEIGEN_USE_MKL_ALL)&amp;nbsp;&amp;nbsp; - I also tried instead ADD_DEFINITIONS(-DEIGEN_USE_BLAS)&amp;nbsp; as this is the part I am benefitting the most.&lt;/P&gt;

&lt;P&gt;For CXX_CMAKE_CXX_FLAGS I added -D TBB_USE_THREADING_TOOLS -DMKL_LP64&lt;/P&gt;

&lt;P&gt;Added include directory: /opt/intel/compilers_and_libraries/linux/mkl/include&lt;/P&gt;

&lt;P&gt;Added linker directory: /opt/intel/compilers_and_libraries/linux/mkl/lib/intel64&lt;/P&gt;

&lt;P&gt;TARGET_LINK_LIBRARIES(visualizer mkl_core mkl_tbb_thread mkl_def mkl_intel_lp64 mkl_intel_ilp64 tbb&amp;nbsp; ${catkin_LIBRARIES} ${SDL2_LIBRARIES} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES}&amp;nbsp; ${PNG_LIBRARY} ${PROJECT_NAME} )&lt;/P&gt;

&lt;P&gt;I also tried just using intel_lp64 or just using intel_ilp64, which doesn't seem to change the behaviour of this. What is the difference anyway?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When I build it (using catkin build), I get the following:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;/home/elch/catkin-ws2/devel/.private/o_m/lib/libo_m.a(Qq.cpp.o): In function `Eigen::internal::general_matrix_matrix_product&amp;lt;long, float, 0, false, float, 0, false, 0&amp;gt;::run(long, long, long, float const*, long, float const*, long, float*, long, float, Eigen::internal::level3_blocking&amp;lt;float, float&amp;gt;&amp;amp;, Eigen::internal::GemmParallelInfo&amp;lt;long&amp;gt;*)':
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h:112: undefined reference to `sgemm'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/elch/catkin-ws2/devel/.private/o_m/lib/o_m/visualizer] Error 1
make[1]: *** [CMakeFiles/visualizer.dir/all] Error 2
make: *** [all] Error 2

&lt;/PRE&gt;

&lt;P&gt;Any advice?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 15:27:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/undefined-reference-to-sgemm-Eigen3-MKL/m-p/1146752#M26747</guid>
      <dc:creator>Daniel_P_Intel1</dc:creator>
      <dc:date>2017-07-13T15:27:10Z</dc:date>
    </item>
    <item>
      <title>Hi Daniel, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/undefined-reference-to-sgemm-Eigen3-MKL/m-p/1146753#M26748</link>
      <description>&lt;P&gt;Hi Daniel,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The sgemm is in the library mkl_intel_lp64.so&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;gt;nm libmkl_intel_lp64.so | grep sgemm&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px;"&gt;00000000001357b0 T sgemm&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;If possible, could you please post the link line when you build the project? &amp;nbsp;&lt;/P&gt;

&lt;P&gt;especially. &amp;nbsp;the line of &amp;nbsp;&lt;SPAN style="font-size: 12px;"&gt;TARGET_LINK_LIBRARIES(visualizer mkl_core mkl_tbb_thread mkl_def mkl_intel_lp64 mkl_intel_ilp64 tbb&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Generally, you can find the wanted MKL library by &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;&lt;A href="https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor" target="_blank"&gt;https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;for example,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_tbb_thread -lmkl_core -ltbb -lstdc++ -lpthread -lm -ldl&amp;nbsp;&amp;nbsp;(the order does matter).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Under windows the library name &amp;nbsp;is &amp;nbsp;mkl_intel_lp64.lib &amp;nbsp;etc.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Under linux &amp;nbsp;the library name is libmkl_intel_lp64. a .&lt;/P&gt;

&lt;P&gt;So please check &amp;nbsp;how the Cmake to parse the link &amp;nbsp;line: &amp;nbsp;&amp;nbsp;&lt;SPAN style="font-size: 12px;"&gt;ARGET_LINK_LIBRARIES(visualizer mkl_core. &amp;nbsp;...)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;Ying&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 01:00:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/undefined-reference-to-sgemm-Eigen3-MKL/m-p/1146753#M26748</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2017-07-14T01:00:57Z</dc:date>
    </item>
    <item>
      <title>Hi Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/undefined-reference-to-sgemm-Eigen3-MKL/m-p/1146754#M26749</link>
      <description>&lt;P&gt;Hi Ying,&lt;/P&gt;

&lt;P&gt;thanks for your fast reply!&lt;/P&gt;

&lt;P&gt;The issue resolved itself now. I had been building another library in the same CMakeFile, which also used MKL, but forgot to add the MKL libraries there :/. Now that it is added, it works fine! :)&lt;/P&gt;

&lt;P&gt;Thanks and best regards,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; Dnaiel&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 13:25:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/undefined-reference-to-sgemm-Eigen3-MKL/m-p/1146754#M26749</guid>
      <dc:creator>Daniel_P_Intel1</dc:creator>
      <dc:date>2017-07-14T13:25:20Z</dc:date>
    </item>
  </channel>
</rss>

