Windows Subsystem for Linux

The Windows Subsystem for Linux is an alternative way to setup a complete development environment on Windows. It offers a Linux environment with a seamless bridge to the Windows world. We recommend this setup for Windows developers.

Setup

  • Install WSL2 by following this guide. Important: Choose Ubuntu 22.04 LTS as the Linux distribution. Other distributions may not have a sufficient compiler.
  • Optional but recommended: Install the new Windows Terminal
  • Follow the developer guide for Linux from now on.

Using Visual Studio Code as IDE

You can use the native Windows Visual Studio Code IDE (VS Code) for developing in the WSL. It offers code completion, CMake integration, an integrated debugger, git integration and more.

Setup

Build and debug OGS

  • Configure your project by following this guide. Select GCC 11.3.0 (or higher, depending on your installed version) as the CMake kit.
  • Follow this guide for debug a target. Select ogs as the debug target.

Additional notes

The filesystem of the WSL is not inside your regular user directories. You can find it by running explorer.exe . inside the WSL shell. It should be something like \\wsl$\Ubuntu-22.04\home\[username]\....

You can also run OGS inside the WSL with benchmarks located in your regular Windows directories. You regular filesystem can be accessed inside WSL with the /mnt/c/-prefix. E.g. to run an OGS benchmark:

bin/ogs -o _out /mnt/c/Users/[username]/ogs-src/Tests/Data/Elliptic/square_1x1_SteadyStateDiffusion/square_1e0.prj

This article was written by Lars Bilke. If you are missing something or you find an error please let us know.
Generated with Hugo 0.122.0 in CI job 493443 | Last revision: September 23, 2024
Commit: [MeL/IO/XDMF] Return also computed parent data type 09baf91  | Edit this page on