Skip to content

Commit

Permalink
[docs] Add "Enable Quicker Builds" section to development.md (#4074)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjacobgordon authored Mar 5, 2025
1 parent 602d068 commit 96da98b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,33 @@ We recommend linting and formatting your commits _before_ the CI has a chance to

### With CMake

#### (Optional) Enable Quicker Builds

For workflows that demand frequent rebuilds, the following steps will allow you to specify the relevant options during configuration.

##### On Ubuntu

Install [Clang](https://clang.llvm.org/index.html), [ccache](https://ccache.dev/), and [LLD](https://lld.llvm.org/)

```shell
sudo apt install clang ccache lld
```

##### On Windows

1. Set up Developer PowerShell [for Visual Studio](https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022#start-in-visual-studio)
1. Ensure that the compiler and linker binaries are in the `PATH` variable.

#### Configure for Building...

Two setups are possible to build: in-tree and out-of-tree. The in-tree setup is the most straightforward, as it will build LLVM dependencies as well.

##### ...with LLVM "in-tree" using...

The following commands generate configuration files to build the project *in-tree*, that is, using llvm/llvm-project as the main build. This will build LLVM as well as torch-mlir and its subprojects. On Windows, use the "Developer PowerShell for Visual Studio" to ensure that the compiler and linker binaries are in the `PATH` variable.
The following commands generate configuration files to build the project *in-tree*, that is, using llvm/llvm-project as the main build. This will build LLVM as well as torch-mlir and its subprojects.

###### ...Base + Optimization Options

This requires `lld`, `clang`, `ccache`, and other dependencies for building `libtorch` / `PyTorch` wheels from source. If you run into issues because of these, try the [simplified build command](#base-options).
This will build `libtorch` / `PyTorch` wheels from source and requires [the enablement mentioned earlier](#optional-enable-quicker-builds). If you encounter issues when you run this, try the [simplified build command](#base-options) instead.

```shell
cmake -GNinja -Bbuild \
Expand Down

0 comments on commit 96da98b

Please sign in to comment.