Wenyong Huang 773efc006d Change WASM_ANYREF to WASM_EXTERNREF (#3426) 1 jaar geleden
..
src 773efc006d Change WASM_ANYREF to WASM_EXTERNREF (#3426) 1 jaar geleden
CMakeLists.txt 16a4d71b34 Implement GC (Garbage Collection) feature for interpreter, AOT and LLVM-JIT (#3125) 1 jaar geleden
README.md 27e7e160af Upgrade toolkits (#1878) 2 jaren geleden

README.md

WAMR supports wasm-c-api in both interpreter mode and aot mode.

Before staring, we need to download and intall WABT.

$ cd /opt
$ wget https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz
$ tar -xzf wabt-1.0.31-ubuntu.tar.gz
$ mv wabt-1.0.31 wabt

By default, all samples are compiled and run in "interpreter" mode.

$ mkdir build
$ cd build
$ cmake ..
$ make
$ # it will build a library with c-api supporting.
$ # Also copy *.wasm from ../src/
$ # and generate executable files
$ # now, it is ok to run samples
$ ./hello
$ ...
$ ./global
$ ...
$ ./callback
$ ...

They can be compiled and run in aot mode when some compiling flags are given.

$ mkdir build
$ cd build
$ cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_AOT=1 ..
$ make
$ # it will build a library with c-api supporting.
$ # Also copy *.wasm from ../src/
$ # and transform *.wasm to *.aot
$ # and generate executable files
$ # now, it is ok to run samples
$ ./hello
$ ...
$ ./global
$ ...
$ ./callback
$ ...