Skip to content

Accept the DPClang compiler ID of CMake 4.5 in IntelSYCLConfig.cmake - #3216

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

antonwolfy merged 3 commits into
masterfrom
support-cmake-dpclang

Conversation

@antonwolfy

Copy link
Copy Markdown
Contributor

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:

#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.

  • 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?

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.

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 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 DPClang in both compiler validation and SYCL flag selection, preserving Clang and IntelLLVM support.
  • 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

@antonwolfy

Copy link
Copy Markdown
Contributor Author

The failing Build with nightly build of DPC++ toolchain job is not caused by this PR: it fails at the Build and install dpctl step, because dpctl's own IntelSYCLConfig.cmake rejects DPClang too. That will be fixed once IntelPython/dpctl#2433 is merged: the job builds dpctl from its master branch, so a rerun then picks up the fix and gets to building dpnp with this change.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/index.html

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.22.0dev3=np2py314h8d9cdd5_69 ran successfully.
Passed: 1491
Failed: 0
Skipped: 6

@coveralls

coveralls commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

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

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
Thank you @antonwolfy for accepting the DPClang compiler ID of CMake 4.5

@antonwolfy
antonwolfy merged commit 99f2183 into master Dec 2, 2026
45 checks passed
@antonwolfy
antonwolfy deleted the support-cmake-dpclang branch December 2, 2026 12:22
github-actions Bot added a commit that referenced this pull request Dec 2, 2026
…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.
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.

5 participants