Skip to content

Commit 0b6c722

Browse files
committed
fix: switch to CMake as Makefile is deprecated
1 parent 7755868 commit 0b6c722

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ FROM nvidia/cuda:12.6.3-devel-ubuntu22.04 AS env-build
33
WORKDIR /srv
44

55
# install build tools and clone and compile llama.cpp
6-
RUN apt-get update && apt-get install -y build-essential git libgomp1
6+
RUN apt-get update && apt-get install -y build-essential git libgomp1 cmake
77

88
RUN git clone https://github.com/ggerganov/llama.cpp.git \
99
&& cd llama.cpp \
10-
&& make -j LLAMA_CUDA=1 CUDA_DOCKER_ARCH=all
10+
&& cmake -B build -DGGML_CUDA=on -DBUILD_SHARED_LIBS=off \
11+
&& cmake --build build --config Release -j
1112

1213
FROM debian:12-slim AS env-deploy
1314

@@ -19,8 +20,8 @@ COPY --from=0 /usr/local/cuda/lib64/libcublasLt.so.12 ${LD_LIBRARY_PATH}/libcubl
1920
COPY --from=0 /usr/local/cuda/lib64/libcudart.so.12 ${LD_LIBRARY_PATH}/libcudart.so.12
2021

2122
# copy llama.cpp binaries
22-
COPY --from=0 /srv/llama.cpp/llama-cli /usr/local/bin/llama-cli
23-
COPY --from=0 /srv/llama.cpp/llama-server /usr/local/bin/llama-server
23+
COPY --from=0 /srv/llama.cpp/build/bin/llama-cli /usr/local/bin/llama-cli
24+
COPY --from=0 /srv/llama.cpp/build/bin/llama-server /usr/local/bin/llama-server
2425

2526
# create llama user and set home directory
2627
RUN useradd --system --create-home llama

Dockerfile-cpu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ FROM debian:12-slim AS env-build
33
WORKDIR /srv
44

55
# install build tools and clone and compile llama.cpp
6-
RUN apt-get update && apt-get install -y make git clang-16 libomp-16-dev
6+
RUN apt-get update && apt-get install -y make git cmake clang-16 libomp-16-dev
77

88
RUN git clone https://github.com/ggerganov/llama.cpp.git \
99
&& cd llama.cpp \
10-
&& make -j CC=clang-16 CXX=clang++-16
10+
&& CC=clang-16 CXX=clang++-16 cmake -B build -DBUILD_SHARED_LIBS=off \
11+
&& cmake --build build --config Release -j
1112

1213
FROM debian:12-slim AS env-deploy
1314

@@ -16,8 +17,8 @@ ENV LD_LIBRARY_PATH=/usr/local/lib
1617
COPY --from=0 /usr/lib/llvm-16/lib/libomp.so.5 ${LD_LIBRARY_PATH}/libomp.so.5
1718

1819
# copy llama.cpp binaries
19-
COPY --from=0 /srv/llama.cpp/llama-cli /usr/local/bin/llama-cli
20-
COPY --from=0 /srv/llama.cpp/llama-server /usr/local/bin/llama-server
20+
COPY --from=0 /srv/llama.cpp/build/bin/llama-cli /usr/local/bin/llama-cli
21+
COPY --from=0 /srv/llama.cpp/build/bin/llama-server /usr/local/bin/llama-server
2122

2223
# create llama user and set home directory
2324
RUN useradd --system --create-home llama

0 commit comments

Comments
 (0)