[PR #3548] [MERGED] build.go: introduce a friendlier way to build Ollama #21733

Closed
opened 2026-04-19 15:48:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/3548
Author: @bmizerany
Created: 4/9/2024
Status: Merged
Merged: 4/9/2024
Merged by: @bmizerany

Base: mainHead: nogogen


📝 Commits (1)

  • 49c126f build.go: introduce a friendlier way to build Ollama

📊 Changes

11 files changed (+249 additions, -59 deletions)

View changed files

📝 .github/workflows/release.yaml (+2 -1)
📝 .github/workflows/test.yaml (+31 -11)
📝 README.md (+1 -7)
build.go (+192 -0)
📝 docs/development.md (+15 -23)
📝 llm/generate/gen_darwin.sh (+4 -4)
📝 llm/generate/gen_linux.sh (+3 -3)
📝 llm/generate/gen_windows.ps1 (+1 -1)
llm/generate/generate_darwin.go (+0 -3)
llm/generate/generate_linux.go (+0 -3)
llm/generate/generate_windows.go (+0 -3)

📄 Description

This commit introduces a more friendly way to build Ollama dependencies and the binary without abusing go generate and removing the unnecessary extra steps it brings with it.

This script also provides nicer feedback to the user about what is happening during the build process.

At the end, it prints a helpful message to the user about what to do next (e.g. run the new local Ollama).

This addresses a few other issues:

  1. We can now introduce new code generation tools without forcing rebuilds of llama.cpp
  2. We can now introduce new build flags/features (e.g. rangefunc), et al without hurting developer on-boarding experience
  3. We also have more power and flexibility with how/where we layout our directory structure in the future.

How to test:

; git clone https://github.com/ollama/ollama
; go run build.go

Test that ./ollama serve runs, and then try:

; go run build.go

That should skip the generate step, then try:

; go run build.go -f

That should rebuild llama.cpp again.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/3548 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 4/9/2024 **Status:** ✅ Merged **Merged:** 4/9/2024 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `nogogen` --- ### 📝 Commits (1) - [`49c126f`](https://github.com/ollama/ollama/commit/49c126fde84d6a212cd91dd664b2ca90dff09ea3) build.go: introduce a friendlier way to build Ollama ### 📊 Changes **11 files changed** (+249 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yaml` (+2 -1) 📝 `.github/workflows/test.yaml` (+31 -11) 📝 `README.md` (+1 -7) ➕ `build.go` (+192 -0) 📝 `docs/development.md` (+15 -23) 📝 `llm/generate/gen_darwin.sh` (+4 -4) 📝 `llm/generate/gen_linux.sh` (+3 -3) 📝 `llm/generate/gen_windows.ps1` (+1 -1) ➖ `llm/generate/generate_darwin.go` (+0 -3) ➖ `llm/generate/generate_linux.go` (+0 -3) ➖ `llm/generate/generate_windows.go` (+0 -3) </details> ### 📄 Description This commit introduces a more friendly way to build Ollama dependencies and the binary without abusing `go generate` and removing the unnecessary extra steps it brings with it. This script also provides nicer feedback to the user about what is happening during the build process. At the end, it prints a helpful message to the user about what to do next (e.g. run the new local Ollama). This addresses a few other issues: 1. We can now introduce new code generation tools without forcing rebuilds of llama.cpp 1. We can now introduce new build flags/features (e.g. `rangefunc`), et al without hurting developer on-boarding experience 2. We also have more power and flexibility with how/where we layout our directory structure in the future. How to test: ; git clone https://github.com/ollama/ollama ; go run build.go Test that `./ollama serve` runs, and then try: ; go run build.go That should skip the generate step, then try: ; go run build.go -f That should rebuild llama.cpp again. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 15:48:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#21733