<?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: IntelSYCLConfig.cmake fails on Windows in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/IntelSYCLConfig-cmake-fails-on-Windows/m-p/1679998#M4392</link>
    <description>&lt;P&gt;There is a known issue when compiling SYCL code on Windows using CMake with the latest 2025.1 version of the compiler which can cause errors like&lt;/P&gt;
&lt;P&gt;CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Could NOT find IntelSYCL (missing: SYCL_LIBRARY)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reason given by package: SYCL: It appears that the C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/icx.exe does not support SYCL&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Workaround: &lt;/STRONG&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\lib\cmake\IntelSYCL\IntelSYCLConfig.cmake file needs to be updated with the following two changes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Line 332: Update set(sycl_lib_suffix "7") with set(sycl_lib_suffix "8")&lt;/LI&gt;
&lt;LI&gt;Line 365: Replace set(SYCL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYCL_FLAGS}") with&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;list(JOIN SYCL_FLAGS " " SYCL_FLAGS_STRING)&lt;/P&gt;
&lt;P&gt;message(DEBUG "SYCL_FLAGS_STRING: ${SYCL_FLAGS_STRING}")&lt;/P&gt;
&lt;P&gt;set(SYCL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYCL_FLAGS_STRING}")&lt;/P&gt;
&lt;P&gt;A fix for this issue will be available in an upcoming compiler release.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Apr 2025 21:43:40 GMT</pubDate>
    <dc:creator>Sravani_K_Intel</dc:creator>
    <dc:date>2025-04-02T21:43:40Z</dc:date>
    <item>
      <title>IntelSYCLConfig.cmake fails on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/IntelSYCLConfig-cmake-fails-on-Windows/m-p/1679888#M4390</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I installed the oneAPI Base Toolkit 2025.1, and I am using it with CMake on Windows 11.&lt;/P&gt;&lt;P&gt;In the CMake file, I use the IntelSYCLConfig.cmake via:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;find_package(IntelSYCL CONFIG REQUIRED)&lt;/LI-CODE&gt;&lt;P&gt;This currently fails like this:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;-- The CXX compiler identification is IntelLLVM 2025.1.0 with MSVC-like command-line
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/icx.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2025.1.0 Build 20250317
Copyright (C) 1985-2025 Intel Corporation. All rights reserved.

-- SYCL Compiler version: 20250100
-- SYCL_INCLUDE_DIR: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/include
-- SYCL_LIBRARY=SYCL_LIBRARY-NOTFOUND
CMake Error at C:/Program Files (x86)/Intel/oneAPI/compiler/latest/lib/cmake/IntelSYCL/IntelSYCLConfig.cmake:223 (separate_arguments):
  separate_arguments given unexpected argument(s)
Call Stack (most recent call first):
  C:/Program Files (x86)/Intel/oneAPI/compiler/latest/lib/cmake/IntelSYCL/IntelSYCLConfig.cmake:380 (SYCL_FEATURE_TEST_BUILD)
  CMakeLists.txt:5 (find_package)


CMake Error at C:/Program Files (x86)/Intel/oneAPI/compiler/latest/lib/cmake/IntelSYCL/IntelSYCLConfig.cmake:386 (SYCL_FEATURE_TEST_EXTRACT):
  SYCL_FEATURE_TEST_EXTRACT Function invoked with incorrect arguments for
  function named: SYCL_FEATURE_TEST_EXTRACT
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)


CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find IntelSYCL (missing: SYCL_LIBRARY)

      Reason given by package: SYCL: It appears that the C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/icx.exe does not support SYCL

Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/Intel/oneAPI/compiler/latest/lib/cmake/IntelSYCL/IntelSYCLConfig.cmake:422 (find_package_handle_standard_args)
  CMakeLists.txt:5 (find_package)


CMake Error at CMakeLists.txt:5 (find_package):
  Found package configuration file:

    C:/Program Files (x86)/Intel/oneAPI/compiler/latest/lib/cmake/IntelSYCL/IntelSYCLConfig.cmake

  but it set IntelSYCL_FOUND to FALSE so package "IntelSYCL" is considered to
  be NOT FOUND.  Reason given by package:

  SYCL: It appears that the C:/Program Files
  (x86)/Intel/oneAPI/compiler/latest/bin/icx.exe does not support SYCL



