@@ -13,7 +13,6 @@ ARG GCC_VERSION=14
1313FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
1414
1515ARG GCC_VERSION=14
16- ARG ENGINE_ENABLE_NATIVE_CPU=ON
1716
1817# Install build toolchain
1918RUN apt-get update && \
@@ -27,13 +26,22 @@ ENV CC=gcc-${GCC_VERSION} CXX=g++-${GCC_VERSION}
2726WORKDIR /app
2827COPY . .
2928
29+ # Validate architecture (CPU backend is only supported on amd64 and arm64)
30+ ARG TARGETARCH
31+ RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
32+ echo "Building for $TARGETARCH" ; \
33+ else \
34+ echo "Unsupported architecture: $TARGETARCH" ; \
35+ exit 1; \
36+ fi
37+
3038# Configure and build
3139RUN cmake -S . -B build \
3240 -DCMAKE_BUILD_TYPE=Release \
41+ -DENGINE_ENABLE_CPU_ALL_VARIANTS=ON \
3342 -DENGINE_ENABLE_CUDA=OFF \
3443 -DENGINE_ENABLE_VULKAN=OFF \
3544 -DENGINE_ENABLE_OPENMP=ON \
36- -DENGINE_ENABLE_NATIVE_CPU=$ENGINE_ENABLE_NATIVE_CPU \
3745 -DENGINE_BUILD_EXAMPLES=OFF \
3846 -DENGINE_BUILD_TESTS=OFF \
3947 -DENGINE_BUILD_WARMBENCH=OFF && \
@@ -43,7 +51,11 @@ RUN cmake -S . -B build \
4351 --target model_perf \
4452 --target miocodec_wavlm_parity
4553
46- # Collect all binaries + multiplexer into /app/full
54+ # Collect shared libraries
55+ RUN mkdir -p /app/lib && \
56+ find build -name "*.so*" -exec cp -P {} /app/lib \;
57+
58+ # Collect binaries + multiplexer into /app/full
4759RUN mkdir -p /app/full && \
4860 cp build/bin/audiocpp_cli build/bin/audiocpp_server \
4961 build/bin/model_perf build/bin/miocodec_wavlm_parity /app/full/ && \
@@ -77,6 +89,8 @@ RUN apt-get update && \
7789 find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete && \
7890 find /var/cache -type f -delete
7991
92+ COPY --from=build /app/lib/ /app
93+
8094WORKDIR /app
8195
8296# ── FULL: All binaries + entrypoint.sh multiplexer ────────────────────────────
0 commit comments