Giter Site home page Giter Site logo

Test on Boost project about cppdep HOT 13 OPEN

rakhimov avatar rakhimov commented on July 28, 2024
Test on Boost project

from cppdep.

Comments (13)

rakhimov avatar rakhimov commented on July 28, 2024

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.

fkromer avatar fkromer commented on July 28, 2024

@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.

rakhimov avatar rakhimov commented on July 28, 2024

@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.

rakhimov avatar rakhimov commented on July 28, 2024

Boost source is from the archive (not the git repositories).

from cppdep.

fkromer avatar fkromer commented on July 28, 2024

@rakhimov Thanks. I will do so.

from cppdep.

fkromer avatar fkromer commented on July 28, 2024

@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.

rakhimov avatar rakhimov commented on July 28, 2024

Yes, the reason is #32

from cppdep.

fkromer avatar fkromer commented on July 28, 2024

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.

rakhimov avatar rakhimov commented on July 28, 2024

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.

fkromer avatar fkromer commented on July 28, 2024

Right, I give it a try...

from cppdep.

fkromer avatar fkromer commented on July 28, 2024

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.

rakhimov avatar rakhimov commented on July 28, 2024

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.

fkromer avatar fkromer commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.