Skip to content

Commit f1ded43

Browse files
leetcodezvgvassilev
authored andcommitted
[Docs] Add LLVM troubleshooting guide and improve WSL setup
1 parent 2b39393 commit f1ded43

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,19 @@ If you have already added `conda-forge` as a channel, the `-c conda-forge` is un
288288
conda config --add channels conda-forge
289289
conda update --all
290290
```
291+
### Windows Users (WSL2 & VS Code)
292+
293+
If you are developing on Windows using WSL2, it is highly recommended to use the WSL Extension(https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for Visual Studio Code.
294+
295+
**Setup Steps:**
296+
1. Install the WSL extension in VS Code.
297+
2. Open your Ubuntu terminal.
298+
3. Navigate to the project directory `cd clad`.
299+
4. Launch VS Code from inside the terminal by typing: `code .`
300+
301+
**Why?**
302+
Opening the folder directly from Windows can cause build errors due to incorrect compiler paths (MSVC vs Clang). Using the WSL extension ensures VS Code runs natively in the Linux environment.
303+
291304

292305
### Building from source (example was tested on Ubuntu 24.04 LTS)
293306
```
@@ -302,6 +315,23 @@ make && make install
302315

303316
> **NOTE**: On some Linux distributions (e.g. Arch Linux), the LLVM and Clang libraries are installed at `/usr/lib/cmake/llvm` and `/usr/lib/cmake/clang`. If compilation fails with the above provided command, ensure that you are using the correct path to the libraries.
304317
318+
319+
> **Troubleshooting LLVM Versions:**
320+
> If CMake fails or finds an old version (e.g., LLVM 6.0) instead of LLVM 18+, ensure your `PATH` is correct. You can verify this by running `llvm-config --version`. If it returns an old version, export the correct path before building:
321+
> ```bash
322+
> export PATH=/usr/lib/llvm-18/bin:$PATH
323+
324+
**Note**: This change is temporary. To make it permanent, add the export line to your shell configuration file (e.g., ~/.bashrc or ~/.zshrc) and run source ~/.bashrc."
325+
> ```
326+
327+
### Windows Users (WSL2 & VS Code)
328+
If you are developing on Windows using WSL2, use the [WSL Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for Visual Studio Code to avoid compiler errors.
329+
330+
**Setup Steps:**
331+
1. Open your Ubuntu terminal (WSL).
332+
2. Navigate to the project: `cd clad`
333+
3. Launch VS Code from *inside* the terminal: `code .`
334+
305335
### Building from source (example was tested on macOS)
306336
```
307337
brew install llvm@21

0 commit comments

Comments
 (0)