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
70261b9b
Commit
70261b9b
authored
Apr 17, 2024
by
Jeremy
Browse files
move static build to its own flag
parent
9df6c85c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
Dockerfile
Dockerfile
+3
-3
llm/generate/gen_linux.sh
llm/generate/gen_linux.sh
+4
-3
No files found.
Dockerfile
View file @
70261b9b
...
@@ -18,7 +18,7 @@ ENV PATH /opt/rh/devtoolset-10/root/usr/bin:$PATH
...
@@ -18,7 +18,7 @@ ENV PATH /opt/rh/devtoolset-10/root/usr/bin:$PATH
COPY
--from=llm-code / /go/src/github.com/ollama/ollama/
COPY
--from=llm-code / /go/src/github.com/ollama/ollama/
WORKDIR
/go/src/github.com/ollama/ollama/llm/generate
WORKDIR
/go/src/github.com/ollama/ollama/llm/generate
ARG
CGO_CFLAGS
ARG
CGO_CFLAGS
RUN
OLLAMA_SKIP_CPU_GENERATE
=
1 sh gen_linux.sh
RUN
OLLAMA_SKIP_CPU_GENERATE
=
1
OLLAMA_SKIP_STATIC_GENERATE
=
1
sh gen_linux.sh
FROM
--platform=linux/arm64 nvidia/cuda:$CUDA_VERSION-devel-rockylinux8 AS cuda-build-arm64
FROM
--platform=linux/arm64 nvidia/cuda:$CUDA_VERSION-devel-rockylinux8 AS cuda-build-arm64
ARG
CMAKE_VERSION
ARG
CMAKE_VERSION
...
@@ -28,7 +28,7 @@ ENV PATH /opt/rh/gcc-toolset-10/root/usr/bin:$PATH
...
@@ -28,7 +28,7 @@ ENV PATH /opt/rh/gcc-toolset-10/root/usr/bin:$PATH
COPY
--from=llm-code / /go/src/github.com/ollama/ollama/
COPY
--from=llm-code / /go/src/github.com/ollama/ollama/
WORKDIR
/go/src/github.com/ollama/ollama/llm/generate
WORKDIR
/go/src/github.com/ollama/ollama/llm/generate
ARG
CGO_CFLAGS
ARG
CGO_CFLAGS
RUN
OLLAMA_SKIP_CPU_GENERATE
=
1 sh gen_linux.sh
RUN
OLLAMA_SKIP_CPU_GENERATE
=
1
OLLAMA_SKIP_STATIC_GENERATE
=
1
sh gen_linux.sh
FROM
--platform=linux/amd64 rocm/dev-centos-7:${ROCM_VERSION}-complete AS rocm-build-amd64
FROM
--platform=linux/amd64 rocm/dev-centos-7:${ROCM_VERSION}-complete AS rocm-build-amd64
ARG
CMAKE_VERSION
ARG
CMAKE_VERSION
...
@@ -40,7 +40,7 @@ COPY --from=llm-code / /go/src/github.com/ollama/ollama/
...
@@ -40,7 +40,7 @@ COPY --from=llm-code / /go/src/github.com/ollama/ollama/
WORKDIR
/go/src/github.com/ollama/ollama/llm/generate
WORKDIR
/go/src/github.com/ollama/ollama/llm/generate
ARG
CGO_CFLAGS
ARG
CGO_CFLAGS
ARG
AMDGPU_TARGETS
ARG
AMDGPU_TARGETS
RUN
OLLAMA_SKIP_CPU_GENERATE
=
1 sh gen_linux.sh
RUN
OLLAMA_SKIP_CPU_GENERATE
=
1
OLLAMA_SKIP_STATIC_GENERATE
=
1
sh gen_linux.sh
RUN
mkdir
/tmp/scratch
&&
\
RUN
mkdir
/tmp/scratch
&&
\
for
dep
in
$(
zcat /go/src/github.com/ollama/ollama/llm/build/linux/x86_64/rocm
*
/bin/deps.txt.gz
)
;
do
\
for
dep
in
$(
zcat /go/src/github.com/ollama/ollama/llm/build/linux/x86_64/rocm
*
/bin/deps.txt.gz
)
;
do
\
cp
${
dep
}
/tmp/scratch/
||
exit
1
;
\
cp
${
dep
}
/tmp/scratch/
||
exit
1
;
\
...
...
llm/generate/gen_linux.sh
View file @
70261b9b
...
@@ -57,10 +57,8 @@ init_vars
...
@@ -57,10 +57,8 @@ init_vars
git_module_setup
git_module_setup
apply_patches
apply_patches
init_vars
init_vars
if
[
-z
"
${
OLLAMA_SKIP_CPU_GENERATE
}
"
]
;
then
if
[
-z
"
${
OLLAMA_SKIP_STATIC_GENERATE
}
"
]
;
then
if
[
-z
"
${
OLLAMA_CPU_TARGET
}
"
-o
"
${
OLLAMA_CPU_TARGET
}
"
=
"static"
]
;
then
if
[
-z
"
${
OLLAMA_CPU_TARGET
}
"
-o
"
${
OLLAMA_CPU_TARGET
}
"
=
"static"
]
;
then
# Static build for linking into the Go binary
# Static build for linking into the Go binary
init_vars
init_vars
...
@@ -70,7 +68,10 @@ if [ -z "${OLLAMA_SKIP_CPU_GENERATE}" ]; then
...
@@ -70,7 +68,10 @@ if [ -z "${OLLAMA_SKIP_CPU_GENERATE}" ]; then
echo
"Building static library"
echo
"Building static library"
build
build
fi
fi
fi
init_vars
if
[
-z
"
${
OLLAMA_SKIP_CPU_GENERATE
}
"
]
;
then
# Users building from source can tune the exact flags we pass to cmake for configuring
# Users building from source can tune the exact flags we pass to cmake for configuring
# llama.cpp, and we'll build only 1 CPU variant in that case as the default.
# llama.cpp, and we'll build only 1 CPU variant in that case as the default.
...
...
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