Skip to content

Accept the DPClang compiler ID of CMake 4.5 - #2433

Merged
ndgrigorian merged 2 commits into
masterfrom
support-cmake-dpclang
Dec 2, 2026
Merged

ndgrigorian merged 2 commits into
masterfrom
support-cmake-dpclang

Conversation

@antonwolfy

Copy link
Copy Markdown
Collaborator

CMake 4.5 identifies the open source DPC++ compiler by a new compiler ID. Its release notes say: "The open-source DPC++ compiler, version 7.0 and newer, is now supported with compiler id DPClang for languages C and CXX". CMake recognizes it by the __DPCPP__ and __dpcpp_major__ macros that the compiler defines since its 7.0 release, and keeps IntelLLVM for icx and icpx, which define __INTEL_LLVM_COMPILER. There is no policy to get the old Clang ID back.

cmake/IntelSYCLConfig.cmake accepts only Clang and IntelLLVM, so with the open source DPC++ and CMake 4.5 the configure step fails:

-- The CXX compiler identification is DPClang 7.2.0
CMake Error at CMakeLists.txt:61 (find_package):
  Found package configuration file:

    .../dpctl/cmake/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 DPClang and compiler
  .../dpcpp_compiler/bin/clang++!!

This PR adds DPClang to both compiler-ID checks of the module: the one that decides whether the compiler supports SYCL, and the one that adds -fsycl.

On Windows CMake 4.5 identifies clang-cl of the open source DPC++ as DPClang too, with the MSVC-like command line, and its Platform/Windows-DPClang.cmake reuses the Windows-Clang rules. The three checks for clang-cl would then stop matching without an error: dpctl/CMakeLists.txt and libsyclinterface/CMakeLists.txt would pass -Wall, which clang-cl reads as -Weverything, and cmake/WindowsClangClLinkRules.cmake would no longer link through the compiler driver, so link options such as -fsycl would not reach it. They now match ^(Clang|DPClang)$, as CMake's own modules do.

Builds with icx and icpx are not affected, since CMake 4.5 still identifies them as IntelLLVM.

Testing:

  • Linux, built locally with the nightly of 2026-11-30 and CMake 4.5.1: with the IntelSYCLConfig.cmake change, dpctl configures and builds, and dpnp built on top of it passes dpnp/tests on the OpenCL CPU device. Without it, the configure step fails as shown above.
  • Windows was not tested locally. Both Build with nightly build of DPC++ toolchain jobs install the latest CMake from PyPI, which has been 4.5.1 since 2026-12-01, so this PR's CI runs the change on Linux and Windows.

dpnp vendors its own copy of IntelSYCLConfig.cmake with the same check and gets the same change. Its open source DPC++ job builds dpctl from source, so it also needs this PR.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

CMake 4.5 identifies the open source DPC++ compiler, version 7.0 and newer, by the new compiler ID `DPClang` instead of `Clang`, with no policy to keep the old one. On Linux, `IntelSYCLConfig.cmake` accepted only `Clang` and `IntelLLVM`, so configuring dpctl with the open source DPC++ and CMake 4.5 failed with "Unsupported compiler family DPClang". Both of its compiler-ID checks now accept `DPClang` too.

On Windows CMake 4.5 identifies clang-cl of the open source DPC++ as `DPClang` with the MSVC-like command line and reuses the Clang platform rules for it. The checks that pick `/W3` over `-Wall` for clang-cl and link clang-cl targets through the compiler driver now match `DPClang` as well.
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 75.173%. remained the same — support-cmake-dpclang into master

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the DPClang compatibility update.

No open issues 🎉

What changed in this PR

Updates dpctl’s CMake configuration to accept the DPClang compiler ID introduced in CMake 4.5 for open-source DPC++, while leaving IntelLLVM handling unchanged.

Changes:

  • Accepts DPClang for SYCL compiler detection and -fsycl compile/link flags.
  • Extends Windows warning and compiler-driver linking rules to DPClang.
  • Documents the build compatibility fix in the changelog.
File Description
libsyclinterface/​CMakeLists.txt Applies the Windows /W3 warning setting to DPClang.
dpctl/​CMakeLists.txt Applies the Windows /W3 warning setting to DPClang.
cmake/​WindowsClangClLinkRules.cmake Includes MSVC-style DPClang in compiler-driver linking rules.
cmake/​IntelSYCLConfig.cmake Accepts DPClang and enables SYCL compile/link flags.
CHANGELOG.md Records compatibility with the new compiler ID.

Review effort: Balanced

@ndgrigorian ndgrigorian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS compiler on Windows is still failing but it's for unrelated reason, this LGTM

@ndgrigorian
ndgrigorian merged commit 4e07965 into master Dec 2, 2026
47 of 62 checks passed
@ndgrigorian
ndgrigorian deleted the support-cmake-dpclang branch December 4, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants