Make wasi-nn backends as separated shared libraries (#3509)
- 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
This commit is contained in:
@ -5,31 +5,28 @@ FROM ubuntu:20.04 AS base
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# hadolint ignore=DL3008
|
||||
RUN apt-get update && apt-get install -y \
|
||||
cmake build-essential git --no-install-recommends
|
||||
# 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/build
|
||||
|
||||
# hadolint ignore=DL3008
|
||||
RUN apt-get install -y wget ca-certificates --no-install-recommends \
|
||||
&& mkdir /usr/local/share/ca-certificates/cacert.org \
|
||||
&& 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 \
|
||||
&& git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
RUN cmake \
|
||||
-DWAMR_BUILD_WASI_NN=1 \
|
||||
..
|
||||
|
||||
RUN make -j "$(grep -c ^processor /proc/cpuinfo)"
|
||||
WORKDIR /home/wamr/product-mini/platforms/linux
|
||||
RUN rm -rf build \
|
||||
&& cmake -S . -B build -DWAMR_BUILD_WASI_NN=1 \
|
||||
&& cmake --build build -j "$(grep -c ^processor /proc/cpuinfo)"
|
||||
|
||||
FROM ubuntu:22.04
|
||||
|
||||
COPY --from=base /home/wamr/product-mini/platforms/linux/build/iwasm /iwasm
|
||||
COPY --from=base /home/wamr/product-mini/platforms/linux/build/iwasm /usr/bin/iwasm
|
||||
COPY --from=base /home/wamr/product-mini/platforms/linux/build/libiwasm.so /lib/libiwasm.so
|
||||
COPY --from=base /home/wamr/product-mini/platforms/linux/build/libwasi-nn-*.so /lib/
|
||||
|
||||
ENTRYPOINT [ "/iwasm" ]
|
||||
ENTRYPOINT [ "iwasm" ]
|
||||
|
||||
Reference in New Issue
Block a user