<?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 Reduce the size of program after linking with MKL libraries in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253551#M30846</link>
    <description>&lt;P&gt;I am just getting started with intel MKL libraries (mac/Xcode 10/clang) but I have noticed that the resulting binaries have been very big even if I am using just a couple of APIs. For eg-&amp;nbsp; the following sample code results in a 25MB executable&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;    int N = 1;
    fftw_complex *in, *out;
    fftw_plan my_plan;
    in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N);
    out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N);
    my_plan = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
    fftw_execute(my_plan);
    fftw_destroy_plan(my_plan);
    fftw_free(in);
    fftw_free(out);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Following are my compilation settings (as generated by the link-line advisor)&lt;/P&gt;
&lt;P&gt;Link Flags -&lt;/P&gt;
&lt;P&gt;${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_sequential.a ${MKLROOT}/lib/libmkl_core.a -lpthread -lm -ldl&lt;/P&gt;
&lt;P&gt;Compiler Flags -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-DMKL_ILP64 -m64 -I"${MKLROOT}/include"&lt;/P&gt;
&lt;P&gt;I was statically linking to reduce the binary size as the same dylibs are 122 MB in size. Is it possible to reduce the size of the binary further?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a similar question on the forum &lt;A href="https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Size-of-MKL-libraries/td-p/1090402" target="_self"&gt;here&lt;/A&gt;, but the link to the answer is dead now.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 17:38:22 GMT</pubDate>
    <dc:creator>dakotaa</dc:creator>
    <dc:date>2021-02-05T17:38:22Z</dc:date>
    <item>
      <title>Reduce the size of program after linking with MKL libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253551#M30846</link>
      <description>&lt;P&gt;I am just getting started with intel MKL libraries (mac/Xcode 10/clang) but I have noticed that the resulting binaries have been very big even if I am using just a couple of APIs. For eg-&amp;nbsp; the following sample code results in a 25MB executable&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;    int N = 1;
    fftw_complex *in, *out;
    fftw_plan my_plan;
    in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N);
    out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*N);
    my_plan = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
    fftw_execute(my_plan);
    fftw_destroy_plan(my_plan);
    fftw_free(in);
    fftw_free(out);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Following are my compilation settings (as generated by the link-line advisor)&lt;/P&gt;
&lt;P&gt;Link Flags -&lt;/P&gt;
&lt;P&gt;${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_sequential.a ${MKLROOT}/lib/libmkl_core.a -lpthread -lm -ldl&lt;/P&gt;
&lt;P&gt;Compiler Flags -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-DMKL_ILP64 -m64 -I"${MKLROOT}/include"&lt;/P&gt;
&lt;P&gt;I was statically linking to reduce the binary size as the same dylibs are 122 MB in size. Is it possible to reduce the size of the binary further?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a similar question on the forum &lt;A href="https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Size-of-MKL-libraries/td-p/1090402" target="_self"&gt;here&lt;/A&gt;, but the link to the answer is dead now.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 17:38:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253551#M30846</guid>
      <dc:creator>dakotaa</dc:creator>
      <dc:date>2021-02-05T17:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce the size of program after linking with MKL libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253672#M30850</link>
      <description>&lt;P&gt;Your statement/question, "&lt;SPAN&gt;&lt;EM&gt;I was statically linking to reduce the binary size as the same dylibs are 122 MB in size. Is it possible to reduce the size of the binary further&lt;/EM&gt;? ", reveals several misconceptions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Go back to the MKL Link Line Advisor, and ascertain the options to use dynamic libraries, instead. For a short program with source code a couple of kilobytes long, compiling and linking with shared libraries should produce an a.out that is some tens of kilobytes in size.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can benefit from reading about how shared libraries work in Linux/OSX.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 11:18:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253672#M30850</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2021-02-06T11:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce the size of program after linking with MKL libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253718#M30852</link>
      <description>&lt;P&gt;Sorry, by "binary" I meant the total size of the application package (for eg .app bundle on mac). I thought by linking statically, only the code that I referenced would get embedded in the executable thereby reducing the overall size of the package.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I would like to rephrase my question as "&lt;EM&gt;Is it possible to reduce the size of the overall application package further?&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 18:29:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253718#M30852</guid>
      <dc:creator>dakotaa</dc:creator>
      <dc:date>2021-02-06T18:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce the size of program after linking with MKL libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253720#M30853</link>
      <description>&lt;P&gt;Also, it seems the static libraries contain the code for all the supported ISAs. Would it be possible to skip an instruction set like AVX512 while linking statically?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 18:32:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253720#M30853</guid>
      <dc:creator>dakotaa</dc:creator>
      <dc:date>2021-02-06T18:32:17Z</dc:date>
    </item>
    <item>
      <title>Re:Reduce the size of program after linking with MKL libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253986#M30859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are forwarding your query to the MKL experts. They will get in touch with you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Feb 2021 11:10:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253986#M30859</guid>
      <dc:creator>RahulV_intel</dc:creator>
      <dc:date>2021-02-08T11:10:04Z</dc:date>
    </item>
    <item>
      <title>Re:Reduce the size of program after linking with MKL libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253998#M30860</link>
      <description>&lt;P&gt;Yes, the statically linked executable contains optimizations for all supported ISA and in the case of Intel MKL, there is no opportunity to build the executable with only one supported code path&lt;/P&gt;&lt;P&gt;(instruction set).  For another Intel performance library ( aka IPP), such an opportunity exists. We recommend submitting such a Feature Request to the official support channel - Intel Online Service Center.&lt;/P&gt;&lt;P&gt;Thanks, Gennady&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Feb 2021 12:37:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1253998#M30860</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2021-02-08T12:37:46Z</dc:date>
    </item>
    <item>
      <title>Re:Reduce the size of program after linking with MKL libraries</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1259571#M30949</link>
      <description>&lt;P&gt;The issue is closing and we will no longer respond to this thread.&amp;nbsp;If you require additional assistance from Intel, please start a new thread.&amp;nbsp;Any further interaction in this thread will be considered community only.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Feb 2021 04:34:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Reduce-the-size-of-program-after-linking-with-MKL-libraries/m-p/1259571#M30949</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2021-02-26T04:34:18Z</dc:date>
    </item>
  </channel>
</rss>

