[Bug 815] New: The Orocos macros link my component to OCL, the deployer does not find my component

http://bugs.orocos.org/show_bug.cgi?id=815

Summary: The Orocos macros link my component to OCL, the
deployer does not find my component
Product: Toolchain
Version: master
Platform: Other
OS/Version: Other
Status: NEW
Severity: critical
Priority: P5
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: charles [dot] lesire [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

This bug appears in master, not in toolchain-2.2.
I have related it to RTT, as I think it comes from the UseOrocos macros

I have reproduced my bug by:
- orocreate-pkg foo
- cd foo && make

Then, when I load the generated library on the deployer, the component Foo is
not loaded.

It seems to me that this comes from the fact that my component library is
linked to ocl, and then the ComponentLoader only loads the first encoutered
components (HelloWorld and co), then not coming to my component description.

To correct this behaviour in two ways:
- either by having my component not linked with ocl; reading the UseOrocos
cmake files, I found:
SET(OROCOS_NO_AUTO_LINKING TRUE)
- or by defining my component in a set of components (even if I have only one
component in my library:
ORO_CREATE_COMPONENT_TYPE()
ORO_LIST_COMPONENT_TYPE(Foo)

In both cases, the Foo component is available in the deployer.

[Bug 815] The Orocos macros link my component to OCL, the deploy

http://bugs.orocos.org/show_bug.cgi?id=815

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED

--- Comment #2 from Peter Soetens <peter [..] ...> 2011-02-24 22:10:11 CET ---
(In reply to comment #0)
> This bug appears in master, not in toolchain-2.2.
> I have related it to RTT, as I think it comes from the UseOrocos macros
>
> I have reproduced my bug by:
> - orocreate-pkg foo
> - cd foo && make
>
> Then, when I load the generated library on the deployer, the component Foo is
> not loaded.
>
> It seems to me that this comes from the fact that my component library is linked
> to ocl, and then the ComponentLoader only loads the first encoutered components
> (HelloWorld and co), then not coming to my component description.
>
> To correct this behaviour in two ways:
> - either by having my component not linked with ocl; reading the UseOrocos cmake
> files, I found:
> SET(OROCOS_NO_AUTO_LINKING TRUE)
> - or by defining my component in a set of components (even if I have only one
> component in my library:
> ORO_CREATE_COMPONENT_TYPE()
> ORO_LIST_COMPONENT_TYPE(Foo)
>
> In both cases, the Foo component is available in the deployer.

There is a patch on toolchain-2.2 that should resolve this issue, even if you
link with OCL or another component.

We'll have to assume that linking component B to component A will happen more
in the future. The expected behavior will be that if B was linked to A, and you
import B, A will also be available. Importing A explicitly would then lead to
these 'replace' messages, ie, that the component was already known.

Peter

[Bug 815] The Orocos macros link my component to OCL, the deploy

http://bugs.orocos.org/show_bug.cgi?id=815

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |peter [..] ...

--- Comment #1 from Peter Soetens <peter [..] ...> 2011-02-14 14:48:46 CET ---
(In reply to comment #0)
> This bug appears in master, not in toolchain-2.2.
> I have related it to RTT, as I think it comes from the UseOrocos macros
>
> I have reproduced my bug by:
> - orocreate-pkg foo
> - cd foo && make
>
> Then, when I load the generated library on the deployer, the component Foo is
> not loaded.
>
> It seems to me that this comes from the fact that my component library is
> linked to ocl, and then the ComponentLoader only loads the first encoutered
> components (HelloWorld and co), then not coming to my component description.

This is a correct analysis and indeed a bug.

>
> To correct this behaviour in two ways:
> - either by having my component not linked with ocl; reading the UseOrocos
> cmake files, I found:
> SET(OROCOS_NO_AUTO_LINKING TRUE)

This indeed prevents this linking.

> - or by defining my component in a set of components (even if I have only one
> component in my library:
> ORO_CREATE_COMPONENT_TYPE()
> ORO_LIST_COMPONENT_TYPE(Foo)
>
> In both cases, the Foo component is available in the deployer.

Correct, although I hadn't seen this coming. A third options is to:

- Remove the 'ocl' dependency from your manifest.xml file, and include
<rtt/Component.hp

instead of <ocl/Component.hp

I'll change the orocreate-pkg macros such that they no longer depend on OCL in
the first place.

An alternative is to use the ORO_CREATE_COMPONENT_TYPE() macros by default (We
should rename that macro to ORO_CREATE_COMPONENT_LIBRARY() for clarity!) such
that we're independent of any linking trouble in the future...

Thanks for figuring this out, this would have been a major show-stopper!

Peter