skills/llm-build-and-ctest/SKILL.md
Configure, build, and run CTest for this repository using CMake presets (native, x-android-aarch64, x-linux-aarch64), including common cache flags (LLM_FRAMEWORK, BUILD_JNI_LIB, USE_KLEIDIAI, BUILD_BENCHMARK, CPU_ARCH) and failure triage steps. Use when asked to run tests, reproduce build/CI failures, or diagnose CMake/CTest/JNI issues for this project.
npx skillsauth add arm-examples/llm-runner llm-build-and-ctestInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This is the default “prove it works” workflow for changes in this repo. Run it before wrapping up modifications to C++/CMake/tests (unless you explicitly agree to skip validation).
Windows note: if python3 isn’t available, use python (or py -3) for the scripts below.
During configure, CMake may use FetchContent to download dependencies from the network. If your network is blocked, configure can fail before tests run. To enable network access when the process runs in a sandbox, see skills/README.md. Otherwise, run the build on your local machine (with network access) and share the resulting build path with the tool (for example: build dir: /path/to/build), or point CMake at pre-downloaded dependencies in your environment.
Use one of the repo presets in CMakePresets.json:
cmake --preset=native -B build
Common configuration flags:
# Select backend
cmake --preset=native -B build -DLLM_FRAMEWORK=llama.cpp
cmake --preset=native -B build -DLLM_FRAMEWORK=onnxruntime-genai
cmake --preset=native -B build -DLLM_FRAMEWORK=mnn
cmake --preset=native -B build -DLLM_FRAMEWORK=executorch
# Disable JNI (faster iteration; avoids requiring JDK)
cmake --preset=native -B build -DBUILD_JNI_LIB=OFF
# Disable KleidiAI optimizations (for A/B testing)
cmake --preset=native -B build -DUSE_KLEIDIAI=OFF
# AArch64 ISA selection (llama.cpp + linux-aarch64 target only)
cmake --preset=native -B build -DCPU_ARCH=Armv8.2_4
cmake --build ./build --parallel
ctest --test-dir ./build --output-on-failure
Run verbose and/or a subset:
ctest --test-dir ./build -V
ctest --test-dir ./build -N
ctest --test-dir ./build -R llm-cpp-ctest -V
scripts/cmake/download-resources.cmake → scripts/py/download_resources.py); set HF_TOKEN (or ~/.netrc for huggingface.co) for gated models.build/CMakeFiles/CMakeOutput.log and build/CMakeFiles/CMakeError.log.-DBUILD_JNI_LIB=OFF to separate C++ failures from Java/JNI toolchain issues.build/CMakeCache.txt for LLM_FRAMEWORK, BUILD_JNI_LIB, USE_KLEIDIAI, CPU_ARCH.Run the bundled helper script:
python3 skills/llm-build-and-ctest/scripts/run_build_and_ctest.py native build
For deeper triage patterns, load skills/llm-build-and-ctest/references/ctest-triage.md.
tools
Update scripts/py/requirements.json entries (URLs + sha256sum) for models/tools, validate hash changes, and keep downloads deterministic without committing artifacts. Use when adding or refreshing model/tool downloads.
tools
Run fast “session start / doctor” checks for this repository (toolchain + wiring sanity, framework version report, optional upstream update check), optionally generate a debug bundle, and when needed bump pinned backend framework versions with build+ctest verification. Use at session start or when upgrading llama.cpp/onnxruntime-genai/mnn/executorch pins.
tools
Run a fast JNI-focused build/test smoke check (JNI on, minimal test run), and isolate JNI toolchain issues. Use when changing JNI/Java code or validating JNI setup.
development
Debug failing LLM integration tests caused by model output drift, incorrect context/runtime parameters (contextSize, batchSize, threads), prompt/template mismatches, or backend/framework regressions. Use when tests fail and you need to see the model response, reproduce a single failing CTest, or trace issues into src/cpp/frameworks (llama.cpp, onnxruntime-genai, mnn, executorch).