Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
39fd8930
Commit
39fd8930
authored
Jan 30, 2025
by
Michael Yang
Browse files
build: set CFLAGS=-O3 specifically for cpu.go
parent
548a9f56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
.github/workflows/release.yaml
.github/workflows/release.yaml
+10
-2
ml/backend/ggml/ggml/src/ggml-cpu/cpu.go
ml/backend/ggml/ggml/src/ggml-cpu/cpu.go
+1
-1
No files found.
.github/workflows/release.yaml
View file @
39fd8930
...
...
@@ -5,6 +5,10 @@ on:
tags
:
-
'
v*'
env
:
CGO_CFLAGS
:
'
-O3'
CGO_CXXFLAGS
:
'
-O3'
jobs
:
setup-environment
:
runs-on
:
ubuntu-latest
...
...
@@ -291,7 +295,7 @@ jobs:
-
uses
:
docker/setup-buildx-action@v3
-
run
:
|
apt-get update && apt-get install pigz
for TARGET in ${{ matrix.targets }}; do docker buildx build --platform $PLATFORM --target $TARGET --build-arg GOFLAGS --output type=local,dest=dist/$PLATFORM .; done
for TARGET in ${{ matrix.targets }}; do docker buildx build --platform $PLATFORM --target $TARGET --build-arg GOFLAGS
--build-arg CGO_CFLAGS --build-args CGO_CXXFLAGS
--output type=local,dest=dist/$PLATFORM .; done
tar c -C dist/$PLATFORM . | pigz -9cv >dist/ollama-${PLATFORM//\//-}.tgz
env
:
PLATFORM
:
${{ matrix.os }}/${{ matrix.arch }}
...
...
@@ -308,12 +312,16 @@ jobs:
-
flavor
:
'
latest=false'
platforms
:
linux/amd64,linux/arm64
build-args
:
|
CGO_CFLAGS=${{ env.CGO_CFLAGS }}
CGO_CXXFLAGS=${{ env.CGO_CXXFLAGS }}
GOFLAGS=${{ needs.setup-environment.outputs.GOFLAGS }}
-
flavor
:
'
latest=false,suffix=rocm'
platforms
:
linux/amd64
build-args
:
|
GOFLAGS=${{ needs.setup-environment.outputs.GOFLAGS }}
CGO_CFLAGS=${{ env.CGO_CFLAGS }}
CGO_CXXFLAGS=${{ env.CGO_CXXFLAGS }}
FLAVOR=rocm
GOFLAGS=${{ needs.setup-environment.outputs.GOFLAGS }}
runs-on
:
linux
environment
:
release
needs
:
setup-environment
...
...
ml/backend/ggml/ggml/src/ggml-cpu/cpu.go
View file @
39fd8930
package
cpu
// #cgo CFLAGS: -Wno-implicit-function-declaration
// #cgo CFLAGS:
-O3
-Wno-implicit-function-declaration
// #cgo CXXFLAGS: -std=c++17
// #cgo CPPFLAGS: -I${SRCDIR}/amx -I${SRCDIR}/llamafile -I${SRCDIR}/.. -I${SRCDIR}/../../include
// #cgo CPPFLAGS: -DGGML_USE_LLAMAFILE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment