<?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 Problems linking MKL in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problems-linking-MKL/m-p/1180131#M8119</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to compile a shared library with intel icc. The code calls fftw though mkl and uses openMP. Under normal operation several c-objects are bundled together and linked to a ".a" static library. The suggested link flags from the documentation are "-mkl -lm." When example executables are linked to this library the codes execute and perform as advertised.&lt;/P&gt;&lt;P&gt;export INTEL=/software/intel/&lt;BR /&gt;source $INTEL/compilers_and_libraries/linux/bin/compilervars.sh intel64&lt;/P&gt;&lt;P&gt;is executed in bash and LD_LIBRARY_PATH seems properly set.&lt;/P&gt;&lt;P&gt;Now I am trying to bundle this code into a shared library (.so) that's called from another language through c-wrappers. However, I have not been able to get the shared library to work with just linker options.&lt;/P&gt;&lt;P&gt;What I've tried:&lt;/P&gt;&lt;P&gt;(1) Using Suggested library flags: "-mkl -lm"&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;INTEL MKL ERROR: /software/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.&lt;BR /&gt;Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.&lt;/P&gt;&lt;P&gt;(2) Using Single Dynamic Library with suggested flags from Intel® Math Kernel Library Link Line Advisor &lt;A href="https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&amp;nbsp;" target="_blank"&gt;https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&amp;nbsp;&lt;/A&gt;; "-lmkl_rt -lpthread -lm -ldl"&lt;/P&gt;&lt;P&gt;Error:&lt;BR /&gt;INTEL MKL ERROR: /software/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.&lt;BR /&gt;Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.&lt;/P&gt;&lt;P&gt;(3) Using static linking with suggested flags from Intel® Math Kernel Library Link Line Advisor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /32bit integer/openMP threading (libiomp5)/ : "-Wl,--start-group '+MKLROOT+'/lib/intel64/libmkl_intel_lp64.a '+MKLROOT+'/lib/intel64/libmkl_intel_thread.a '+MKLROOT+'/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl "&lt;/P&gt;&lt;P&gt;Error:&lt;BR /&gt;INTEL MKL ERROR: /software/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.&lt;BR /&gt;Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Now I have gotten the shared object to work by explicitly setting LD_PRELOAD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LIBS=${MKLROOT}/lib/intel64_lin/&lt;BR /&gt;export LD_PRELOAD=${LIBS}/libmkl_def.so:${LIBS}/libmkl_avx512.so:${LIBS}/libmkl_core.so:${LIBS}/libmkl_intel_lp64.so:${LIBS}/libmkl_intel_thread.so:/software/intel/compilers_and_libraries_2019.4.227/linux/compiler/lib/intel64_lin/libiomp5.so&lt;/P&gt;&lt;P&gt;However this solution is as awkward, particularly for a code that I'd like to offer up opensource. Is there a way to get EVERYTHING I need in the shared library on the link line without getting the kitchen sink in addition or having to explicitly set LD_PRELOAD?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-- Pete&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2019 16:08:55 GMT</pubDate>
    <dc:creator>pwschuck</dc:creator>
    <dc:date>2019-10-15T16:08:55Z</dc:date>
    <item>
      <title>Problems linking MKL</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problems-linking-MKL/m-p/1180131#M8119</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to compile a shared library with intel icc. The code calls fftw though mkl and uses openMP. Under normal operation several c-objects are bundled together and linked to a ".a" static library. The suggested link flags from the documentation are "-mkl -lm." When example executables are linked to this library the codes execute and perform as advertised.&lt;/P&gt;&lt;P&gt;export INTEL=/software/intel/&lt;BR /&gt;source $INTEL/compilers_and_libraries/linux/bin/compilervars.sh intel64&lt;/P&gt;&lt;P&gt;is executed in bash and LD_LIBRARY_PATH seems properly set.&lt;/P&gt;&lt;P&gt;Now I am trying to bundle this code into a shared library (.so) that's called from another language through c-wrappers. However, I have not been able to get the shared library to work with just linker options.&lt;/P&gt;&lt;P&gt;What I've tried:&lt;/P&gt;&lt;P&gt;(1) Using Suggested library flags: "-mkl -lm"&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;INTEL MKL ERROR: /software/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.&lt;BR /&gt;Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.&lt;/P&gt;&lt;P&gt;(2) Using Single Dynamic Library with suggested flags from Intel® Math Kernel Library Link Line Advisor &lt;A href="https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&amp;nbsp;" target="_blank"&gt;https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&amp;nbsp;&lt;/A&gt;; "-lmkl_rt -lpthread -lm -ldl"&lt;/P&gt;&lt;P&gt;Error:&lt;BR /&gt;INTEL MKL ERROR: /software/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.&lt;BR /&gt;Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.&lt;/P&gt;&lt;P&gt;(3) Using static linking with suggested flags from Intel® Math Kernel Library Link Line Advisor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /32bit integer/openMP threading (libiomp5)/ : "-Wl,--start-group '+MKLROOT+'/lib/intel64/libmkl_intel_lp64.a '+MKLROOT+'/lib/intel64/libmkl_intel_thread.a '+MKLROOT+'/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl "&lt;/P&gt;&lt;P&gt;Error:&lt;BR /&gt;INTEL MKL ERROR: /software/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/libmkl_avx512.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.&lt;BR /&gt;Intel MKL FATAL ERROR: Cannot load libmkl_avx512.so or libmkl_def.so.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Now I have gotten the shared object to work by explicitly setting LD_PRELOAD:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LIBS=${MKLROOT}/lib/intel64_lin/&lt;BR /&gt;export LD_PRELOAD=${LIBS}/libmkl_def.so:${LIBS}/libmkl_avx512.so:${LIBS}/libmkl_core.so:${LIBS}/libmkl_intel_lp64.so:${LIBS}/libmkl_intel_thread.so:/software/intel/compilers_and_libraries_2019.4.227/linux/compiler/lib/intel64_lin/libiomp5.so&lt;/P&gt;&lt;P&gt;However this solution is as awkward, particularly for a code that I'd like to offer up opensource. Is there a way to get EVERYTHING I need in the shared library on the link line without getting the kitchen sink in addition or having to explicitly set LD_PRELOAD?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-- Pete&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 16:08:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problems-linking-MKL/m-p/1180131#M8119</guid>
      <dc:creator>pwschuck</dc:creator>
      <dc:date>2019-10-15T16:08:55Z</dc:date>
    </item>
  </channel>
</rss>

