Describe how to get --debug and --debug-only flags in dev notes (#2793)

Change should be visible :
https://github.com/newling/torch-mlir/blob/docs_update/docs/development.md
pull/2831/head
James Newling 2024-01-30 08:30:00 -08:00 committed by GitHub
parent 1e882f5803
commit 9d983161fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 2 deletions

View File

@ -45,12 +45,12 @@ cmake -GNinja -Bbuild \
-DLLVM_TARGETS_TO_BUILD=host \
externals/llvm-project/llvm
```
The following additional quality of life flags can be used to reduce build time:
#### Flags that can reduce build time:
* Enabling clang on Linux
```shell
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
```
* Enabling ccache:
* Enabling ccache
```shell
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
```
@ -72,6 +72,14 @@ By default we download the latest version of libtorch. We have an experimental p
-DLIBTORCH_VARIANT=shared # Set the variant of libtorch to build / link against. (`shared`|`static` and optionally `cxxabi11`)
```
#### Flags to enable MLIR debugging:
* Enabling `--debug` and `--debug-only` flags (see [MLIR docs](https://mlir.llvm.org/getting_started/Debugging/)) for the `torch-mlir-opt` tool
```shell
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ # or =Debug
-DIREE_ENABLE_ASSERTIONS=ON \
```
### Building against a pre-built LLVM
If you have built llvm-project separately in the directory `$LLVM_INSTALL_DIR`, you can also build the project *out-of-tree* using the following command as template: