[sycl-jit] Allow GCC host builds by not elevating -Wconversion to errors#21933
Merged
dm-vodopyanov merged 1 commit intointel:syclfrom May 7, 2026
Merged
[sycl-jit] Allow GCC host builds by not elevating -Wconversion to errors#21933dm-vodopyanov merged 1 commit intointel:syclfrom
dm-vodopyanov merged 1 commit intointel:syclfrom
Conversation
sycl-jit is built with SYCL_JIT_WARNING_FLAGS (-Wall -Wextra -Wconversion, and -Werror when SYCL_JIT_ENABLE_WERROR is on). Translation units such as DeviceCompilation.cpp include Clang Driver/Frontend headers; when the LLVM/SYCL tree is configured with GNU g++ as the host C++ compiler, those headers can produce many -Wconversion diagnostics. With -Werror enabled, that aborts the sycl-jit build. Add -Wno-error=conversion for the sycl-jit target only when the host CXX compiler is GCC (CMake GNU compiler id). Warnings still appear; they are no longer elevated to errors for that diagnostic group
5fd8a22 to
f06582a
Compare
cperkinsintel
approved these changes
May 6, 2026
Contributor
|
@intel/llvm-gatekeepers please consider merging |
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.
Summary
Add
-Wno-error=conversiononly for thesycl-jittarget under g++ compiler so the SYCL JIT library can be built when the LLVM/SYCL tree is configured with GNUg++as the host C++ compiler, while keeping-Wconversionand the rest ofSYCL_JIT_WARNING_FLAGS/-Werrorbehavior for other diagnostics or for other compilers.Problem
With
SYCL_JIT_ENABLE_WERRORon (default),sycl-jituses-Wall -Wextra -Wconversion -Werror. Compilinglib/rtc/DeviceCompilation.cpppulls in Clang headers (e.g. via the Driver). Under g++ 13.3.0 (/usr/bin/g++, Ubuntu13.3.0-6ubuntu2~24.04.1), those headers trigger a large number of-Wconversionwarnings, which fail the build under-Werror.Solution
target_compile_options(sycl-jit PRIVATE -Wno-error=conversion)insycl-jit/jit-compiler/CMakeLists.txt: conversion issues are still reported as warnings for g++, but no longer abort thesycl-jitbuild.Compilation errors observed (representative)
The build stopped on
DeviceCompilation.cppwith warnings treated as errors, for example:Host toolchain
CMAKE_CXX_COMPILER=/usr/bin/g++
g++ (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Testing
Reconfigured and rebuilt the project with the existing configure/build workflow; sycl-jit and SYCL install steps complete with this change.