orocos-toolchain / orogen

Code generator for components and type handling in Rock - the Robot Construction Kit - and the Orocos Toolchain
http://rock-robotics.org
Other
4 stars 35 forks source link

remove the inclusion of Types.hpp in the CORBA transport #16

Closed doudou closed 10 years ago

doudou commented 10 years ago

Types.hpp was still used in the Convertions.hpp header for the CORBA transport. This commit generates a TypesFwd.hpp with forward declarations, with the expected benefits of reduced compilation times, reduced memory usage and reduced recompilation (removes unnecessary dependencies). This has no side effects from the user side as it is only used by the generated code.

On my test project (control/orogen/auv_control), running

/usr/bin/time -v make -C build/.orogen/typekit/transports/corba

shows a saving of 20s (33%) for the compilation times and of 150M on the memory usage (20%) with gcc 4.9 on a (very old) Core 2 Duo.

RAW DATA Before: User time (seconds): 56.37 System time (seconds): 3.46 Percent of CPU this job got: 98% Elapsed (wall clock) time (h:mm:ss or m:ss): 1:01.02 Maximum resident set size (kbytes): 726596

After: User time (seconds): 37.69 System time (seconds): 2.58 Percent of CPU this job got: 98% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:40.69 Maximum resident set size (kbytes): 577604

doudou commented 10 years ago

@marvin2k: since you had a look at #15 (which is related), could you check this one as well ?

marvin2k commented 10 years ago

If you make me a day having 48 hours I'd love to ;-) As I said back there, rebuild failed but I did not investigate.

doudou commented 10 years ago

Also marked as DO NOT MERGE until a full build has been done with it

doudou commented 10 years ago

The updated version includes #18 and builds all of Rock without problem. On top of it, it's actually much simpler.

doudou commented 10 years ago

@psoetens: could you check whether this fixes your problem ?

doudou commented 10 years ago

