Skip to content

cmake: build llama UI embedder for host arch#16502

Open
puneetdixit200 wants to merge 1 commit into
ollama:mainfrom
puneetdixit200:fix-darwin-ui-host-tool
Open

cmake: build llama UI embedder for host arch#16502
puneetdixit200 wants to merge 1 commit into
ollama:mainfrom
puneetdixit200:fix-darwin-ui-host-tool

Conversation

@puneetdixit200

Copy link
Copy Markdown

Summary

  • patch the pinned llama.cpp UI CMake to treat single-arch macOS builds targeting a non-host architecture as a host-tool case for llama-ui-embed
  • keep the generated llama-ui library and llama-server objects on the requested CMAKE_OSX_ARCHITECTURES slice
  • allow Darwin amd64 builds on Apple Silicon hosts without requiring Rosetta just to run the build-time UI embedder

Fixes #16500.

Testing

  • cmake -DPATCH_DIR=/tmp/ollama-16500/llama/compat -P /tmp/ollama-16500/llama/compat/apply-patch.cmake
  • cmake -S llama/server -B build/test-llama-server-amd64-ui-host ... -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0
  • cmake --build build/test-llama-server-amd64-ui-host --target llama-ui-assets --parallel 4
  • file build/test-llama-server-amd64-ui-host/_deps/llama_cpp-build/tools/ui/llama-ui-embed-host

The generated rules build llama-ui-embed-host without -arch x86_64, while llama-ui still compiles with -arch x86_64. The helper was reported as Mach-O 64-bit executable arm64 and llama-ui-assets completed.

@lapo-luchini

Copy link
Copy Markdown

Working perfectly, thanks!

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.

v0.30.4 does not build on OSX

2 participants