Implement SIMD latest opcodes and update LLVM to 13.0 (#758)

Implement the latest SIMD opcodes and update LLVM 13.0,
update the llvm build scripts, update the sample workloads‘ build scripts,
and build customized wasi-sdk to build some workloads.
Also refine the CI rules.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-09-17 19:12:57 +08:00
committed by GitHub
parent 7e60a5db8d
commit 7be0d385a6
82 changed files with 5266 additions and 4698 deletions

View File

@ -1,18 +1,83 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
FROM ubuntu:18.04
ARG VARIANT=need_to_assign
FROM ubuntu:${VARIANT}
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asian/Shanghai
RUN apt update \
&& apt install -y apt-transport-https ca-certificates gnupg \
software-properties-common wget lsb-release curl build-essential
tzdata lsb-release software-properties-common build-essential \
apt-utils curl wget git tree unzip zip vim
#
# CMAKE (https://apt.kitware.com/)
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null \
&& apt purge --auto-remove cmake \
&& apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' \
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg > /dev/null \
&& echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt update \
&& apt-get install -y kitware-archive-keyring \
&& rm /etc/apt/trusted.gpg.d/kitware.gpg \
&& apt-get install -y cmake
&& rm /usr/share/keyrings/kitware-archive-keyring.gpg \
&& apt install -y kitware-archive-keyring \
&& apt install -y cmake
#
# install emsdk (may not necessary ?)
RUN cd /opt \
&& git clone https://github.com/emscripten-core/emsdk.git
RUN cd /opt/emsdk \
&& git pull \
&& ./emsdk install 2.0.26 \
&& ./emsdk activate 2.0.26 \
&& echo "source /opt/emsdk/emsdk_env.sh" >> /root/.bashrc
#
#install wabt
ARG WABT_VER=1.0.23
RUN wget -c https://github.com/WebAssembly/wabt/releases/download/${WABT_VER}/wabt-${WABT_VER}-ubuntu.tar.gz -P /opt
RUN tar xf /opt/wabt-${WABT_VER}-ubuntu.tar.gz -C /opt \
&& ln -fs /opt/wabt-${WABT_VER} /opt/wabt
RUN rm /opt/wabt-${WABT_VER}-ubuntu.tar.gz
#
# install binaryen
ARG BINARYEN_VER=version_101
RUN wget -c https://github.com/WebAssembly/binaryen/releases/download/${BINARYEN_VER}/binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz -P /opt
RUN tar xf /opt/binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz -C /opt \
&& ln -fs /opt/binaryen-${BINARYEN_VER} /opt/binaryen
RUN rm /opt/binaryen-${BINARYEN_VER}-x86_64-linux.tar.gz
#
# install bazelisk
ARG BAZELISK_VER=1.10.1
RUN mkdir /opt/bazelisk
RUN wget -c https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VER}/bazelisk-linux-amd64 -P /opt/bazelisk
RUN chmod a+x /opt/bazelisk/bazelisk-linux-amd64 \
&& ln -fs /opt/bazelisk/bazelisk-linux-amd64 /opt/bazelisk/bazel
# set path
RUN echo "PATH=/opt/clang_llvm/bin:/opt/wasi-sdk/bin:/opt/wabt/bin:/opt/binaryen/bin:/opt/bazelisk:${PATH}" >> /root/.bashrc
#
# install
RUN apt update \
&& apt install -y ninja-build python2.7 valgrind
#
# ocaml
RUN apt update \
&& apt install -y ocaml ocamlbuild
#
# PS
RUN echo "PS1='\n[ \u@wamr-dev-docker \W ]\n$ '" >> /root/.bashrc
# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
VOLUME workspace
WORKDIR workspace

View File

@ -1,24 +1,33 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
docker build -t wamr_dev:0.1 -f Dockerfile . \
&& docker run --rm -it \
--name wamr_building \
--mount type=bind,src=$(realpath .)/..,dst=/source \
--workdir /source \
wamr_dev:0.1 \
/bin/bash -c "\
pushd product-mini/platforms/linux \
&& mkdir -p build \
&& pushd build \
&& rm -rf * \
&& cmake .. \
&& make \
&& popd \
&& popd \
&& echo 'Copying binary for image build' \
&& mkdir -p build_out \
&& rm build_out/* \
&& cp -f product-mini/platforms/linux/build/iwasm build_out/iwasm"
readonly CURRENT_PATH=$(dirname "$(realpath "$0")")
readonly ROOT=$(realpath "${CURRENT_PATH}/..")
readonly VARIANT=$(lsb_release -c | awk '{print $2}')
docker build \
--build-arg VARIANT=${VARIANT} \
--memory=4G --cpu-quota=50000 \
-t wamr_dev_${VARIANT}:0.1 -f "${CURRENT_PATH}"/Dockerfile "${CURRENT_PATH}" &&
docker run --rm -it \
--cpus=".5" \
--memory=4G \
--name wamr_build_env \
--mount type=bind,src="${ROOT}",dst=/workspace \
wamr_dev_${VARIANT}:0.1 \
/bin/bash -c "\
pwd \
&& pushd product-mini/platforms/linux \
&& rm -rf build \
&& mkdir build \
&& pushd build \
&& cmake .. \
&& make \
&& popd \
&& popd \
&& echo 'Copying the binary ...' \
&& rm -rf build_out \
&& mkdir build_out \
&& cp product-mini/platforms/linux/build/iwasm build_out/iwasm"