<?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: Error linking against SYCL on Windows (for interfacing with oneMKL) in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-linking-against-SYCL-on-Windows-for-interfacing-with/m-p/1579905#M35916</link>
    <description>&lt;P&gt;It seems like this is a C++ ABI incompatibility between my MinGW-produced objects, and sycl7.dll as compiled with MSVC, as shown above by the different manglings for the make_platform function. I also don't think this is easy to fix, as it's more than the name mangling being incompatible. Although Clang seems to offer some kind of ABI compatibility? &lt;A href="https://clang.llvm.org/docs/MSVCCompatibility.html" target="_blank"&gt;https://clang.llvm.org/docs/MSVCCompatibility.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's too bad oneMKL and other oneAPI libraries don't offer a simple, portable C API like all other vendor libraries do.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 19:51:43 GMT</pubDate>
    <dc:creator>tbesard</dc:creator>
    <dc:date>2024-03-12T19:51:43Z</dc:date>
    <item>
      <title>Error linking against SYCL on Windows (for interfacing with oneMKL)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-linking-against-SYCL-on-Windows-for-interfacing-with/m-p/1579800#M35913</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm working on a C wrapper for oneMKL (for the purpose of using the library from Julia, where we only have a C FFI). The library can be found here: &lt;A href="https://github.com/JuliaGPU/oneAPI.jl/tree/master/deps" target="_blank" rel="noopener"&gt;https://github.com/JuliaGPU/oneAPI.jl/tree/master/deps&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm compiling this library on a Linux buildbot where I pull the necessary oneAPI 2024.0.0 packages from Conda, and link a shared library using my own simple CMake script that relies on the system Clang compiler (because from this cross-build environment I can't execute the Intel compiler):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="none"&gt;add_library(oneapi_support SHARED files...)

target_link_libraries(oneapi_support
mkl_sycl
mkl_intel_ilp64
mkl_sequential
mkl_core
sycl
OpenCL
pi_level_zero
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm redistributing the resulting shared library together with the libraries it needs. This works perfectly, on Linux.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I now want to do the same for native Windows. Now using a MinGW-based environment, I again pull the necessary win-64 packages from Conda, and try to build a shared library. For one, I have to adjust my list of target libraries as things seem to be named differently on Windows (is this expected?):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI-CODE lang="none"&gt;target_link_libraries(oneapi_support
mkl_sycl
mkl_intel_ilp64_dll
mkl_sequential.2
mkl_core.2
sycl7
OpenCL
pi_level_zero
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;However, even then I'm running into a linker error:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="none"&gt;[1/1] Linking CXX shared library liboneapi_support.dll
ninja: job failed: : &amp;amp;&amp;amp; /opt/bin/x86_64-w64-mingw32-libgfortran5-cxx11/x86_64-w64-mingw32-clang++ --sysroot=/opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/ -O2 -g -DNDEBUG -L/workspace/destdir/bin -shared -o liboneapi_support.dll -Wl,--out-implib,liboneapi_support.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles/oneapi_support.dir/src/sycl.cpp.obj CMakeFiles/oneapi_support.dir/src/onemkl.cpp.obj -lmkl_sycl -lmkl_intel_ilp64_dll -lmkl_sequential.2 -lmkl_core.2 -lsycl7 -lOpenCL -lpi_level_zero -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 &amp;amp;&amp;amp; :
ld.lld: error: undefined symbol: __declspec(dllimport) sycl::_V1::ext::oneapi::level_zero::make_platform(unsigned long long)
&amp;gt;&amp;gt;&amp;gt; referenced by /workspace/srcdir/oneAPI.jl/deps/src/sycl.cpp:9
&amp;gt;&amp;gt;&amp;gt; CMakeFiles/oneapi_support.dir/src/sycl.cpp.obj:(syclPlatformCreate)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;This despite &lt;/SPAN&gt;&lt;SPAN&gt;sycl7.dll&lt;/SPAN&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;SPAN&gt;sycl7.lib&lt;/SPAN&gt;&lt;SPAN&gt; being available on the library search path, and containing the symbol that's being listed here:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI-CODE lang="none"&gt;# nm /workspace/destdir/bin/sycl7.lib | grep make_platform
0000000000000000 T ?make_platform@level_zero@oneapi@ext@_V1@sycl@@YA?AVplatform@45@_K@Z
0000000000000000 I __imp_?make_platform@level_zero@oneapi@ext@_V1@sycl@@YA?AVplatform@45@_K@Z&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Using &lt;/SPAN&gt;&lt;SPAN&gt;ld&lt;/SPAN&gt;&lt;SPAN&gt; instead of &lt;/SPAN&gt;&lt;SPAN&gt;ldd&lt;/SPAN&gt;&lt;SPAN&gt; throws a similar error:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI-CODE lang="none"&gt;ld: CMakeFiles/oneapi_support.dir/src/sycl.cpp.obj: in function `syclPlatformCreate':
/workspace/srcdir/oneAPI.jl/deps/src/sycl.cpp:9: undefined reference to `__imp__ZN4sycl3_V13ext6oneapi10level_zero13make_platformEy'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;What am I doing wrong here? The full build script can be found in &lt;A href="https://github.com/JuliaPackaging/Yggdrasil/pull/8285" target="_blank" rel="noopener"&gt;https://github.com/JuliaPackaging/Yggdrasil/pull/8285&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Mar 2024 13:01:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-linking-against-SYCL-on-Windows-for-interfacing-with/m-p/1579800#M35913</guid>
      <dc:creator>tbesard</dc:creator>
      <dc:date>2024-03-12T13:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error linking against SYCL on Windows (for interfacing with oneMKL)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-linking-against-SYCL-on-Windows-for-interfacing-with/m-p/1579905#M35916</link>
      <description>&lt;P&gt;It seems like this is a C++ ABI incompatibility between my MinGW-produced objects, and sycl7.dll as compiled with MSVC, as shown above by the different manglings for the make_platform function. I also don't think this is easy to fix, as it's more than the name mangling being incompatible. Although Clang seems to offer some kind of ABI compatibility? &lt;A href="https://clang.llvm.org/docs/MSVCCompatibility.html" target="_blank"&gt;https://clang.llvm.org/docs/MSVCCompatibility.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's too bad oneMKL and other oneAPI libraries don't offer a simple, portable C API like all other vendor libraries do.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 19:51:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-linking-against-SYCL-on-Windows-for-interfacing-with/m-p/1579905#M35916</guid>
      <dc:creator>tbesard</dc:creator>
      <dc:date>2024-03-12T19:51:43Z</dc:date>
    </item>
  </channel>
</rss>

