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
7da249fc
Commit
7da249fc
authored
Jul 31, 2023
by
Jeffrey Morgan
Browse files
only build metal for `darwin,arm` target
parent
f529626c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
llama/llama.go
llama/llama.go
+2
-1
scripts/build_darwin.sh
scripts/build_darwin.sh
+4
-4
No files found.
llama/llama.go
View file @
7da249fc
...
@@ -3,7 +3,8 @@ package llama
...
@@ -3,7 +3,8 @@ package llama
/*
/*
#cgo CPPFLAGS: -O3 -Wall -Wextra -Werror -Wno-unused-function -Wno-unused-variable -DNDEBUG -DGGML_USE_K_QUANTS
#cgo CPPFLAGS: -O3 -Wall -Wextra -Werror -Wno-unused-function -Wno-unused-variable -DNDEBUG -DGGML_USE_K_QUANTS
#cgo CXXFLAGS: -std=gnu++11
#cgo CXXFLAGS: -std=gnu++11
#cgo darwin CPPFLAGS: -DGGML_USE_ACCELERATE -DGGML_USE_METAL -DGGML_METAL_NDEBUG
#cgo darwin CPPFLAGS: -DGGML_USE_ACCELERATE
#cgo darwin,arm64 CPPFLAGS: -DGGML_USE_METAL -DGGML_METAL_NDEBUG
#cgo darwin LDFLAGS: -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders
#cgo darwin LDFLAGS: -framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders
#include <stdlib.h>
#include <stdlib.h>
#include "llama.h"
#include "llama.h"
...
...
scripts/build_darwin.sh
View file @
7da249fc
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
mkdir
-p
dist
mkdir
-p
dist
# build universal binary
# build universal binary
CGO_ENABLED
=
1
GOARCH
=
arm64 go build
-o
dist/ollama
_
arm64
CGO_ENABLED
=
1
GOARCH
=
arm64 go build
-o
dist/ollama
-darwin-
arm64
CGO_ENABLED
=
1
GOARCH
=
amd64 go build
-o
dist/ollama
_
amd64
CGO_ENABLED
=
1
GOARCH
=
amd64 go build
-o
dist/ollama
-darwin-
amd64
lipo
-create
-output
dist/ollama dist/ollama
_
arm64 dist/ollama
_
amd64
lipo
-create
-output
dist/ollama dist/ollama
-darwin-
arm64 dist/ollama
-darwin-
amd64
rm
dist/ollama
_
amd64 dist/ollama
_
arm64
rm
dist/ollama
-darwin-
amd64 dist/ollama
-darwin-
arm64
codesign
--deep
--force
--options
=
runtime
--sign
"
$APPLE_IDENTITY
"
--timestamp
dist/ollama
codesign
--deep
--force
--options
=
runtime
--sign
"
$APPLE_IDENTITY
"
--timestamp
dist/ollama
# build and sign the mac app
# build and sign the mac app
...
...
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