Difference between revisions of "Dependency Graphs"

From GnuCash
Jump to: navigation, search
(dot options (from IRC))
m (missed one)
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
Luckily cmake (our build system generation tool) has built-in support for the graphviz dependency visualization tool.
 
Luckily cmake (our build system generation tool) has built-in support for the graphviz dependency visualization tool.
 
+
;Requirement: The [{{URL:wp}}Graphviz graphviz] package, which also includes <tt>dot</tt>.
 
To use it you can use these commands:
 
To use it you can use these commands:
  
Line 11: Line 11:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
;dot options: -Grankdir=LR for horizontal layout,
 
;dot options: -Grankdir=LR for horizontal layout,
: -Tpng to get a png.
+
: -Tpng to get a png (change output file extension to png as well)
 
This will result in lots of files in the graphviz directory. The one we're interested in is '''graph.svg'''.
 
This will result in lots of files in the graphviz directory. The one we're interested in is '''graph.svg'''.
  
Below you'll find two examples.
+
;Two examples from 2019-12-08:
 +
:[{{URL:mail archive|devel}}attachments/20191208/ec29cbcd/attachment-0002.svg Graph for maint]
 +
:[{{URL:mail archive|devel}}attachments/20191208/ec29cbcd/attachment-0003.svg Graph for master]
 +
;Note: In between the naming convention of branches changed:
 +
:maint &rarr; stable
 +
:master &rarr; future

Latest revision as of 02:36, 28 May 2025

GnuCash is a complex project. To keep some structure in the code, the source files are grouped into targets. Higher level targets can depend on lower level targets. That means, the lower level targets must be built before the higher level target can be built. Given the complexity, it may be challenging to get a view of these dependencies.

Luckily cmake (our build system generation tool) has built-in support for the graphviz dependency visualization tool.

Requirement
The graphviz package, which also includes dot.

To use it you can use these commands:

mkdir graphviz && cd graphviz
cmake --graphviz=graph ..
dot graph -Tsvg -o graph.svg
dot options
-Grankdir=LR for horizontal layout,
-Tpng to get a png (change output file extension to png as well)

This will result in lots of files in the graphviz directory. The one we're interested in is graph.svg.

Two examples from 2019-12-08
Graph for maint
Graph for master
Note
In between the naming convention of branches changed:
maint → stable
master → future