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
2ecb2472
Commit
2ecb2472
authored
Jan 13, 2024
by
Daniel Hiltgen
Browse files
Fix intel mac build
Make sure we're building an x86 ext_server lib when cross-compiling
parent
288ef8ff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
llm/dyn_ext_server.go
llm/dyn_ext_server.go
+1
-1
llm/generate/gen_darwin.sh
llm/generate/gen_darwin.sh
+3
-0
No files found.
llm/dyn_ext_server.go
View file @
2ecb2472
...
...
@@ -75,7 +75,7 @@ func newDynExtServer(library, model string, adapters, projectors []string, opts
updatePath
(
filepath
.
Dir
(
library
))
libPath
:=
C
.
CString
(
library
)
defer
C
.
free
(
unsafe
.
Pointer
(
libPath
))
resp
:=
newExtServerResp
(
12
8
)
resp
:=
newExtServerResp
(
5
12
)
defer
freeExtServerResp
(
resp
)
var
srv
C
.
struct_dynamic_llama_server
C
.
dyn_init
(
libPath
,
&
srv
,
&
resp
)
...
...
llm/generate/gen_darwin.sh
View file @
2ecb2472
...
...
@@ -14,9 +14,11 @@ BUILD_DIR="${LLAMACPP_DIR}/build/darwin/metal"
case
"
${
GOARCH
}
"
in
"amd64"
)
CMAKE_DEFS
=
"-DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DLLAMA_METAL=off -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off
${
CMAKE_DEFS
}
"
ARCH
=
"x86_64"
;;
"arm64"
)
CMAKE_DEFS
=
"-DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64 -DLLAMA_METAL=on
${
CMAKE_DEFS
}
"
ARHC
=
"arm64"
;;
*
)
echo
"GOARCH must be set"
...
...
@@ -30,6 +32,7 @@ apply_patches
build
install
gcc
-fPIC
-g
-shared
-o
${
BUILD_DIR
}
/lib/libext_server.so
\
-arch
${
ARCH
}
\
-Wl
,-force_load
${
BUILD_DIR
}
/lib/libext_server.a
\
${
BUILD_DIR
}
/lib/libcommon.a
\
${
BUILD_DIR
}
/lib/libllama.a
\
...
...
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