Visual Studio Code is a powerful text editor that can be extended into a full-featured IDE using plugins. This guide walks you through setting up debugging for OpenGeoSys (OGS) on macOS and Linux.
On macOS:
xcode-select --installOn Linux:
sudo apt update
sudo apt install build-essential cmake gdb lldb ninja-buildgit clone https://gitlab.opengeosys.org/ogs/ogs.git
cd ogs
cmake --preset debug
ninja -C build/debug ogsThis creates a debug build in build/debug/.
Download from https://code.visualstudio.com
In the Extensions view (Ctrl+Shift+X on Linux, Cmd+Shift+X on macOS), install:
Open the source code ogs/ folder in VS Code.
To build OGS from within VS Code:
mkdir -p .vscode
cat > .vscode/tasks.json <<EOF
{
"version": "2.0.0",
"tasks": [
{
"label": "Build OGS (CMake debug)",
"type": "shell",
"command": "cmake --preset debug && ninja -C ../build/debug ogs",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
EOFTo run the build task, press Shift + Command + B on macOS or Ctrl+Shift+B on Linux.
Create .vscode/launch.json:
[ "${PWD##*/}" = ".vscode" ] || cd .vscode
cat > launch.json <<EOF
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug with LLDB",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/../build/debug/bin/ogs",
"args": [
"${workspaceFolder}/Tests/Data/LIE/Mechanics/coulomb_load_path.prj"
],
"cwd": "${workspaceFolder}/../build/debug",
"stopOnEntry": false,
"externalConsole": false
}
]
}
EOFApplications/CLI/ogs.cpp.main() function.
F5 (Linux) / Fn + F5 (macOS).launch.json (e.g., Debug with LLDB).
This article was written by Mostafa Mollaali, Lars Bilke. If you are missing something or you find an error please let us know.
Generated with Hugo 0.147.9
in CI job 639840
|
Last revision: September 27, 2025
Commit: [cmake] Remove linker warnings when building mpmetis. 852270d
| Edit this page on