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:
@ -1,43 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
DEPS_DIR=${PWD}/../../../core/deps
|
||||
|
||||
cd ${DEPS_DIR}
|
||||
if [ ! -d "llvm" ]; then
|
||||
echo "Clone llvm to core/deps/ .."
|
||||
git clone https://github.com/llvm-mirror/llvm.git
|
||||
fi
|
||||
|
||||
cd llvm
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
if [ ! -f bin/llvm-lto ]; then
|
||||
|
||||
CORE_NUM=$(nproc --all)
|
||||
if [ -z "${CORE_NUM}" ]; then
|
||||
CORE_NUM=1
|
||||
fi
|
||||
|
||||
echo "Build llvm with" ${CORE_NUM} "cores"
|
||||
|
||||
cmake .. \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DCMAKE_BUILD_TYPE:STRING="Release" \
|
||||
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \
|
||||
-DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
|
||||
-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF \
|
||||
-DLLVM_APPEND_VC_REV:BOOL=OFF
|
||||
make -j ${CORE_NUM}
|
||||
|
||||
else
|
||||
echo "llvm has already been built"
|
||||
fi
|
||||
|
||||
cd ${PWD}
|
||||
|
||||
/usr/bin/env python3 ../../../build-scripts/build_llvm.py --platform android
|
||||
|
||||
10
product-mini/platforms/darwin/build_jit.sh
Executable file
10
product-mini/platforms/darwin/build_jit.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
rm -fr build && mkdir build
|
||||
cd build
|
||||
cmake .. -DWAMR_BUILD_JIT=1
|
||||
make
|
||||
cd ..
|
||||
6
product-mini/platforms/darwin/build_llvm.sh
Executable file
6
product-mini/platforms/darwin/build_llvm.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
/usr/bin/env python3 ../../../build-scripts/build_llvm.py --platform darwin
|
||||
@ -3,44 +3,4 @@
|
||||
# Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
DEPS_DIR=${PWD}/../../../core/deps
|
||||
|
||||
cd ${DEPS_DIR}
|
||||
if [ ! -d "llvm" ]; then
|
||||
echo "Clone llvm to core/deps/ .."
|
||||
git clone --depth 1 --branch release/11.x https://github.com/llvm/llvm-project.git llvm
|
||||
fi
|
||||
|
||||
cd llvm
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
if [ ! -f bin/llvm-lto ]; then
|
||||
|
||||
CORE_NUM=$(nproc --all)
|
||||
if [ -z "${CORE_NUM}" ]; then
|
||||
CORE_NUM=1
|
||||
fi
|
||||
|
||||
echo "Build llvm with" ${CORE_NUM} "cores"
|
||||
|
||||
cmake ../llvm \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DCMAKE_BUILD_TYPE:STRING="Release" \
|
||||
-DLLVM_TARGETS_TO_BUILD:STRING="X86;ARM;AArch64;Mips" \
|
||||
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \
|
||||
-DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
|
||||
-DLLVM_ENABLE_ZLIB:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_DOCS:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF \
|
||||
-DLLVM_APPEND_VC_REV:BOOL=OFF
|
||||
make -j ${CORE_NUM}
|
||||
|
||||
else
|
||||
echo "llvm has already been built"
|
||||
fi
|
||||
|
||||
cd ${PWD}
|
||||
|
||||
/usr/bin/env python3 ../../../build-scripts/build_llvm.py
|
||||
|
||||
@ -1,69 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import pathlib
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
def clone_llvm():
|
||||
llvm_dir = Path("llvm")
|
||||
if(llvm_dir.exists() == False):
|
||||
print("Clone llvm to core/deps/ ..")
|
||||
for line in os.popen("git clone --branch release/11.x https://github.com/llvm/llvm-project.git llvm"):
|
||||
print(line)
|
||||
else:
|
||||
print("llvm source codes already existed")
|
||||
return llvm_dir
|
||||
|
||||
def main():
|
||||
current_os = sys.platform
|
||||
print("current OS is ", current_os)
|
||||
|
||||
current_dir = Path.cwd()
|
||||
deps_dir = current_dir.joinpath( "../../../core/deps")
|
||||
|
||||
os.chdir(deps_dir)
|
||||
llvm_dir = clone_llvm()
|
||||
os.chdir(llvm_dir)
|
||||
|
||||
build_dir_name = "win32build"
|
||||
llvm_file = "LLVM.sln"
|
||||
|
||||
Path(build_dir_name).mkdir(exist_ok = True)
|
||||
build_dir = Path(build_dir_name)
|
||||
os.chdir(build_dir)
|
||||
|
||||
if ( not Path(llvm_file).exists()):
|
||||
core_number = os.cpu_count()
|
||||
print("Build llvm with", core_number, " cores")
|
||||
cmd = 'cmake ../llvm \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
||||
-DCMAKE_BUILD_TYPE:STRING="Release" \
|
||||
-DLLVM_TARGETS_TO_BUILD:STRING="X86;ARM;AArch64;Mips" \
|
||||
-DLLVM_INCLUDE_GO_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_UTILS=OFF \
|
||||
-DLLVM_ENABLE_TERMINFO=OFF \
|
||||
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \
|
||||
-DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
|
||||
-DLLVM_ENABLE_ZLIB:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_DOCS:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
|
||||
-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF \
|
||||
-DLLVM_APPEND_VC_REV:BOOL=OFF'
|
||||
print(cmd)
|
||||
for line in os.popen(cmd):
|
||||
print(line)
|
||||
else:
|
||||
print("llvm has already been Cmaked")
|
||||
|
||||
print("Please open LLVM.sln in {} to build *Release* version".format(build_dir.absolute()))
|
||||
|
||||
os.chdir(current_dir)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
script = (
|
||||
pathlib.Path(__file__)
|
||||
.parent.joinpath("../../../build-scripts/build_llvm.py")
|
||||
.resolve()
|
||||
)
|
||||
subprocess.check_call([sys.executable, script])
|
||||
|
||||
Reference in New Issue
Block a user