Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

Cannot use IntelSYCL with CMake

LukeTheWalker
Beginner
257 Views

I seem to be unable to compile intelSYCL in the recommended way using cmake. 

 

The CMakeLists I am using is this one.

 

cmake_minimum_required(VERSION 3.20)
project(SYCLOneMKLProject CXX)

set(CMAKE_C_COMPILER "icx")
set(CMAKE_CXX_COMPILER "icpx")

# Set C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find SYCL and oneMKL packages
find_package(IntelSYCL REQUIRED)
find_package(MKL CONFIG REQUIRED)

# Add executable
add_executable(${PROJECT_NAME} main.cpp)

# Link SYCL and oneMKL libraries
target_link_libraries(${PROJECT_NAME}
PRIVATE
Intel::DPCPP
MKL::MKL
)

# Optional: Add include directories if needed
target_include_directories(${PROJECT_NAME}
PRIVATE
${ONEAPI_ROOT}/mkl/latest/include)

 

 
But I still keep getting the error:

 

CMake Error at CMakeLists.txt:12 (find_package):
Found package configuration file:

/home/luca/intel/oneapi/compiler/2025.0/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:

Unsupported compiler family GNU and compiler icpx!!​

 

Even though I already sourced the setvars script

 

0 Kudos
1 Reply
Sravani_K_Intel
Moderator
91 Views

Hi @LukeTheWalker

 

The minimum CMake version required for IntelSYCL is 3.23.5 on Linux and 3.25 on Windows. 

Are you using one of these or a more recent version and still running into this issue?

0 Kudos
Reply