Skip to content

fix(build): disable LLAMA_BUILD_APP/UI so the CUDA/SYCL source build links - #43

Merged
SnowCheetos merged 1 commit into
mainfrom
fix/llama-build-app-target
Jul 8, 2026
Merged

fix(build): disable LLAMA_BUILD_APP/UI so the CUDA/SYCL source build links#43
SnowCheetos merged 1 commit into
mainfrom
fix/llama-build-app-target

Conversation

@SnowCheetos

Copy link
Copy Markdown
Contributor

Overview

Follow-up to #42. That PR fixed 3 of the 5 release targets and bumped the llama.cpp submodule to b9837, which resolved the bridge API drift on the two from-source targets (CUDA, SYCL). But those two then failed at a new point — v0.17.3 Release run 28913925408:

third_party/llama.cpp/app/llama.cpp:1:10: fatal error: build-info.h: No such file or directory
[3%] Building CXX object app/CMakeFiles/llama-app.dir/llama.cpp.o

Root cause

b9837 introduced two new CMake options that both default ON for a standalone (top-level) build:

option(LLAMA_BUILD_APP "llama: build the unified binary" ${LLAMA_STANDALONE})   # new
option(LLAMA_BUILD_UI  "llama: build the embedded Web UI for server" ON)        # new
...
if (LLAMA_BUILD_APP)
    add_subdirectory(app)
endif()

build.rs disables TESTS/EXAMPLES/TOOLS/SERVER but not these newer targets, so cmake built the app/llama-app binary — which #includes a generated build-info.h it can't find. We only need the libraries (libllama, libggml*, libcommon) for FFI, so the app binary should never be built.

Prebuilt targets (CPU/Vulkan/macOS) are unaffected — they download .sos and never run the cmake source build. This only bit the two from-source backends.

Fix

Add -DLLAMA_BUILD_APP=OFF -DLLAMA_BUILD_UI=OFF to the cmake configure in build_from_source. Older llama.cpp releases that lack these options ignore the flags harmlessly.

Verification

Reproduced and validated locally against a b9837 checkout with the exact build.rs flags:

Configure app subdir added?
current main flags (no LLAMA_BUILD_APP) yes — reproduces the failure
+ -DLLAMA_BUILD_APP=OFF no — target excluded ✓
  • All flags recognized (no "unused variable" warnings).
  • llama, ggml, ggml-base, common targets still present.
  • libllama.a builds cleanly past the point where CI failed.

CI note: the Release matrix only runs on a v* tag, so this won't be exercised by this PR's checks — it needs a tag (or a workflow_dispatch trigger) to confirm green end-to-end.

The b9837 submodule bump (#42) resolved the bridge API drift, but the
from-source CUDA and SYCL release targets then failed at 3% with:

    app/llama.cpp:1:10: fatal error: build-info.h: No such file or directory

b9837 introduced two new CMake targets — LLAMA_BUILD_APP (the "unified
binary") and LLAMA_BUILD_UI — both defaulting ON for a standalone
(top-level) build. build.rs disables TESTS/EXAMPLES/TOOLS/SERVER but not
these, so cmake tried to build app/llama.cpp, which needs a generated
build-info.h and breaks the library-only build we need for FFI.

Pass -DLLAMA_BUILD_APP=OFF and -DLLAMA_BUILD_UI=OFF. Verified against a
b9837 checkout: with these flags the app subdirectory is no longer
configured and libllama/ggml/common build cleanly. Only affects the
from-source backends (CUDA/SYCL); prebuilt targets (CPU/Vulkan/macOS)
never run the cmake source build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 8, 2026 03:03

Copilot AI 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.

Pull request overview

This PR adjusts the llama-sys from-source CMake configuration to prevent llama.cpp’s newly-added application/UI targets from being built when compiling CUDA/SYCL backends from source, ensuring the build only produces the libraries needed for FFI.

Changes:

  • Disable llama.cpp’s LLAMA_BUILD_APP target during from-source builds to avoid compiling app/ (and its generated-header dependency).
  • Disable LLAMA_BUILD_UI during from-source builds to avoid the embedded UI target behavior.
  • Add in-file rationale documenting why these options are explicitly turned off.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SnowCheetos
SnowCheetos merged commit 9dd1467 into main Jul 8, 2026
9 checks 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.

2 participants