- All files under *core/iwasm/libraries/wasi-nn* are compiled as shared libraries - *wasi-nn.c* is shared between backends - Every backend has a separated shared library - If wasi-nn feature is enabled, iwasm will depend on shared library libiwasm.so instead of linking static library libvmlib.a
36 lines
1.3 KiB
Docker
36 lines
1.3 KiB
Docker
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
FROM ubuntu:20.04 AS base
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# hadolint ignore=DL3008,DL3009
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends\
|
|
ca-certificates cmake build-essential git wget
|
|
|
|
WORKDIR /usr/local/share/ca-certificates/cacert.org
|
|
RUN wget -qP /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt \
|
|
&& update-ca-certificates
|
|
|
|
WORKDIR /home/wamr
|
|
COPY . .
|
|
RUN git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
|
|
|
|
WORKDIR /home/wamr/product-mini/platforms/linux
|
|
RUN rm -rf build \
|
|
&& cmake -S . -B build -DWAMR_BUILD_WASI_NN=1 \
|
|
-DWAMR_BUILD_WASI_NN=1 \
|
|
-DWAMR_BUILD_WASI_NN_ENABLE_EXTERNAL_DELEGATE=1 \
|
|
-DWAMR_BUILD_WASI_NN_EXTERNAL_DELEGATE_PATH="libedgetpu.so.1.0" \
|
|
-DWAMR_BUILD_WASI_NN_ENABLE_GPU=1 \
|
|
&& cmake --build build -j "$(grep -c ^processor /proc/cpuinfo)"
|
|
|
|
RUN cp /home/wamr/product-mini/platforms/linux/build/iwasm /usr/bin/iwasm \
|
|
&& cp /home/wamr/product-mini/platforms/linux/build/libiwasm.so /lib/libiwasm.so \
|
|
&& cp /home/wamr/product-mini/platforms/linux/build/libwasi-nn-*.so /lib/
|
|
|
|
WORKDIR /assets
|
|
ENTRYPOINT [ "iwasm" ]
|