<?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: Re:Linking fftw interfaces using CMake in Visual Studio Code in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-fftw-interfaces-using-CMake-in-Visual-Studio-Code/m-p/1643503#M36646</link>
    <description>&lt;P&gt;Thanks for your reply! I really missed that this is fftw2.0 functions. I also changed my include to #include &amp;lt;fftw/fftw3.h&amp;gt; and now everything works fine. I also dont need to use&amp;nbsp;&lt;SPAN&gt;target_link_libraries() in CMakeLists.txt&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 16:01:12 GMT</pubDate>
    <dc:creator>phoenixSeven</dc:creator>
    <dc:date>2024-11-15T16:01:12Z</dc:date>
    <item>
      <title>Linking fftw interfaces using CMake in Visual Studio Code</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-fftw-interfaces-using-CMake-in-Visual-Studio-Code/m-p/1641094#M36597</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone. I want to use the FFTW interface provided by Intel oneAPI (MKL). I have pre-created the library&amp;nbsp;&lt;/SPAN&gt;fftw3xc_intel.lib&lt;SPAN&gt;&amp;nbsp;using the command "&lt;/SPAN&gt;nmake libintel64"&lt;SPAN&gt;&amp;nbsp;in the command line with initialized oneAPI environment (using&amp;nbsp;&lt;/SPAN&gt;setvars.bat&lt;SPAN&gt;). Now I want to use the generated library in my project. However, it seems that generated *.lib file is not recognized by the project, and I get following errors during the linking stage:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;main.cpp.obj : error LNK2019: unresolved external symbol fftw_create_plan in function main.
main.cpp.obj : error LNK2019: unresolved external symbol fftw_one in function main.&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The build commands I am using in the VS Code Terminal:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;/build&amp;gt; cmake .. -G "Ninja"
/build&amp;gt; ninja&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Here is my main.cpp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;fftw/fftw.h&amp;gt;

#define N 100

int main(){

    fftw_complex *in  = (fftw_complex *)fftw_malloc(N);
    fftw_complex *out = (fftw_complex *)fftw_malloc(N);
    fftw_plan a = fftw_create_plan(N, FFTW_FORWARD, FFTW_ESTIMATE);
    fftw_one(a, in, out);


    fftw_destroy_plan(a);
    fftw_free(in); fftw_free(out);
    return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Here is my CMakeLists.txt&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;cmake_minimum_required( VERSION 3.18 )


project(FFTW_TEST LANGUAGES CXX)

find_package( MKL REQUIRED )

add_executable( test main.cpp )

target_link_libraries( test MKL::MKL )
target_link_libraries( test "C:/Program Files (x86)/Intel/oneAPI/mkl/2025.0/share/mkl/interfaces/fftw3xc/fftw3xc_intel.lib" )

# target_link_directories( test PRIVATE "C:/Program Files (x86)/Intel/oneAPI/mkl/2025.0/share/mkl/interfaces/fftw3xc")
# target_link_libraries( test fftw3xc_intel )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong or missing?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 14:48:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-fftw-interfaces-using-CMake-in-Visual-Studio-Code/m-p/1641094#M36597</guid>
      <dc:creator>phoenixSeven</dc:creator>
      <dc:date>2024-11-04T14:48:29Z</dc:date>
    </item>
    <item>
      <title>Re:Linking fftw interfaces using CMake in Visual Studio Code</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-fftw-interfaces-using-CMake-in-Visual-Studio-Code/m-p/1642708#M36630</link>
      <description>&lt;P&gt;The problem you're facing may be caused by the fact that the functions fftw_create_plan_plan and fftw_one are not in the fftw3xc_intel.lib library, but they are in the older version of the library - fftw2xc_intel.lib. (For more information about the difference between fftw2 and fftw3 please refer to &lt;A href="https://www.fftw.org/doc/Upgrading-from-FFTW-version-2.html" target="_blank"&gt;https://www.fftw.org/doc/Upgrading-from-FFTW-version-2.html&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try to use fftx2xc instead, but note that the fftw2xc library builds in a different directory, that is in CMakeLists.txt you should also change from&lt;/P&gt;&lt;P&gt;target_link_libraries( test "C:/Program Files (x86)/Intel/oneAPI/mkl/2025.0/share/mkl/interfaces/fftw3xc/fftw3xc_intel.lib" )&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;target_link_libraries( test "C:/Program Files (x86)/Intel/oneAPI/mkl/2025.0/lib/fftw2xc_double_intel.lib")&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Nov 2024 10:26:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-fftw-interfaces-using-CMake-in-Visual-Studio-Code/m-p/1642708#M36630</guid>
      <dc:creator>Aleksandra_K</dc:creator>
      <dc:date>2024-11-13T10:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Linking fftw interfaces using CMake in Visual Studio Code</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-fftw-interfaces-using-CMake-in-Visual-Studio-Code/m-p/1643503#M36646</link>
      <description>&lt;P&gt;Thanks for your reply! I really missed that this is fftw2.0 functions. I also changed my include to #include &amp;lt;fftw/fftw3.h&amp;gt; and now everything works fine. I also dont need to use&amp;nbsp;&lt;SPAN&gt;target_link_libraries() in CMakeLists.txt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 16:01:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-fftw-interfaces-using-CMake-in-Visual-Studio-Code/m-p/1643503#M36646</guid>
      <dc:creator>phoenixSeven</dc:creator>
      <dc:date>2024-11-15T16:01:12Z</dc:date>
    </item>
  </channel>
</rss>

