mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-06-11 15:49:29 +00:00

`wasi-sdk-20` pre-release can be used to avoid building `wasi-libc` to enable threads. It's not possible to use `wasi-sdk-20` pre-release on Ubuntu 20.04 because of incompatibility with the glibc version: ```bash /opt/wasi-sdk/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /opt/wasi-sdk/bin/clang) ```
25 lines
466 B
Markdown
25 lines
466 B
Markdown
# "WASI threads" sample introduction
|
|
|
|
To run the sample, `wasi-sdk` >= 20 is required.
|
|
|
|
## Build and run the samples
|
|
|
|
```shell
|
|
$ mkdir build
|
|
$ cd build
|
|
$ cmake ..
|
|
$ make
|
|
...
|
|
$ ./iwasm wasm-apps/no_pthread.wasm
|
|
...
|
|
$ ./iwasm wasm-apps/exception_propagation.wasm
|
|
```
|
|
|
|
## Run samples in AOT mode
|
|
```shell
|
|
$ ../../../wamr-compiler/build/wamrc \
|
|
--enable-multi-thread \
|
|
-o wasm-apps/no_pthread.aot wasm-apps/no_pthread.wasm
|
|
$ ./iwasm wasm-apps/no_pthread.aot
|
|
```
|