@goldhoorn, @annaborn: same question, please check whether this fixes the problem you encountered (#20)

annaborn commented 10 years ago

@doudou: this patch results for me in error in base/orogen/std:

std.orogen:30: cannot load one of the header files /home/dfki.uni-bremen.de/aborn/DFKI/LIMES/ROCK_test/install/include/orogen_metadata/Metadata.hpp: wrong number of arguments(1 for 2) (Orocos::Generation::ConfigError)

In std.orogen:30

export_types "metadata/Component"

The Component structure is present in install/include/orogen_metadata/Metadata.hpp.

doudou commented 10 years ago

Damn ... Forgot to mention This depends on https://github.com/orocos-toolchain/typelib/pull/19

Probably the problem you're having

annaborn commented 10 years ago

Thank you a lot! After applying the paches orocos-toolchain/orogen#16 and orocos-toolchain/typelib#19 it resolved the problems with base/orogen/std and missing boost types in convertion. But sadly, it comes now to other build error in drivers/orogen/monster_interface:

drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp: In function 'bool orogen_typekits::toCORBA(orogen::base::Corba::Angle*, const base::Angle*, int)':
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:766:37: error: no matching function for call to 'toCORBA(orogen::base::Corba::Angle&, const base::Angle&)'
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:766:37: note: candidates are:
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:156:6: note: bool orogen_typekits::toCORBA(orogen::base::Corba::DoubleArray&, const base::DoubleArray&)
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:156:6: note:   no known conversion for argument 1 from 'orogen::base::Corba::Angle' to 'orogen::base::Corba::DoubleArray&'
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:169:6: note: bool orogen_typekits::toCORBA(orogen::base::Corba::Flag&, const base::Flag&)
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:169:6: note:   no known conversion for argument 1 from 'orogen::base::Corba::Angle' to 'orogen::base::Corba::Flag&'
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:182:6: note: bool orogen_typekits::toCORBA(orogen::base::Corba::IntArray&, const base::IntArray&)
drivers/orogen/monster_interface/.orogen/typekit/transports/corba/Convertions.cpp:182:6: note:   no known conversion for argument 1 from 'orogen::base::Corba::Angle' to 'orogen::base::Corba::IntArray&'

base::Angle is exported in base/orogen/types. All other types (like base::DoubleArray and base::Flag) come from monster_interface.

doudou commented 10 years ago

just added a fix for this error in the pull request (just re-merge the branch). I'm checking that Rock master builds with it, will update here once it passes.

doudou commented 10 years ago

Yep, Rock master still builds just fine.

annaborn commented 10 years ago

Successfully built and run! +1

doudou commented 10 years ago

Merged. Thanks @annaborn

goldhoorn commented 10 years ago

It seems that it trigged a new bug for me:

2014-10-30 11:24:00 +0100: running
    /usr/bin/ruby1.9.1 /home/goldhoorn/dev-avalon/tools/orogen/bin/orogen --corba --extended-states --extensions=metadata_support --import=std --no-rtt-scripting --parallel-build=4 --transports=corba,mqueue,typelib --type-export-policy=used base.orogen
in directory /home/goldhoorn/dev-avalon/base/orogen/types
/home/goldhoorn/dev-avalon/tools/utilrb/lib/utilrb/pkgconfig.rb:460: warning: Insecure world writable dir /opt/Xilinx in PATH, mode 040777
xml_find_template_parm encountered unsupported type identifier_node
xml_find_template_parm encountered unsupported type identifier_node
ESC[35mTypelib[WARN]: /usr/include/c++/4.9/exception:61: ignoring /std/exception, it has virtual methods
ESC[0mESC[35mTypelib[WARN]: /usr/include/c++/4.9/stdexcept:113: ignoring /std/runtime_error, it has ignored base classes
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/JointsTrajectory.hpp:39: ignoring /base/JointsTrajectory/InvalidTimeStep, it has ignored base classes
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:9: ignoring the empty struct/class /SISLCurve
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:368: ignoring the empty struct/class /base/geometry/SplineBaseClass<3>
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:366: ignoring the empty struct/class /base/geometry/SplineBaseClass<1>
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:21: ignoring /base/geometry/SplineBase since its field singleton is private
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:313: ignoring /base/geometry/Spline3Base, it has ignored base classes
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:368: ignoring typedef /type as it is part of /base/geometry/SplineBaseClass<3> which is ignored
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:366: ignoring typedef /type as it is part of /base/geometry/SplineBaseClass<1> which is ignored
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:374: cannot create the /base/geometry/Spline<1>/base_t typedef, as it points to /base/geometry/SplineBase which is ignored
ESC[0mESC[35mTypelib[WARN]: /usr/include/eigen3/Eigen/src/Core/Matrix.h:129: ignoring the empty struct/class /Eigen/Matrix</double,1,1,2,1,1>
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:375: cannot create the /base/geometry/Spline<1>/vector_t typedef, as it points to /Eigen/Matrix</double,1,1,2,1,1> which is ignored
ESC[0mESC[35mTypelib[WARN]: /usr/include/eigen3/Eigen/src/Geometry/Transform.h:177: ignoring the empty struct/class /Eigen/Transform</double,1,2,0>
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:376: cannot create the /base/geometry/Spline<1>/transform_t typedef, as it points to /Eigen/Transform</double,1,2,0> which is ignored
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:374: cannot create the /base/geometry/Spline<3>/base_t typedef, as it points to /base/geometry/Spline3Base which is ignored
ESC[0mESC[35mTypelib[WARN]: /usr/include/eigen3/Eigen/src/Geometry/Transform.h:177: ignoring /Eigen/Transform</double,3,2,0> since its field m_matrix is private
ESC[0mESC[35mTypelib[WARN]: /home/goldhoorn/dev-avalon/install/include/base/geometry/Spline.hpp:376: cannot create the /base/geometry/Spline<3>/transform_t typedef, as it points to /Eigen/Transform</double,3,2,0> which is ignored
ESC[0mxml_find_template_parm encountered unsupported type identifier_node
xml_find_template_parm encountered unsupported type identifier_node
xml_find_template_parm encountered unsupported type identifier_node
xml_find_template_parm encountered unsupported type identifier_node
===== Internal error =======
Please report the following error to the orogen developers
/home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:702:in `build': cannot find /base/Wrench_m in registry (Typelib::NotFound)
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:702:in `rescue in find_type'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:684:in `find_type'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:378:in `intermediate_type_for'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:1580:in `block (2 levels) in handle_opaques_generation'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:1579:in `map'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:1579:in `block in handle_opaques_generation'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:1578:in `each'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:1578:in `handle_opaques_generation'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/typekit.rb:1747:in `generate'
        from /home/goldhoorn/dev-avalon/tools/orogen/lib/orogen/gen/project.rb:677:in `generate'
        from /home/goldhoorn/dev-avalon/tools/orogen/bin/orogen:169:in `<main>'

On debian testing

goldhoorn commented 10 years ago

sorry seems unrelated but...

This error occurs only on the orogen_loaders branch... ...maybe it's time to merge the orogen_loaders into master?!

doudou commented 10 years ago

...maybe it's time to merge the orogen_loaders into master?!

I'll do that once the release stuff has been cleared. Not one minute before.