Skip to content

CMake: declare BUILD_TESTING before any subproject; llama.cpp b11457 → b11462 - #480

Merged
bernardladenthin merged 3 commits into
mainfrom
claude/hopeful-pascal-9jlbqb
Oct 7, 2026
Merged

bernardladenthin merged 3 commits into
mainfrom
claude/hopeful-pascal-9jlbqb

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Fix the two red CUDA jobs of run 37550451678. On the GPU-less runners, jllama_test's gtest discovery could not load libcuda.so.1 (Linux) or nvcuda.dll (Windows, 0xc0000135).
    • Root cause: the CCCL pin (-DGGML_CUDA_CCCL_VERSION=v3.4.3) makes ggml fetch CCCL, and CCCL calls include(CTest) unconditionally. That creates BUILD_TESTING as a cache variable defaulting to ON. Our option(BUILD_TESTING ... OFF) was declared after the first FetchContent_MakeAvailable(), so it was a no-op and both CUDA jobs built the tests.
    • Fix: the option is now declared at the top of llama/CMakeLists.txt, before any subproject. -DBUILD_TESTING=ON still enables the tests.
    • The "Upgrading CUDA Version" section of CLAUDE.md notes why the option has to stay there.
  • Careful llama.cpp bump b11457 → b11462 in two reviewed steps (b11458, b11462):
    • Only backend files changed upstream: hexagon #30067, SYCL #27689/#29500, Vulkan #30049, WebGPU #27069.
    • No .github changes upstream.
    • All ten local patches still apply, and every one is still needed. Kolibri-1 is still not upstream, so 0016 stays.
    • Rows added to docs/history/llama-cpp-breaking-changes.md; the pin is updated in CMake, README, CLAUDE.md and LlamaCppVersion.

Test plan

  • Fix, reproduced locally with a simulated CCCL subproject:
    • before: BUILD_TESTING=ON and jllama_test generated;
    • after: OFF;
    • -DBUILD_TESTING=ON still builds the tests.
  • Fresh full build at b11462: ctest 598/598 passed, including the Kolibri-1 tests.
  • mvn clean test with NativeLibraryLoadSmokeTest and LlamaLoggerTest: 10 tests, 0 skipped. This includes the check that the linked build info matches LlamaCppVersion (b11462).
  • CI is green on this branch. The two CUDA build jobs are the ones to watch; no local CUDA toolkit.
  • Docs / CHANGELOG updated

Related issues / PRs

Follows #479. Fixes the CUDA failures of run 37550451678.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2


Generated by Claude Code

claude added 3 commits October 7, 2026 01:47
The CUDA build of the Publish run on main (37550451678) failed linking
jllama_test: gtest discovery runs the binary at build time and it needs
libcuda.so.1, which the GPU-less runner does not have. The job does not
ask for tests at all. Since the llama.cpp bump our CUDA builds pass
-DGGML_CUDA_CCCL_VERSION=v3.4.3, so ggml fetches CCCL, and CCCL's
CMakeLists calls include(CTest) unconditionally -- which creates
BUILD_TESTING as a cache variable defaulting to ON before our
option(BUILD_TESTING ... OFF) runs, turning it into a no-op. The last
green CUDA build (36935020061) never built jllama_test.

The option is now declared before the first FetchContent_MakeAvailable().
Reproduced without CUDA by injecting include(CTest) into ggml's project()
call (CMAKE_PROJECT_ggml_INCLUDE): before the change BUILD_TESTING ends up
ON and jllama_test is generated, after it stays OFF; -DBUILD_TESTING=ON
still enables the tests. The Windows CUDA job passes the same pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2
One upstream commit, #30067: the Hexagon backend's copy/concat overhaul.
No natives jar builds Hexagon, so nothing in it reaches a shipped
library; 112 KiB, but a single commit cannot be split. All ten patches
apply unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2
Four commits, backends only: SYCL drops its separate flash-attention KV
buffers (#27689; its CMakeLists globs the sources) and gains an IQ3_S
multi-column MMVQ (#29500), Vulkan reads AMD UMA memory through the
device copy path instead of the slow write-combined mapping (#30049),
WebGPU (#27069, not built). All ten patches apply unchanged; b11462 is
the newest release.

CLAUDE.md now records why BUILD_TESTING must be declared before the
subprojects (CCCL's include(CTest)), next to the CCCL pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2
@bernardladenthin
bernardladenthin merged commit 18e0735 into main Oct 7, 2026
9 of 14 checks passed
@bernardladenthin
bernardladenthin deleted the claude/hopeful-pascal-9jlbqb branch October 7, 2026 10:22
@claude

claude Bot commented Oct 7, 2026

Copy link
Copy Markdown

Review Summary

This PR fixes a CMake BUILD_TESTING cache-variable shadowing issue and bumps llama.cpp to b11462.

CMake Fix

Status: Correct. The option(BUILD_TESTING OFF) is now declared before any FetchContent_MakeAvailable(), preventing CCCLs unconditional include(CTest) from creating a conflicting cache variable. The explanation in both CMakeLists.txt and CLAUDE.md is clear and references the exact CUDA job failure. Users can still enable tests with -DBUILD_TESTING=ON.

Version Bump

Status: Methodical and correct. All 10 patches apply unchanged. Backend changes only upstream (Hexagon, SYCL, Vulkan, WebGPU). All version references updated: CMakeLists.txt, README.md, CLAUDE.md, LlamaCppVersion.java, CHANGELOG.md, docs/history/llama-cpp-breaking-changes.md.

Test Coverage

  • Local CCCL simulation verified
  • Full C++ suite at b11462 (598 tests)
  • Java version constant verification

Verdict: No issues found. Ready to merge.

@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

This branch had an error being deployed

1 failed deployment
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.

2 participants