Repository navigation
Accept the DPClang compiler ID of CMake 4.5 in IntelSYCLConfig.cmake - #3216
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. The vendored `IntelSYCLConfig.cmake` accepted only `Clang` and `IntelLLVM`, so configuring dpnp with the open source DPC++ and CMake 4.5 failed with "Intel SYCL Compiler not found". Both of its compiler-ID checks now accept `DPClang` too. Nothing else in the build depends on the ID: with CMake 4.5.1 every compile and link command of dpnp, its extensions and oneMath is the same as with CMake 4.4.5.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the DPClang compatibility update.
No open issues 🎉
What changed in this PR
Updates dpnp’s vendored SYCL CMake configuration to accept DPClang, the compiler ID used by CMake 4.5+ for open-source DPC++ 7.0+, preventing configuration failures.
Changes:
- Accepts
DPClangin both compiler validation and SYCL flag selection, preservingClangandIntelLLVMsupport. - Documents the build compatibility fix in the changelog.
| File | Description |
|---|---|
dpnp/backend/cmake/Modules/IntelSYCLConfig.cmake |
Recognizes DPClang and enables its -fsycl compile and link flags. |
CHANGELOG.md |
Records support for building with open-source DPC++ and CMake 4.5+. |
Review effort: Balanced
|
The failing |
|
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
|
Array API standard conformance tests for dpnp=0.22.0dev3=np2py314h8d9cdd5_69 ran successfully. |
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
LGTM
Thank you @antonwolfy for accepting the DPClang compiler ID of CMake 4.5
…ke` (#3216) 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 icpx, which defines `__INTEL_LLVM_COMPILER`. There is no policy to get the old `Clang` ID back. The vendored `dpnp/backend/cmake/Modules/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 dpnp/backend/cmake/Modules/IntelSYCLConfig.cmake:144 (message): Intel SYCL Compiler not found. ``` 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`. The version parsing needs no change, as `--version` still prints `clang version 24.0.0git` after the new `DPC++ compiler 7.2.0` line. The oneAPI 2026.3.0 compiler package ships the same module unchanged from 2026.2.0, so it doesn't support `DPClang` either. Nothing else in the build depends on the ID: dpnp's own CMake files don't check it, MKL, TBB and oneDPL come with their own config files, and no C++ code sees it. Built locally with the nightly of 2026-11-30 and `--onemath`: - With CMake 4.5.1 and this change, the generated `build.ninja` has every compile and link command of dpnp, its extensions and oneMath the same as with CMake 4.4.5; the only differences are CMake's own (version header, new phony targets, its `DPClang` modules among the regeneration inputs). Build warnings are the same too. - `dpnp/tests` on the OpenCL CPU device: 97370 passed, 7190 skipped and 3 xfailed, as with CMake 4.4.5. - Without this change, CMake 4.5.1 fails at the configure step as shown above. The `Build with Open Source LLVM SYCL compiler` job can't show this yet: dpctl, which the job builds from source first, has its own `IntelSYCLConfig.cmake` with the same check and needs the same two lines (the local build used them). Until then: - With CMake 4.5.1, which the job installs on master today, it fails at the `Build and install dpctl` step, before dpnp is built. - #3215 pins the job to CMake 4.4.5, which still says `Clang`. Once dpctl accepts `DPClang`, the Dependabot PR that moves the pin to CMake 4.5 runs this code in CI. #3163 moves `dpnp/backend/cmake/Modules/` to `cmake/Modules/`; whichever of the two merges second has to carry the two lines to the moved file.
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 icpx, which defines__INTEL_LLVM_COMPILER. There is no policy to get the oldClangID back.The vendored
dpnp/backend/cmake/Modules/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. The version parsing needs no change, as--versionstill printsclang version 24.0.0gitafter the newDPC++ compiler 7.2.0line. The oneAPI 2026.3.0 compiler package ships the same module unchanged from 2026.2.0, so it doesn't supportDPClangeither.Nothing else in the build depends on the ID: dpnp's own CMake files don't check it, MKL, TBB and oneDPL come with their own config files, and no C++ code sees it. Built locally with the nightly of 2026-11-30 and
--onemath:build.ninjahas every compile and link command of dpnp, its extensions and oneMath the same as with CMake 4.4.5; the only differences are CMake's own (version header, new phony targets, itsDPClangmodules among the regeneration inputs). Build warnings are the same too.dpnp/testson the OpenCL CPU device: 97370 passed, 7190 skipped and 3 xfailed, as with CMake 4.4.5.The
Build with Open Source LLVM SYCL compilerjob can't show this yet: dpctl, which the job builds from source first, has its ownIntelSYCLConfig.cmakewith the same check and needs the same two lines (the local build used them). Until then:Build and install dpctlstep, before dpnp is built.Clang. Once dpctl acceptsDPClang, the Dependabot PR that moves the pin to CMake 4.5 runs this code in CI.#3163 moves
dpnp/backend/cmake/Modules/tocmake/Modules/; whichever of the two merges second has to carry the two lines to the moved file.