<?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:Difficulty using MKL in VSCode in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difficulty-using-MKL-in-VSCode/m-p/1539391#M35424</link>
    <description>&lt;P&gt;Hi Fio,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for posting in Intel communities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We regret to say that we will not be able to support you on this R related query. We are not “R” experts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you have any query on Intel products, then please raise a new thread in the appropriate forum and we’d be happy to support you. Thank you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jilani&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 01 Nov 2023 10:45:12 GMT</pubDate>
    <dc:creator>JilaniS_Intel</dc:creator>
    <dc:date>2023-11-01T10:45:12Z</dc:date>
    <item>
      <title>Difficulty using MKL in VSCode</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difficulty-using-MKL-in-VSCode/m-p/1537888#M35423</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm encountering an issue while trying to use Intel Math Kernel Library (MKL) in my C++ project within Visual Studio Code (VSCode).&lt;/P&gt;&lt;P&gt;I have successfully installed Base Toolkit on my windows system, and I'm using the "C/C++ IntelliSense, debugging, and code browsing" extension for VSCode.&lt;/P&gt;&lt;P&gt;The mkl_example.cpp is given below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;Rcpp.h&amp;gt;
#include &amp;lt;mkl.h&amp;gt;
using namespace Rcpp;
// Define the example function
// [[Rcpp::export]]
List example(Rcpp::NumericVector para) {
  int n = para.size();
  NumericVector result(n); 
  // Get a pointer to the data of the NumericVector
  const double* para_ptr = para.begin();
  // Perform the element-wise addition
  vdAdd(n, para_ptr, para_ptr, result.begin());
  return List::create(_["result"] = result);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "c_cpp_properties.json" file contains the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/Users/user/AppData/Local/R/win-library/4.3/Rcpp/include",
                "C:/PROGRA~1/R/R-43~1.1/include",
                "C:/Program Files (x86)/Intel/oneAPI/mkl/latest/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\mingw64\\bin\\gcc.exe",
            "cStandard": "c17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "windows-gcc-x64"
        }
    ],
    "version": 4
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I run the following commands:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;library(Rcpp)
cpp_file &amp;lt;- "C:/Users/user/OneDrive/Documents/VariousCodes/mkl/mkl_example.cpp"
sourceCpp(cpp_file)
# Create a numeric vector
input_vector &amp;lt;- c(1, 2, 3, 4, 5)
# Call the C++ function
result &amp;lt;- example(input_vector)
# 'result' now contains the element-wise addition of 'input_vector'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and get the flowing output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;gt; source("c:\\Users\\user\\OneDrive\\Documents\\VariousCodes\\$
using C++ compiler: 'G__~1.EXE (GCC) 12.2.0'
g++ -std=gnu++17  -I"C:/PROGRA~1/R/R-43~1.1/include" -DNDEBUG   -I"C:/Users/user/AppData/Local/R/win-library/4.3/Rcpp/include" -I"C:/Users/user/OneDrive/Documents/VariousCodes/mkl"   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"     -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c mkl.cpp -o mkl.o
g++ -std=gnu++17 -shared -s -static-libgcc -o sourceCpp_2.dll tmp.def mkl.o -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-43~1.1/bin/x64 -lR
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: mkl.o:mkl.cpp:(.text+0x3ea): undefined reference to `vdAdd'
collect2.exe: error: ld returned 1 exit status
Error in sourceCpp(cpp_file) : Error occurred building shared library.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that i have&amp;nbsp;&lt;SPAN&gt;included the directory for the Intel oneAPI Math Kernel Library (MKL). In the system environment variables, you have added the following entries to the "Path."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\compiler\lib\intel64
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\compiler\lib\intel64_win
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\compiler\lib\ia32
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\compiler\lib\ia32_win
C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc_mt\
C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\ia32\vc_mt\
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\ia32_win\compiler
C:\Program Files (x86)\Intel\oneAPI\compiler\2023.2.1\windows\bin&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any help.&lt;/P&gt;&lt;P&gt;FL&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 07:58:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difficulty-using-MKL-in-VSCode/m-p/1537888#M35423</guid>
      <dc:creator>F_L</dc:creator>
      <dc:date>2023-10-27T07:58:29Z</dc:date>
    </item>
    <item>
      <title>Re:Difficulty using MKL in VSCode</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difficulty-using-MKL-in-VSCode/m-p/1539391#M35424</link>
      <description>&lt;P&gt;Hi Fio,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for posting in Intel communities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We regret to say that we will not be able to support you on this R related query. We are not “R” experts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you have any query on Intel products, then please raise a new thread in the appropriate forum and we’d be happy to support you. Thank you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jilani&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Nov 2023 10:45:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Difficulty-using-MKL-in-VSCode/m-p/1539391#M35424</guid>
      <dc:creator>JilaniS_Intel</dc:creator>
      <dc:date>2023-11-01T10:45:12Z</dc:date>
    </item>
  </channel>
</rss>

