<?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 Many options (such as /Qmkl in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177953#M29129</link>
    <description>&lt;P&gt;Many options (such as /Qmkl vs. -mkl) are spelled differently in the Windows and Linux versions of the Intel Fortran compiler. The command that users commonly use (ifort.exe or ifort) is the driver program. It simply drives the compiler proper(fortcom.exe or fortcom) and linker (link.exe or ld), translating and modifying arguments as necessary.&lt;/P&gt;

&lt;P&gt;Even if you are able to compile a source file to an object file without specifying /Qmkl, the linking will fail unless you explicitly list the MKL libraries in the link command line.&lt;/P&gt;

&lt;P&gt;Using the Windows ifort compiler with the incorrect /mkl option generates an error message, which you should not ignore:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ifort: command line warning #10006: ignoring unknown option '/mkl'&lt;/PRE&gt;

&lt;P&gt;You will probably benefit from consulting the MKL documentation when such questions occur.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Dec 2017 17:08:00 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2017-12-30T17:08:00Z</dc:date>
    <item>
      <title>Is include necessary in compilation option?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177950#M29126</link>
      <description>&lt;P&gt;Dear forum users,&lt;/P&gt;

&lt;P&gt;I have a confusion about compilation option.&lt;/P&gt;

&lt;P&gt;In MKL&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;Link Line Advisor, If I select intel fortran, the compilation option always contains&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:;"&gt; -I${MKLROOT}/include&lt;/PRE&gt;

&lt;P&gt;and if I also select&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;BLAS95 and LAPACK95, compilation option has one more term&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:;"&gt; -I${MKLROOT}/include/intel64/lp64&lt;/PRE&gt;

&lt;P&gt;I done a test in my makefile, and I found that if I don't add these include folder in my compilation option, but just adding '-mkl' or '&lt;SPAN style="font-size: 13.008px;"&gt;-lmkl_intel_lp64 -lmkl_sequential -lmkl_core"&amp;nbsp;&lt;/SPAN&gt;in my linking option. The program also generated correctly.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So I got serious confusion. It seems that "-I" is not necessary? Why link advisor always suggest "-I" in compilation option? What does "-I" really do in the compilation process? Why neglect "-I" still work?&lt;/P&gt;

&lt;P&gt;best regards&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 07:08:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177950#M29126</guid>
      <dc:creator>balabi_b_</dc:creator>
      <dc:date>2017-12-28T07:08:16Z</dc:date>
    </item>
    <item>
      <title>The -I option to a compiler</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177951#M29127</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;-I&lt;/STRONG&gt; option to a compiler specifies additional directories to be searched. If these directories are already included by other means, such as by using an option such as &lt;STRONG&gt;-mkl&lt;/STRONG&gt;, usually no harm is done. However, sometimes the order in which directories are searched may affect the compilation. In these cases, include files in different directories can define preprocessor macros differently, so having the directories searched in the intended order is important. On the other hand, if a needed directory is not specified, the compilation can fail (and usually does so).&lt;/P&gt;

&lt;P&gt;Similar comments apply to the directories specified after the &lt;STRONG&gt;-L&lt;/STRONG&gt; option. The issues with the &lt;STRONG&gt;-I&lt;/STRONG&gt; option are minor when MKL is used from Fortran rather than from C, C++ and C#, since Fortran favors using modules for such purposes.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 12:46:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177951#M29127</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-12-28T12:46:55Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177952#M29128</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;The &lt;STRONG&gt;-I&lt;/STRONG&gt; option to a compiler specifies additional directories to be searched. If these directories are already included by other means, such as by using an option such as &lt;STRONG&gt;-mkl&lt;/STRONG&gt;, usually no harm is done. However, sometimes the order in which directories are searched may affect the compilation. In these cases, include files in different directories can define preprocessor macros differently, so having the directories searched in the intended order is important. On the other hand, if a needed directory is not specified, the compilation can fail (and usually does so).&lt;/P&gt;

&lt;P&gt;Similar comments apply to the directories specified after the &lt;STRONG&gt;-L&lt;/STRONG&gt; option. The issues with the &lt;STRONG&gt;-I&lt;/STRONG&gt; option are minor when MKL is used from Fortran rather than from C, C++ and C#, since Fortran favors using modules for such purposes.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Hi,&amp;nbsp;mecej4. Thank you so much.&lt;/P&gt;

&lt;P&gt;I found I made a mistake. Specifying -mkl only in link option works for linux but not windows. I check out the document about '-mkl' option, it says&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;On Windows* OS, this option adds directives to the compiled code, which the linker then reads without further input from the driver. On Linux* OS and OS X, the driver must add the library names explicitly to the link command.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I don't quite understand what is the driver here?&lt;/P&gt;

&lt;P&gt;I also tested two cases on windows&lt;/P&gt;

&lt;P&gt;case 0:&lt;/P&gt;

&lt;PRE class="brush:bash;" style="font-size: 13.008px;"&gt;ifort /c /mkl /I"%MKLROOT%"\include *90
ifort /mkl *obj&lt;/PRE&gt;

&lt;P&gt;case 1:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ifort /c /I"%MKLROOT%"\include *90
ifort /mkl *obj&lt;/PRE&gt;

&lt;P&gt;will have "&lt;SPAN style="font-size: 13.008px;"&gt;unresolved external symbol"&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;case 2:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ifort /c /I"%MKLROOT%"\include *90
ifort mkl_intel_lp64_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib *obj&lt;/PRE&gt;

&lt;P&gt;works.&lt;/P&gt;

&lt;P&gt;So I don't understand. Does /I option write directory info into object files? And if so, why case 1 doesn't work? What is the difference between objects in case 0 and case 1?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2017 16:18:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177952#M29128</guid>
      <dc:creator>balabi_b_</dc:creator>
      <dc:date>2017-12-30T16:18:24Z</dc:date>
    </item>
    <item>
      <title>Many options (such as /Qmkl</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177953#M29129</link>
      <description>&lt;P&gt;Many options (such as /Qmkl vs. -mkl) are spelled differently in the Windows and Linux versions of the Intel Fortran compiler. The command that users commonly use (ifort.exe or ifort) is the driver program. It simply drives the compiler proper(fortcom.exe or fortcom) and linker (link.exe or ld), translating and modifying arguments as necessary.&lt;/P&gt;

&lt;P&gt;Even if you are able to compile a source file to an object file without specifying /Qmkl, the linking will fail unless you explicitly list the MKL libraries in the link command line.&lt;/P&gt;

&lt;P&gt;Using the Windows ifort compiler with the incorrect /mkl option generates an error message, which you should not ignore:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ifort: command line warning #10006: ignoring unknown option '/mkl'&lt;/PRE&gt;

&lt;P&gt;You will probably benefit from consulting the MKL documentation when such questions occur.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Dec 2017 17:08:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177953#M29129</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-12-30T17:08:00Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177954#M29130</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Many options (such as /Qmkl vs. -mkl) are spelled differently in the Windows and Linux versions of the Intel Fortran compiler. ...&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thank you so much,&amp;nbsp;mecej4.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Sorry for my typo, I acutally means /Qmkl. It is typo in my previous reply.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I just tried case 4 on windows&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ifort /c *90
ifort mkl_intel_lp64_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib *obj&lt;/PRE&gt;

&lt;P&gt;it works.&lt;/P&gt;

&lt;P&gt;But why "ifort /Qmkl *obj" doesn't work?&amp;nbsp;&lt;SPAN style="font-size: 1em;"&gt;So I still don't understand, what is "/Qmkl" exactly equivalent to ? I search the MKL documentation, there is no detailed information about what lib that&amp;nbsp; "/Qmkl" or "-mkl" link to.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;What is more, I still need a definite answer on whether "ifort /c&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px;"&gt;/I"%MKLROOT%"\include" adds some directory info embedded into object files. I tried to compare object files bit by bit, but it seems that even the same makefile will generate different obj content each time.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Dec 2017 04:31:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177954#M29130</guid>
      <dc:creator>balabi_b_</dc:creator>
      <dc:date>2017-12-31T04:31:02Z</dc:date>
    </item>
    <item>
      <title>If your Fortran code does not</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177955#M29131</link>
      <description>&lt;P&gt;If your Fortran code does not require interfaces to the MKL routines that it calls, and does not use any of the types that are defined in the MKL include files (such as MKL_INT), you do not need /Qmkl.&lt;/P&gt;

&lt;P&gt;The compiler may include information on the date of creation, source file path, etc., into the OBJ file to aid the VS symbolic debugger. Similarly, it may insert &lt;STRONG&gt;includelib&lt;/STRONG&gt; directives into the OBJ files to help the linker. See&amp;nbsp;https://docs.microsoft.com/en-us/cpp/assembler/masm/includelib-masm.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Please note that such internal details of how a compiler operates are often undocumented and may be changed without notice, so it may not be worthwhile to depend on these details.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Dec 2017 10:48:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-include-necessary-in-compilation-option/m-p/1177955#M29131</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-12-31T10:48:49Z</dc:date>
    </item>
  </channel>
</rss>

