views:

891

answers:

7

I have a few large projects I am working on in my new place of work, which have a complicated set of statically linked library dependencies between them.

The libs number around 40-50 and it's really hard to determine what the structure was initially meant to be, there isn't clear documentation on the full dependency map.

What tools would anyone recommend to extract such data?

Presumably, in the simplest manner, if did the following:

  1. define the set of paths which correspond to library units

  2. set all .cpp/.h files within those to belong to those compilation units

  3. capture the 1st order #include dependency tree

One would have enough information to compose a map - refactor - and recompose the map, until one has created some order.

I note that http://www.ndepend.com have something nice but that's exclusively .NET unfortunately.

I read something about Doxygen being able accomplish some static dependency analysis with configuration; has anyone ever pressed it into service to accomplish such a task?

+3  A: 

This link leads to:

CppDepend

Tim
Now this is what I was looking for. I felt jealous of what the NDepend product could do. However it's really the mountains of legacy C++ we need to maintain that is most sorely in need of tools such as this.
polyglot
+3  A: 

This tool is excellent for analyzing the include tree: IncludeManager. You should be able to get a lot of useful information from that tool.

Regards,

Sebastiaan

Sebastiaan Megens
Thanks for the link - I used it once before but I couldn't find the option to show project level dependency analysis, though it is shown on the website...
polyglot
+1  A: 

IncludeFinder is a free tool I have used before successfully.

peterchen
Thanks, it looks a little out of date but a couple of people have mentioned it, so it must have had its heyday at one stage. :)
polyglot
since it had source, I could make some minor modifications that suited my immediate needs. But yeah, it ain't shiny ;)
peterchen
A: 

I am due to start working with a large scale c++ project that is need of dependency management, so naturally I have been looking around at some tools. I was suprised to see that CppDepend was flagged as the favorite here as a single license costs €300, whereas IncludeManager is £20.. And does the same job. Just in case anyone here has used either or both tools, is there "good" reason why I should spend the extra £280 (£1~€1) for CppDepend?

*Please note that I would like to have my own personal copy so whether the company has it or not is irrelevant.

Alistair
+1  A: 

http://github.com/yuzhichang/cppdep may be what you want. I wrote it for analyzing dependencies among components/packages/package groups of a large C/C++ project. It's a rewrite of dep_utils(adep/cdep/ldep) which is provided by John Lakos' book Large-Scale C++ Software Design.

Zhichang Yu
thanks, appreciated.
polyglot
+1  A: 

You might be able to use DoxyS as help, which produces graps representing included files as part of the generated documentation.

See: http://www.doxys.org

-Martin

Martin L
Thanks - I had found doxygen excellent for exploring open source projects, will give this a go also.
polyglot
A: 

I'm very surprised when i see a comparison beteween CppDepend and IncludeManager, it's two very different products, with CppDepend we have arround 60 metrics concerning implementation, design and architecture + CQL language to query code as SQL + many useful views like DSM,metric view and can be integrated to build process to generate custom reports.

Issam
At the time the question was asked, cppdepend was barely in beta.
polyglot