<?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 I didn't manage to figure out in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175983#M28924</link>
    <description>&lt;P&gt;I didn't manage to figure out why a pip install wouldn't end up allowing more compilation options (setting similar environment variables didn't make a difference), but in the end found that with the pip install, it's possible to compile like this too:&lt;/P&gt;
&lt;PRE class="brush:; class-name:dark;"&gt;g++ the_file.cpp -I$HOME/.local/include -L$HOME/.local/lib -l:libmkl_rt.so -Wl,-rpath=$HOME/.local/lib&lt;/PRE&gt;

&lt;P&gt;Then it will work fine.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2020 12:35:26 GMT</pubDate>
    <dc:creator>Cortes__David</dc:creator>
    <dc:date>2020-01-23T12:35:26Z</dc:date>
    <item>
      <title>Cannot link against MKL installed from pip</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175978#M28919</link>
      <description>&lt;P&gt;In Linux(Ubuntu and OpenSuSe), I've tried installing MKL through pip:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:; class-name:dark;"&gt;python3 -m pip install mkl-devel --user&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:; class-name:dark;"&gt;sudo pip3 install mkl-devel

&lt;/PRE&gt;

&lt;P&gt;Which will install the headers under&lt;/P&gt;

&lt;PRE class="brush:; class-name:dark; wrap-lines:false;"&gt;$HOME/.local/include&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;and shared objects under&lt;/P&gt;

&lt;PRE class="brush:; class-name:dark;"&gt;$HOME/.local/lib
&lt;/PRE&gt;

&lt;P&gt;But then I try compiling some file against it using gcc&amp;nbsp;or clang&amp;nbsp;with these arguments:&lt;/P&gt;

&lt;PRE class="brush:; class-name:dark;"&gt;g++ the_file.cpp I$HOME/.local/include -l:$HOME/.local/lib/libmkl_rt.so&lt;/PRE&gt;

&lt;P&gt;And get the following error:&lt;/P&gt;

&lt;PRE class="brush:; class-name:dark;"&gt;/usr/bin/ld: cannot find -l:/home/david/.local/libmkl_rt.so&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even though the file exists and I've set all permissions for everyone:&lt;/P&gt;

&lt;PRE class="brush:; class-name:dark;"&gt;ls -s /home/david/.local/libmkl_rt.so&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;Shows these permissions:&lt;/P&gt;

&lt;PRE class="brush:; class-name:dark;"&gt;-rwxrwxrwx 1&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 18:58:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175978#M28919</guid>
      <dc:creator>Cortes__David</dc:creator>
      <dc:date>2020-01-21T18:58:25Z</dc:date>
    </item>
    <item>
      <title>Hi David,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175979#M28920</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The path and the particular library to link are separate GNU compiler parameters.&amp;nbsp; Try the following changes,&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;g++ the_file.cpp -I$HOME/.local/include -L $HOME/.local/lib/ -lmkl_rt.so
&lt;/PRE&gt;

&lt;P&gt;And when the&amp;nbsp;program runs, set an&amp;nbsp;environment variable.&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib/ ./a.out&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 21:44:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175979#M28920</guid>
      <dc:creator>Aaron_J_Intel2</dc:creator>
      <dc:date>2020-01-21T21:44:35Z</dc:date>
    </item>
    <item>
      <title>Thanks, that worked. Any hint</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175980#M28921</link>
      <description>&lt;P&gt;Thanks, that worked. Any hint on why passing the file with -l: would work for user and system-wide installs from e.g. conda or package manager, whereas with a pip install it wouldn’t?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 07:48:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175980#M28921</guid>
      <dc:creator>Cortes__David</dc:creator>
      <dc:date>2020-01-22T07:48:00Z</dc:date>
    </item>
    <item>
      <title>I am most familiar with using</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175981#M28922</link>
      <description>&lt;P&gt;I am most familiar with using&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;python -m virtualenv&lt;/PRE&gt;

&lt;P&gt;applications and the way those&amp;nbsp;work&amp;nbsp;is by modifying env variables which when activated change the PATH et al.&amp;nbsp; I think this might be&amp;nbsp;similiar to how conda is implemented.&amp;nbsp; There is probably some setup script provided by the package manager and conda that the pip package is missing.&lt;/P&gt;
&lt;P&gt;I'm not familiar with the "-l:" usage.&amp;nbsp; I have not found any documentation about how it works.&amp;nbsp; In particular the colon aspect, I have not seen that before.&lt;/P&gt;
&lt;P&gt;First I would verify&amp;nbsp;if&amp;nbsp;the path for g++ and ld are the same in all cases.&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;which g++&lt;/PRE&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;which ld&lt;/PRE&gt;

&lt;P&gt;And also&amp;nbsp;check versions in all cases; pip, conda, package manager.&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;ld -v&lt;/PRE&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;g++ --version&lt;/PRE&gt;

&lt;P&gt;And next, look at the environment variables set for each shell.&amp;nbsp; &amp;nbsp;In particular PATH, LD_LIBRARY_PATH, LD_PRELOAD, and env variables with CONDA_ prefix.&amp;nbsp; Read about how those influence each setup.&lt;/P&gt;
&lt;P&gt;NB: In my experience it&amp;nbsp;can be easy to get into an environment that uses a mixture of solutions when learning the differences between ways to do this, so while deciphering be careful to not install several solutions on the same machine simultaneously.&amp;nbsp; It is entirely possible there is overlap, unless only one way is done on each clean installation.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 17:39:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175981#M28922</guid>
      <dc:creator>Aaron_J_Intel2</dc:creator>
      <dc:date>2020-01-22T17:39:11Z</dc:date>
    </item>
    <item>
      <title>I think you could try to ask</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175982#M28923</link>
      <description>&lt;P&gt;I think&amp;nbsp;you could try to ask the python related questions to the IDP Forum -&amp;nbsp;https://software.intel.com/en-us/forums/intel-distribution-for-python&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 05:06:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175982#M28923</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-01-23T05:06:48Z</dc:date>
    </item>
    <item>
      <title>I didn't manage to figure out</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175983#M28924</link>
      <description>&lt;P&gt;I didn't manage to figure out why a pip install wouldn't end up allowing more compilation options (setting similar environment variables didn't make a difference), but in the end found that with the pip install, it's possible to compile like this too:&lt;/P&gt;
&lt;PRE class="brush:; class-name:dark;"&gt;g++ the_file.cpp -I$HOME/.local/include -L$HOME/.local/lib -l:libmkl_rt.so -Wl,-rpath=$HOME/.local/lib&lt;/PRE&gt;

&lt;P&gt;Then it will work fine.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 12:35:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Cannot-link-against-MKL-installed-from-pip/m-p/1175983#M28924</guid>
      <dc:creator>Cortes__David</dc:creator>
      <dc:date>2020-01-23T12:35:26Z</dc:date>
    </item>
  </channel>
</rss>

