Skip to content


Subversion checkout URL

You can clone with
Download ZIP
This a rewrite of dep_utils(adep/cdep/ldep) which is provided by John Lakos' book Large-Scale C++ Software Design.
Branch: master

README is designed for analyzing dependencies among components/packages/package groups of a large C/C++ project.
This a rewrite of dep_utils(adep/cdep/ldep) which is provided by John Lakos' book "Large-Scale C++ Software Design", Addison Wesley (1996).
The location of dep_utils source code indicated at the book is outdated and I only find a copy of it (via Google) at

Differences to original dep_utils:
1) More maintainable. Rewrite in Python.
2) Easier to use. Only one simple XML config file need. Unified adep/dep/cdep into one.
3) Remove file alias support since the file name length limitation is much relax the 20 years ago.
4) Support multiple package groups and packages
5) Support exporting final dependency graph to Graphviz dot format.

The objective of this tool is to detect following cases in source code:
1) Failed to associate some headers/dotC files with any component.
2) File name conflicts. 
2.1) File basename conflicts among our headers. For example, libA/List.h and libA/List.hpp, libA/Stack.h and libB/Stack.hpp.
2.2) File basename conflicts among our dotCs. For example, libA/ and libA/List.cpp, libA/ and libB/Stack.cpp
2.3) File name conflicts between our and outside headers. For example, libA/map.h and /usr/include/c++/4.4/debug/map.h.
3) Including issues:
3.1) Some headers included directly or indirectly don't exist.
3.2) DotC does not depend on its associated header.
3.3) DotC does not include its associated header directly.
3.4) DotC does not include its associated header before other headers.
4) Cycle dependencies among components/packages/package groups.
Note: A component consists of a pair of one dotH and one dotC, and the basenames of them match. For example, (Foo.h, Foo.cpp).

Each of above cases is considered as a quality flaw and should be removed by revising the code.

1) Warning 1 results lost dependencies. 
2) Warning 2 often results incorrect dependencies, especailly when those conflict files' context are different.
3) Warning 3.1 inticates a piece of dead code including non-exiting headers. If the header does exist at another path, you need to add that path into the configuration XML in order to get back the lost dependencies.
4) Warning 3.2 often results incorrect dependencies.
5) There are another cases may result lost dependencies. For example, [1] a dotC declares global variable or function instead of including a header which does the declaration. [2] Embedded dynamic dependencies such as dynamic loading and configurable internal services.
6) There are another cases may result incorrect dependencies. For example, a piece of dead code of includes bar.h, and bar.h happens do exist in another package/package group.

1) Python 2.7
2) NetworkX from
Note: NetworkX 1.7 and all of its dependencies can be installed on LinuxMint 15 as following:
$ sudo apt-get install python-networkx

Here's how to convert a Graphviz dot file to PDF format.
$ dot -Tpdf -o graph1.pdf

1) Analyze bottlenecks. "...we consider classes that refer to more than 20 other classes and which are referred to by more than 20 other clesses as critical. On the level of subsystems the critical limit is 10 referring and referred to subsysmtems." -- Klaus Wolfmaier and Rudolf Ramler: Common Findings and Lessons Learned from Software Architecture and Design Analysis, 

External links:
1) dependency-alalysis is a part of static-code-analysis. There are several commercial products which are able to do dependency-alalysis on
2) Here is a discuss on C++ project dependency analysis: 
3) Nmdepend is a lightweight 'link-time' dependency analyzer for C++. It uses object files and libraries instead of source-code as input. It runs UNIX and Cygwin. ( 
Something went wrong with that request. Please try again.