[PR #8715] [MERGED] build: set CFLAGS for cpu #44005

Closed
opened 2026-04-24 23:33:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8715
Author: @mxyng
Created: 1/30/2025
Status: Merged
Merged: 1/31/2025
Merged by: @mxyng

Base: mainHead: mxyng/cgo-o3


📝 Commits (2)

  • 8574956 Revert "cgo: use O3"
  • 26d17bf build: set CFLAGS=-O3 specifically for cpu.go

📊 Changes

12 files changed (+12 additions, -16 deletions)

View changed files

📝 .github/workflows/release.yaml (+10 -2)
📝 discover/gpu.go (+0 -1)
📝 discover/gpu_darwin.go (+0 -1)
📝 llama/llama.cpp/examples/llava/llava.go (+0 -1)
📝 llama/llama.cpp/src/llama.go (+0 -1)
📝 llama/llama.go (+0 -1)
📝 ml/backend/ggml/ggml/src/ggml-blas/blas.go (+0 -1)
📝 ml/backend/ggml/ggml/src/ggml-cpu/cpu.go (+2 -4)
📝 ml/backend/ggml/ggml/src/ggml-cpu/llamafile/llamafile.go (+0 -1)
📝 ml/backend/ggml/ggml/src/ggml-metal/metal.go (+0 -1)
📝 ml/backend/ggml/ggml/src/ggml.go (+0 -1)
📝 ml/backend/ggml/ggml/src/ggml_darwin_arm64.go (+0 -1)

📄 Description

CPPFLAGS doesn't get inserted into the right place and gets overwritten by the default CFLAGS='-O2 -g'. Set CFLAGS in the place it matters most in code and optionally configure it globally through CGO_CFLAGS and CGO_CXXFLAGS for release


🔄 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/8715 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 1/30/2025 **Status:** ✅ Merged **Merged:** 1/31/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/cgo-o3` --- ### 📝 Commits (2) - [`8574956`](https://github.com/ollama/ollama/commit/8574956f152cf8905eaf2500b595c37fe0b91bae) Revert "cgo: use O3" - [`26d17bf`](https://github.com/ollama/ollama/commit/26d17bf877ede37829f840af269200c52fe164c0) build: set CFLAGS=-O3 specifically for cpu.go ### 📊 Changes **12 files changed** (+12 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yaml` (+10 -2) 📝 `discover/gpu.go` (+0 -1) 📝 `discover/gpu_darwin.go` (+0 -1) 📝 `llama/llama.cpp/examples/llava/llava.go` (+0 -1) 📝 `llama/llama.cpp/src/llama.go` (+0 -1) 📝 `llama/llama.go` (+0 -1) 📝 `ml/backend/ggml/ggml/src/ggml-blas/blas.go` (+0 -1) 📝 `ml/backend/ggml/ggml/src/ggml-cpu/cpu.go` (+2 -4) 📝 `ml/backend/ggml/ggml/src/ggml-cpu/llamafile/llamafile.go` (+0 -1) 📝 `ml/backend/ggml/ggml/src/ggml-metal/metal.go` (+0 -1) 📝 `ml/backend/ggml/ggml/src/ggml.go` (+0 -1) 📝 `ml/backend/ggml/ggml/src/ggml_darwin_arm64.go` (+0 -1) </details> ### 📄 Description `CPPFLAGS` doesn't get inserted into the right place and gets overwritten by the default `CFLAGS='-O2 -g'`. Set `CFLAGS` in the place it matters most in code and optionally configure it globally through `CGO_CFLAGS` and `CGO_CXXFLAGS` for release --- <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-24 23:33:29 -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#44005