Skip to content

bugfix: fix protobuf header shadowing by torch in DeepSeek V4 cpp chat template build.#75

Merged
DongheJin merged 1 commit into
xLLM-AI:mainfrom
XuZhang99:bugfix/npu
Jun 30, 2026
Merged

bugfix: fix protobuf header shadowing by torch in DeepSeek V4 cpp chat template build.#75
DongheJin merged 1 commit into
xLLM-AI:mainfrom
XuZhang99:bugfix/npu

Conversation

@XuZhang99

Copy link
Copy Markdown
Collaborator

Description

Torch ships protobuf 3.13 headers; adding torch via a plain -I let them shadow vcpkg's protobuf 3.21 headers that the generated .pb.h files require, breaking the NPU build. Pass torch include dirs with -idirafter so they sit at the end of the search path, letting <google/protobuf/...> resolve to vcpkg's copy.

…t template build.

Torch ships protobuf 3.13 headers; adding torch via a plain -I let them shadow
vcpkg's protobuf 3.21 headers that the generated .pb.h files require, breaking the
NPU build. Pass torch include dirs with -idirafter so they sit at the end of the
search path, letting <google/protobuf/...> resolve to vcpkg's copy.

Co-Authored-By: Claude <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request modifies xllm_service/chat_template/CMakeLists.txt to prevent Torch's bundled protobuf headers from shadowing vcpkg's protobuf headers by using the -idirafter compiler option instead of standard include directories. The review feedback correctly points out that -idirafter is compiler-specific (GCC/Clang) and suggests guarding this logic with a compiler check to prevent build failures on other compilers like MSVC.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread xllm_service/chat_template/CMakeLists.txt
@DongheJin
DongheJin merged commit 1800a6f into xLLM-AI:main Jun 30, 2026
1 check passed
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.

3 participants