Skip to content

Commit 0eb788d

Browse files
authored
build_wamr.md: Update the document (#3074)
Add description for `WAMR_BUILD_LINUX_PERF`, `WAMR_BUILD_QUICK_AOT_ENTRY` and `WAMR_BUILD_MODULE_INST_CONTEXT`. And add some reference links.
1 parent 9f64340 commit 0eb788d

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

doc/build_wamr.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
6262
#### **Enable Multi-Module feature**
6363

6464
- **WAMR_BUILD_MULTI_MODULE**=1/0, default to disable if not set
65+
> Note: See [Multiple Modules as Dependencies](./multi_module.md) for more details.
6566
6667
#### **Enable WASM mini loader**
6768

@@ -82,6 +83,8 @@ cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
8283
- **WAMR_BUILD_LIB_PTHREAD**=1/0, default to disable if not set
8384
> Note: The dependent feature of lib pthread such as the `shared memory` and `thread manager` will be enabled automatically.
8485
86+
> See [WAMR pthread library](./pthread_library.md) for more details.
87+
8588
#### **Enable lib-pthread-semaphore**
8689
- **WAMR_BUILD_LIB_PTHREAD_SEMAPHORE**=1/0, default to disable if not set
8790
> Note: This feature depends on `lib-pthread`, it will be enabled automatically if this feature is enabled.
@@ -90,8 +93,11 @@ cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
9093
- **WAMR_BUILD_LIB_WASI_THREADS**=1/0, default to disable if not set
9194
> Note: The dependent feature of lib wasi-threads such as the `shared memory` and `thread manager` will be enabled automatically.
9295
96+
> See [wasi-threads](./pthread_impls.md#wasi-threads-new) and [Introduction to WAMR WASI threads](https://bytecodealliance.github.io/wamr.dev/blog/introduction-to-wamr-wasi-threads) for more details.
97+
9398
#### **Enable lib wasi-nn**
9499
- **WAMR_BUILD_WASI_NN**=1/0, default to disable if not set
100+
> Note: See [WASI-NN](../core/iwasm/libraries/wasi-nn) for more details.
95101
96102
#### **Enable lib wasi-nn GPU mode**
97103
- **WAMR_BUILD_WASI_NN_ENABLE_GPU**=1/0, default to disable if not set
@@ -137,12 +143,17 @@ cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
137143
> Note: if it is enabled, developer can use API `void wasm_runtime_dump_mem_consumption(wasm_exec_env_t exec_env)` to dump the memory consumption info.
138144
Currently we only profile the memory consumption of module, module_instance and exec_env, the memory consumed by other components such as `wasi-ctx`, `multi-module` and `thread-manager` are not included.
139145

146+
> Also refer to [Memory usage estimation for a module](./memory_usage.md).
147+
140148
#### **Enable performance profiling (Experiment)**
141149
- **WAMR_BUILD_PERF_PROFILING**=1/0, default to disable if not set
142150
> Note: if it is enabled, developer can use API `void wasm_runtime_dump_perf_profiling(wasm_module_inst_t module_inst)` to dump the performance consumption info. Currently we only profile the performance consumption of each WASM function.
143151
144152
> The function name searching sequence is the same with dump call stack feature.
145153
154+
> Also refer to [Tune the performance of running wasm/aot file](./perf_tune.md).
155+
156+
146157
#### **Enable the global heap**
147158
- **WAMR_BUILD_GLOBAL_HEAP_POOL**=1/0, default to disable if not set for all *iwasm* applications, except for the platforms Alios and Zephyr.
148159

@@ -192,7 +203,7 @@ Currently we only profile the memory consumption of module, module_instance and
192203
193204
#### **Enable source debugging features**
194205
- **WAMR_BUILD_DEBUG_INTERP**=1/0, default to 0 if not set
195-
> Note: There are some other setup required by source debugging, please refer to [source_debugging.md](./source_debugging.md) for more details.
206+
> Note: There are some other setup required by source debugging, please refer to [source_debugging.md](./source_debugging.md) and [WAMR source debugging basic](https://bytecodealliance.github.io/wamr.dev/blog/wamr-source-debugging-basic) for more details.
196207
197208
#### **Enable load wasm custom sections**
198209
- **WAMR_BUILD_LOAD_CUSTOM_SECTION**=1/0, default to disable if not set
@@ -207,12 +218,34 @@ Currently we only profile the memory consumption of module, module_instance and
207218
- **WAMR_BUILD_STACK_GUARD_SIZE**=n, default to N/A if not set.
208219
> Note: By default, the stack guard size is 1K (1024) or 24K (if uvwasi enabled).
209220
210-
### **Disable the writing linear memory base address to x86 GS segment register
221+
### **Disable the writing linear memory base address to x86 GS segment register**
211222
- **WAMR_DISABLE_WRITE_GS_BASE**=1/0, default to enable if not set and supported by platform
212223
> Note: by default only platform [linux x86-64](https://github.com/bytecodealliance/wasm-micro-runtime/blob/5fb5119239220b0803e7045ca49b0a29fe65e70e/core/shared/platform/linux/platform_internal.h#L67) will enable this feature, for 32-bit platforms it's automatically disabled even when the flag is set to 0. In linux x86-64, writing the linear memory base address to x86 GS segment register may be used to speedup the linear memory access for LLVM AOT/JIT, when `--enable-segue=[<flags>]` option is added for `wamrc` or `iwasm`.
213224
225+
> See [Enable segue optimization for wamrc when generating the aot file](./perf_tune.md#3-enable-segue-optimization-for-wamrc-when-generating-the-aot-file) for more details.
226+
214227
### **Enable running PGO(Profile-Guided Optimization) instrumented AOT file**
215228
- **WAMR_BUILD_STATIC_PGO**=1/0, default to disable if not set
229+
> Note: See [Use the AOT static PGO method](./perf_tune.md#5-use-the-aot-static-pgo-method) for more details.
230+
231+
### **Enable linux perf support**
232+
- **WAMR_BUILD_LINUX_PERF**=1/0, enable linux perf support to generate the flamegraph to analyze the performance of a wasm application, default to disable if not set
233+
> Note: See [Use linux-perf](./perf_tune.md#7-use-linux-perf) for more details.
234+
235+
### **Enable module instance context APIs**
236+
- **WAMR_BUILD_MODULE_INST_CONTEXT**=1/0, enable module instance context APIs which can set one or more contexts created by the embedder for a wasm module instance, default to enable if not set:
237+
```C
238+
wasm_runtime_create_context_key
239+
wasm_runtime_destroy_context_key
240+
wasm_runtime_set_context
241+
wasm_runtime_set_context_spread
242+
wasm_runtime_get_context
243+
```
244+
> Note: See [wasm_export.h](../core/iwasm/include/wasm_export.h) for more details.
245+
246+
### **Enable quick AOT/JTI entries**
247+
- **WAMR_BUILD_QUICK_AOT_ENTRY**=1/0, enable registering quick call entries to speedup the aot/jit func call process, default to enable if not set
248+
> Note: See [Refine callings to AOT/JIT functions from host native](./perf_tune.md#83-refine-callings-to-aotjit-functions-from-host-native) for more details.
216249
217250
**Combination of configurations:**
218251

0 commit comments

Comments
 (0)