Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484)
Update the build scripts of sample workloads (meshoptimizer/bwa/wasm-av1) to use the wasi-sdk-12.0 firstly to build the workload and discard clang-11, as wasi-sdk-12 supports wasi, simd and pthread better. And update the related documents. Also modify wasm mini loader to sync up with the change of wasm normal loader. Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
@ -8,21 +8,7 @@ WebAssembly with simd support and run it with iwasm.
|
||||
|
||||
please refer to [installation instructions](../README.md).
|
||||
|
||||
## Build with EMSDK
|
||||
|
||||
just run the convenience script:
|
||||
|
||||
```bash
|
||||
./build.sh
|
||||
```
|
||||
|
||||
it is going to build wasm-av1 and run it with iwasm, which basically contains the following steps:
|
||||
- hack emcc to delete some objects in libc.a
|
||||
- patch wasm-av1 and build it with emcc compiler
|
||||
- build iwasm with simd and libc-emcc support
|
||||
- run testav1.aot with iwasm
|
||||
|
||||
## Or build with clang-11 and wasi-sdk
|
||||
## Build with wasi-sdk
|
||||
|
||||
``` shell
|
||||
$ mkdir build && cd build
|
||||
@ -32,6 +18,20 @@ $ make
|
||||
$ ls testavx.wasm
|
||||
```
|
||||
|
||||
## Or build with EMSDK
|
||||
|
||||
just run the convenience script:
|
||||
|
||||
```bash
|
||||
./build.sh
|
||||
```
|
||||
|
||||
the script builds wasm-av1 and runs it with iwasm, which basically contains the following steps:
|
||||
- hack emcc to delete some objects in libc.a
|
||||
- patch wasm-av1 and build it with emcc compiler
|
||||
- build iwasm with simd and libc-emcc support
|
||||
- run testav1.aot with iwasm
|
||||
|
||||
### Run workload
|
||||
|
||||
Firstly please build iwasm with simd support:
|
||||
@ -46,11 +46,9 @@ $ make
|
||||
Then compile wasm file to aot file and run:
|
||||
|
||||
``` shell
|
||||
$ cd <wamr dir>/wamr-compiler/build
|
||||
$ ./wamrc --enable-simd -o testavx.aot testavx.wasm
|
||||
$ cd <wamr dir>/product-mini/platforms/linux/
|
||||
$ # copy sample data like <wamr dir>/samples/workload/wasm-av1/av1/third_party/samples/elephants_dream_480p24.ivf
|
||||
$ # copy testavx.aot
|
||||
$ # make sure you declare the access priority of the directory in which the sample data is
|
||||
$ ./iwasm --dir=. ./testavx.aot ./elephants_dream_480p24.ivf
|
||||
```
|
||||
$ cd <dir of testavx.wasm>
|
||||
$ <wamr dir>/wamr-compiler/build/wamrc --enable-simd -o testavx.aot testavx.wasm
|
||||
# copy sample data like <wamr dir>/samples/workload/wasm-av1/av1/third_party/samples/elephants_dream_480p24.ivf
|
||||
# make sure you declare the access priority of the directory in which the sample data is
|
||||
$ <wamr dir>/product-mini/platforms/linux/build/iwasm --dir=. testavx.aot elephants_dream_480p24.ivf
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user