Comments (13)
The current running time with pypy:
- 3s for parsing and creating components
- ~7s to analyze and plot the graph (networkx)
SUMMARY: Components: 10254 Cycles: 1 Levels: 20 CCD: 14748 ACCD: 1.438268 NCCD: 0.116692(typical range is [0.85, 1.10])
from cppdep.
@rakhimov Could you please provide the test setup of this run (invokation location of cppdep, file system structure, config.yml, etc.). As there is no documentation right now this would help others to understand how to use cppdep...
from cppdep.
@fkromer This is the initial setup (used with cppdep 0.1.0).
Currently, the configuration file is under refactoring,
so the meaning of paths and setup are likely to change.
Anyhow, please feel free to contribute to the wiki of the project.
from cppdep.
Boost source is from the archive (not the git repositories).
from cppdep.
@rakhimov Thanks. I will do so.
from cppdep.
@rakhimov I tried it with the github boost sources:
~/ws_github $ git clone https://github.com/boostorg/boost.git
...
~/ws_github $ cd boost/
~/ws_github/boost $ virtualenv -p /usr/bin/python3.4 pyvenv
...
~/ws_github/boost $ source pyvenv/bin/activate
(pyvenv) ~/ws_github/boost $ pip install cppdep
...
I added the config_boost.xml in /ws_github/cppdep (with adjusted boost src directory, c++ stl version):
<cppdep>
<package-group name="Boost" path=".">
<include-path/> <!-- The project group root path -->
<src-path>libs</src-path>
</package-group>
<package-group role="external" name="STD" path="/usr/include">
<include-path/>
<package name="STL">
<include-path>c++/4.8</include-path>
</package>
<package name="BoostExternal">
<alias-path>boost</alias-path> <!-- The fake project to find headers -->
</package>
</package-group>
</cppdep>
I ran cppdep:
(pyvenv) ~/ws_github/boost $ cppdep -c ./config_boost.xml
Traceback (most recent call last):
...
File "/home/florian/ws_github/boost/pyvenv/lib/python3.4/site-packages/cppdep.py", line 358, in _update
(path, self.group.path, self.group.name))
cppdep.InvalidArgumentError: boost is not a directory in /usr/include (group STD).
Did you installed boost into /usr/include/boost as "fake project to find headers"?
from cppdep.
Yes, the reason is #32
from cppdep.
The c++ stl and boost is expected to be installed, if not installed yet:
~/ws_github/boost $ sudo apt-get install build-essential
~/ws_github/boost $ sudo apt-get install libboost-all-dev
Now I get:
(pyvenv) ~/ws_github/boost $ cppdep -c ./config_boost.xml
################################################################################
analyzing dependencies among packages in the specified package group Boost ...
================================================================================
1 level(s):
level 0:
level 1:
.
libs
================================================================================
SUMMARY:
Components: 2 Cycles: 0 Levels: 1
CCD: 2 ACCD: 1.000000 NCCD: 0.725982(typical range is [0.85, 1.10])
Traceback (most recent call last):
File "/home/florian/ws_github/boost/pyvenv/bin/cppdep", line 11, in <module>
sys.exit(main())
File "/home/florian/ws_github/boost/pyvenv/lib/python3.4/site-packages/cppdep.py", line 735, in main
analysis.make_graph(printer, args)
File "/home/florian/ws_github/boost/pyvenv/lib/python3.4/site-packages/cppdep.py", line 695, in make_graph
AssertionError
from cppdep.
I think the problem is that you are getting Boost from the git repo.
The configuration is for Boost 1.56 from the archive (distributed by release).
I think a better configuration would be to have a configuration for each sub-project within Boost
as is done for git with git submodules.
from cppdep.
Right, I give it a try...
from cppdep.
I checked out all the submodules:
~/ws_github/boost $ git submodule update --init --recursive --remote --no-fetch
But I got a lot of errors when I ran cppcheck over all of them in a single run:
TypeError: not all arguments converted during string formatting
...
Message: 'include issues: duplicate include:'
...
Message: 'include issues: include order:'
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 371: invalid start byte
from cppdep.
This 'utf-8' and other bugs have been fixed in the current development:
https://github.com/rakhimov/cppdep/milestone/2?closed=1
This is still work in progress.
I would say, for now, please wait till the configuration file stabilizes with version 0.2.0.
I hope the example configuration file and schema should be enough to grasp how to setup a project analysis.
from cppdep.
I added a separate config_boost_filesystem.xml in boost/libs/filesystem:
<cppdep>
<package-group name="Boost filesystem" path=".">
<include-path/> <!-- The project group root path -->
<src-path>src</src-path>
</package-group>
<package-group role="external" name="STD" path="/usr/include">
<include-path/>
<package name="STL">
<include-path>c++/4.8</include-path>
</package>
<package name="BoostExternal">
<alias-path>boost</alias-path> <!-- The fake project to find headers -->
</package>
</package-group>
</cppdep>
I ran:
(pyvenv) ~/ws_github/boost/libs/filesystem $ cppdep -c ./config_boost_filesystem.xml
...got some warnings and errors but was able to display the diagrams (requires xdot, if not installed yet: sudo apt-get install xdot
):
(pyvenv) ~/ws_github/boost/libs/filesystem $ xdot 'Boost filesystem_src.dot'
(pyvenv) ~/ws_github/boost/libs/filesystem $ xdot 'Boost filesystem.dot'
from cppdep.
Related Issues (20)
- YAML configuration/project file instead of XML
- Configuration and Path Validation
- Separate reports for packages/groups/graphs HOT 1
- Behavior specification for anomalous conflicting component files HOT 1
- Logging: Type Error: not all arguments converted during string formatting
- Python3 UnicodeDecodeError for 'utf-8' in source files
- Handle 'ipp' template implementation/source files
- Handle header files without extensions for components
- Test on Qt/Qt Creator projects
- Test on Linux source
- Windows: Unicode Escape Error NetworkX, pydotplus and Python 2.7
- Accept glob string for paths
- Options to disable/enable warnings
- PyPI installation failure due to the project structure
- cppdep from PyPI running twice per call
- Include Wrangler Analysis
- Missing 'pydot' dependency fails on networkx nx_pydot
- Python 3.6 os.path.commonprefix expects List HOT 1
- Missing graph module HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppdep.