debug with qtcreator

debug OpenFOAM with qtcreator

  1. install qtcreator(in ubuntu: sudo apt-get install qtcreator)
  2. compile OpenFOAM in debug mode (take OF-4.1 as an example)
    • add a new alias in your .bashrc:
alias of41Debug='source \$HOME/OpenFOAM/OpenFOAM-4.1/etc/bashrc WM_COMPILE_OPTION=Debug'
- exec `of41Debug` in the terminal, and using `Allwmake` to compile.
  1. configure qtcreator
    • New Project, Import Project, Imort Existing Project
      image
    • For example: sprayFoam. You can also import \src\thermophysicalModels, or \src\thermophysicalModels\basic.
      image
    • add two filters, *.C and *.H.
      image
    • configure Projects: delete make all and add a new Custom Process Step following below pictures.
      PS: only solvers need this step. lib can skip this.
      image
      image
      image
  2. enjoy debugging! Switch to solver if you open more than one projects. Ant click the debug button!
    simple notes: F5–> next break point; F10–>next statement.
    image
Author: Yan Zhang
Link: https://openfoam.top/qtcreator/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
微信打赏