Repository navigation
Accept the DPClang compiler ID of CMake 4.5 - #2433
Merged
Merged
Conversation
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.
antonwolfy
requested review from
ndgrigorian and
vlad-perevezentsev
as code owners
December 1, 2026 12:07
4 of 7 tasks
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
Collaborator
There was a problem hiding this comment.
🟢 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
DPClangfor SYCL compiler detection and-fsyclcompile/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
approved these changes
Dec 1, 2026
ndgrigorian
left a comment
Collaborator
There was a problem hiding this comment.
OS compiler on Windows is still failing but it's for unrelated reason, this LGTM
2 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 keepsIntelLLVMfor icx and icpx, which define__INTEL_LLVM_COMPILER. There is no policy to get the oldClangID back.cmake/IntelSYCLConfig.cmakeaccepts onlyClangandIntelLLVM, so with the open source DPC++ and CMake 4.5 the configure step fails:This PR adds
DPClangto 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-clof the open source DPC++ asDPClangtoo, with the MSVC-like command line, and itsPlatform/Windows-DPClang.cmakereuses theWindows-Clangrules. The three checks forclang-clwould then stop matching without an error:dpctl/CMakeLists.txtandlibsyclinterface/CMakeLists.txtwould pass-Wall, whichclang-clreads as-Weverything, andcmake/WindowsClangClLinkRules.cmakewould no longer link through the compiler driver, so link options such as-fsyclwould 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:
IntelSYCLConfig.cmakechange, dpctl configures and builds, and dpnp built on top of it passesdpnp/testson the OpenCL CPU device. Without it, the configure step fails as shown above.Build with nightly build of DPC++ toolchainjobs 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.cmakewith the same check and gets the same change. Its open source DPC++ job builds dpctl from source, so it also needs this PR.