<?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 Re: MKL program compiled with Visual Studio 2022 cannot be executed at the command prompt in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-program-compiled-with-Visual-Studio-2022-cannot-be-executed/m-p/1595502#M36095</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/354872"&gt;@Kaoreen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The message about “mkl_intel_thread.2.dll not found” indicates that the dynamic link library (DLL) required by oneMKL wasn’t found in the system path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Copying the DLL to the same folder as your executable is a good temporary fix, but to ensure that all necessary oneMKL DLLs are available, it’s better to add the directory containing the MKL DLLs to your system’s PATH environment variable. This way, any program that requires these DLLs can find them without having to copy them into the same directory.&amp;nbsp; Please try it. It may fix your other issues too.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2024 03:44:37 GMT</pubDate>
    <dc:creator>Mark_L_Intel</dc:creator>
    <dc:date>2024-05-07T03:44:37Z</dc:date>
    <item>
      <title>MKL program compiled with Visual Studio 2022 cannot be executed at the command prompt</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-program-compiled-with-Visual-Studio-2022-cannot-be-executed/m-p/1593781#M36080</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I got the oneMKL stand-alone version from &lt;A href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html#gs.8oqspn" target="_self"&gt;Intel® oneAPI Math Kernel Library (oneMKL) &lt;/A&gt;&amp;nbsp; and wrote a Windows console application. It works fine from within Visual Studio 2022 and the oneAPI command prompt for Intel64 in Visual Studio 2022.&lt;BR /&gt;However, when I tried to run it from the Windows command prompt, it said "mkl_intel_thread.2.dll not found". So I copied the dll to the folder with the .exe file and ran it, there is no error but it just printed "Hello World!".&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is my program.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;mkl.h&amp;gt;

using namespace std;

#define N 2

int main()
{
	std::cout &amp;lt;&amp;lt; "Hello World!" &amp;lt;&amp;lt; std::endl;

	// 5x + 3y = 9
	// 2x +  y = -1
	double A[N * N], b[N];
	A[0] = 5; A[2] = 3;
	A[1] = 2; A[3] = 1;
	b[0] = 9;
	b[1] = 4;

	int n = N;
	int ipiv = N;
	int lda = N, ldb = N, info;
	dgetrf(&amp;amp;n, &amp;amp;n, A, &amp;amp;lda, &amp;amp;ipiv, &amp;amp;info);

	int nrhs = 1;
	const char trans = 'N';
	dgetrs_(&amp;amp;trans, &amp;amp;n, &amp;amp;nrhs, A, &amp;amp;lda, &amp;amp;ipiv, b, &amp;amp;ldb, &amp;amp;info);

	std::cout &amp;lt;&amp;lt; "x = " &amp;lt;&amp;lt; b[0] &amp;lt;&amp;lt; std::endl;
	std::cout &amp;lt;&amp;lt; "y = " &amp;lt;&amp;lt; b[1] &amp;lt;&amp;lt; std::endl;
	return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;And project properties I set.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Intel Libraries for oneAPI &amp;gt; Intel oneAPI Math Kernel Library(oneMKL)&lt;BR /&gt;Use oneMKL &amp;gt; Parallel&lt;BR /&gt;Use ILP64 interfaces &amp;gt; No&lt;BR /&gt;Use MPI Library &amp;gt; Intel MPI Library&lt;/LI&gt;&lt;LI&gt;VC++ Directories&lt;BR /&gt;Include Directories &amp;gt; C:\Program Files (x86)\Intel\oneAPI\mkl\2024.1\include;&lt;BR /&gt;C:\Program Files (x86)\Intel\oneAPI\mkl\2024.1\include\mkl\intel64&lt;BR /&gt;Library Directories &amp;gt; C:\Program Files (x86)\Intel\oneAPI\compiler\latest\lib&lt;BR /&gt;Executable Directories &amp;gt; C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\bin&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;How do I compile this code in Visual Studio so that I can run the .exe file in the Windows Command Prompt?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 07:44:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-program-compiled-with-Visual-Studio-2022-cannot-be-executed/m-p/1593781#M36080</guid>
      <dc:creator>Kaoreen</dc:creator>
      <dc:date>2024-04-30T07:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: MKL program compiled with Visual Studio 2022 cannot be executed at the command prompt</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-program-compiled-with-Visual-Studio-2022-cannot-be-executed/m-p/1595502#M36095</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/354872"&gt;@Kaoreen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The message about “mkl_intel_thread.2.dll not found” indicates that the dynamic link library (DLL) required by oneMKL wasn’t found in the system path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Copying the DLL to the same folder as your executable is a good temporary fix, but to ensure that all necessary oneMKL DLLs are available, it’s better to add the directory containing the MKL DLLs to your system’s PATH environment variable. This way, any program that requires these DLLs can find them without having to copy them into the same directory.&amp;nbsp; Please try it. It may fix your other issues too.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 03:44:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-program-compiled-with-Visual-Studio-2022-cannot-be-executed/m-p/1595502#M36095</guid>
      <dc:creator>Mark_L_Intel</dc:creator>
      <dc:date>2024-05-07T03:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: MKL program compiled with Visual Studio 2022 cannot be executed at the command prompt</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-program-compiled-with-Visual-Studio-2022-cannot-be-executed/m-p/1595534#M36096</link>
      <description>&lt;P&gt;Thanks for letting me know the solution.&lt;/P&gt;&lt;P&gt;I set "C:\Program Files (x86)\Intel\oneAPI\mkl\2024.1\bin" in the system PATH and removed "mkl_intel_thread.2.dll" from the folder containing the .exe.&lt;/P&gt;&lt;P&gt;The program can now be run in Windows cmd.&lt;BR /&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In fact, this is very simple, but I couldn't notice it because I don't get any errors in Windows cmd.&lt;BR /&gt;You can close this thread now.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 07:17:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-program-compiled-with-Visual-Studio-2022-cannot-be-executed/m-p/1595534#M36096</guid>
      <dc:creator>Kaoreen</dc:creator>
      <dc:date>2024-05-07T07:17:04Z</dc:date>
    </item>
  </channel>
</rss>

