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
4c54f0dd
Unverified
Commit
4c54f0dd
authored
Jan 19, 2024
by
Jeffrey Morgan
Committed by
GitHub
Jan 19, 2024
Browse files
sign dylibs on macOS (#2101)
parent
3b76e736
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
llm/generate/gen_common.sh
llm/generate/gen_common.sh
+2
-1
llm/generate/gen_darwin.sh
llm/generate/gen_darwin.sh
+10
-0
llm/generate/gen_windows.ps1
llm/generate/gen_windows.ps1
+1
-1
No files found.
llm/generate/gen_common.sh
View file @
4c54f0dd
...
...
@@ -83,8 +83,9 @@ build() {
compress_libs
()
{
echo
"Compressing payloads to reduce overall binary size..."
pids
=
""
rm
-rf
${
BUILD_DIR
}
/lib/
*
.
${
LIB_EXT
}*
.gz
for
lib
in
${
BUILD_DIR
}
/lib/
*
.
${
LIB_EXT
}*
;
do
gzip
--best
${
lib
}
&
gzip
--best
-f
${
lib
}
&
pids+
=
"
$!
"
done
echo
...
...
llm/generate/gen_darwin.sh
View file @
4c54f0dd
...
...
@@ -12,6 +12,12 @@ init_vars
git_module_setup
apply_patches
sign
()
{
if
[
-n
"
$APPLE_IDENTITY
"
]
;
then
codesign
-f
--timestamp
--deep
--options
=
runtime
--sign
"
$APPLE_IDENTITY
"
--identifier
ai.ollama.ollama
$1
fi
}
COMMON_DARWIN_DEFS
=
"-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_SYSTEM_NAME=Darwin -DLLAMA_ACCELERATE=off"
case
"
${
GOARCH
}
"
in
...
...
@@ -25,6 +31,7 @@ case "${GOARCH}" in
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/cpu"
echo
"Building LCD CPU"
build
sign
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/cpu/lib/libext_server.dylib
compress_libs
#
...
...
@@ -36,6 +43,7 @@ case "${GOARCH}" in
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/cpu_avx"
echo
"Building AVX CPU"
build
sign
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/cpu_avx/lib/libext_server.dylib
compress_libs
#
...
...
@@ -47,6 +55,7 @@ case "${GOARCH}" in
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/cpu_avx2"
echo
"Building AVX2 CPU"
build
sign
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/cpu_avx2/lib/libext_server.dylib
compress_libs
;;
"arm64"
)
...
...
@@ -54,6 +63,7 @@ case "${GOARCH}" in
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/metal"
EXTRA_LIBS
=
"
${
EXTRA_LIBS
}
-framework Accelerate -framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders"
build
sign
${
LLAMACPP_DIR
}
/build/darwin/
${
ARCH
}
/metal/lib/libext_server.dylib
compress_libs
;;
*
)
...
...
llm/generate/gen_windows.ps1
View file @
4c54f0dd
...
...
@@ -76,7 +76,7 @@ function compress_libs {
write-host
"Compressing dlls..."
$libs
=
dir
"
${script:buildDir}
/lib/*.dll"
foreach
(
$file
in
$libs
)
{
&
"
$
script
:
GZIP
"
--best
$file
&
"
$
script
:
GZIP
"
--best
-f
$file
}
}
...
...
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