-- Configuring incomplete, errors occurred!
PS E:\cpp\sycl_test&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;I debugged this to C:\Program Files (x86)\Intel\oneAPI\compiler\latest\lib\cmake\IntelSYCL\IntelSYCLConfig.cmake:332&lt;/P&gt;&lt;P&gt;Lines 330-333 look like this:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;#TODO by default use sycl7 for windows
if(WIN32)
  set(sycl_lib_suffix "7")
else()&lt;/LI-CODE&gt;&lt;P&gt;The problem is that it is looking for sycl7. However, for me, I can only find sycl.lib or sycl8.lib:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;&amp;gt; ls 'C:/Program Files (x86)/Intel/oneAPI/compiler/latest/lib/sycl*'

    Directory: C:\Program Files (x86)\Intel\oneAPI\compiler\latest\lib

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          17.03.2025    20:45        3352918 sycl-devicelib-host.lib
-a---          17.03.2025    20:45        3352942 sycl-devicelib-host.new.lib
-a---          17.03.2025    20:45        2032372 sycl-preview.lib
-a---          17.03.2025    20:45        2036640 sycl-previewd.lib
-a---          17.03.2025    20:45        2016022 sycl.lib
-a---          17.03.2025    20:45        2032372 sycl8-preview.lib
-a---          17.03.2025    20:45        2036640 sycl8-previewd.lib
-a---          17.03.2025    20:45        2016022 sycl8.lib
-a---          17.03.2025    20:45        2020306 sycl8d.lib
-a---          17.03.2025    20:45        2020306 sycld.lib&lt;/LI-CODE&gt;&lt;P&gt;Either remove the default sycl_lib_suffix completely, or also look for version 8 and other future versions. So you don't need to constantly update IntelSYCLConfig.cmake.&lt;/P&gt;&lt;P&gt;Locally, I fixed this by doing the following before the find_package call:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;set(SYCL_LIB_SUFFIX "8")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another problem is that on line 362 you are appending another SYCL_FLAG to a list:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;# TODO verify if this is needed
# Windows: Add Exception handling
if(WIN32)
  list(APPEND SYCL_FLAGS "/EHsc")
endif()&lt;/LI-CODE&gt;&lt;P&gt;This later breaks the separate_arguments on line 223.&lt;/P&gt;&lt;P&gt;You need to convert the list to a command line before line 223. I fixed this locally by inserting the following before line 223:&lt;/P&gt;&lt;LI-CODE lang="none"&gt;string(REPLACE ";" " " SYCL_CXX_FLAGS_LIST "${SYCL_CXX_FLAGS_LIST}")&lt;/LI-CODE&gt;&lt;P&gt;I have attached the partially fixed IntelSYCLConfig.cmake&lt;/P&gt;&lt;P&gt;But I don't know if that is the best way to do this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 12:38:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/IntelSYCLConfig-cmake-fails-on-Windows/m-p/1679888#M4390</guid>
      <dc:creator>cwasser</dc:creator>
      <dc:date>2025-04-02T12:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: IntelSYCLConfig.cmake fails on Windows</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/IntelSYCLConfig-cmake-fails-on-Windows/m-p/1679998#M4392</link>
      <description>&lt;P&gt;There is a known issue when compiling SYCL code on Windows using CMake with the latest 2025.1 version of the compiler which can cause errors like&lt;/P&gt;
&lt;P&gt;CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Could NOT find IntelSYCL (missing: SYCL_LIBRARY)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reason given by package: SYCL: It appears that the C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/icx.exe does not support SYCL&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Workaround: &lt;/STRONG&gt;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\lib\cmake\IntelSYCL\IntelSYCLConfig.cmake file needs to be updated with the following two changes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Line 332: Update set(sycl_lib_suffix "7") with set(sycl_lib_suffix "8")&lt;/LI&gt;
&lt;LI&gt;Line 365: Replace set(SYCL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYCL_FLAGS}") with&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;list(JOIN SYCL_FLAGS " " SYCL_FLAGS_STRING)&lt;/P&gt;
&lt;P&gt;message(DEBUG "SYCL_FLAGS_STRING: ${SYCL_FLAGS_STRING}")&lt;/P&gt;
&lt;P&gt;set(SYCL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYCL_FLAGS_STRING}")&lt;/P&gt;
&lt;P&gt;A fix for this issue will be available in an upcoming compiler release.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 21:43:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/IntelSYCLConfig-cmake-fails-on-Windows/m-p/1679998#M4392</guid>
      <dc:creator>Sravani_K_Intel</dc:creator>
      <dc:date>2025-04-02T21:43:40Z</dc:date>
    </item>
  </channel>
</rss>

