Build OPENFOAM from Source and Debug with VisualCode
Hello,
Season's greetings! Can someone please help me with setting up the openfoam repository in visual studio code or any other opensource IDE. I wish to debug into the source code repository with my added functions. Any lead or step-by-step process to do this will be appreciated. Thanks |
Hello Claudia
First compile OpenFOAM in debug mode. For that you have to set the following environment variable to Debug in $WM_PROJECT_DIR/etc/bashrc before compiling OpenFOAM Code:
# [WM_COMPILE_OPTION] - Optimised(default), debug, profiling, other: Then you have to install VSCode and the C/C++ extension (from MicroSoft)... Now, load OpenFOAM environment and open the VSCode in the root of your project, Code:
cd path/to/my/project Hover over one of the missing header files and click on the "Quick Fix..." and then click on the "Edit includePath settings". It will open a tab + create a .vscode directory in the root of the workspace. Close the tab! Open the file [font=courier]c_cpp_properties.json[font] and edit it as follows Code:
{ If you have any other directories that contain source code, you can also put them here. for example Code:
{ If you also want to run & debug your code in VSCode, you can follow links below, |
Hi reverseila! On it :)
Thank you so much for the details. Really appreciate it. |
All times are GMT -4. The time now is 07:07. |