summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/tests/benchmarks/sightglass/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/tests/benchmarks/sightglass/build.sh')
-rwxr-xr-xfluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/tests/benchmarks/sightglass/build.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/tests/benchmarks/sightglass/build.sh b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/tests/benchmarks/sightglass/build.sh
new file mode 100755
index 000000000..c7192c16f
--- /dev/null
+++ b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/tests/benchmarks/sightglass/build.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Copyright (C) 2019 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+OUT_DIR=$PWD/out
+WAMRC_CMD=$PWD/../../../wamr-compiler/build/wamrc
+SHOOTOUT_CASES="base64 fib2 gimli heapsort matrix memmove nestedloop \
+ nestedloop2 nestedloop3 random seqhash sieve strchr \
+ switch2"
+
+if [ ! -d sightglass ]; then
+ git clone https://github.com/wasm-micro-runtime/sightglass.git
+fi
+
+mkdir -p ${OUT_DIR}
+
+cd sightglass/benchmarks/shootout
+
+for bench in $SHOOTOUT_CASES
+do
+ echo "Build ${bench}_native"
+ gcc -O3 -o ${OUT_DIR}/${bench}_native -Dblack_box=set_res -Dbench=${bench} \
+ -I../../include ${bench}.c main/main_${bench}.c main/my_libc.c
+
+ echo "Build ${bench}.wasm"
+ /opt/wasi-sdk/bin/clang -O3 -nostdlib \
+ -Wno-unknown-attributes \
+ -Dblack_box=set_res \
+ -I../../include -DNOSTDLIB_MODE \
+ -Wl,--initial-memory=1310720,--allow-undefined \
+ -Wl,--strip-all,--no-entry \
+ -o ${OUT_DIR}/${bench}.wasm \
+ -Wl,--export=app_main -Wl,--export=_start \
+ ${bench}.c main/main_${bench}.c main/my_libc.c
+
+
+ echo "Compile ${bench}.wasm into ${bench}.aot"
+ ${WAMRC_CMD} -o ${OUT_DIR}/${bench}.aot ${OUT_DIR}/${bench}.wasm
+done
+
+cd ..
+
+echo "Done"