[Bug 804] New: OCL cross compile problem and RTT compile warning

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

Summary: OCL cross compile problem and RTT compile warning
Product: Toolchain
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P3
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: peter [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

When i compile RTT 2.2.0 i have this warning :

Quote:

sources/orocos-rtt-2.2.0/rtt/internal/ConnFactory.cpp: In static member
function 'static RTT::base::ChannelElementBase::shared_ptr
RTT::internal::ConnFactory::createRemoteConnection(RTT::base::OutputPortInterface&,
RTT::base::InputPortInterface&, const RTT::ConnPolicy&)':
sources/orocos-rtt-2.2.0/rtt/internal/ConnFactory.cpp:83:16: warning:
converting 'false' to pointer type for argument 1 of
'boost::intrusive_ptr<T>::intrusive_ptr(T*, bool) [with T =
RTT::base::ChannelElementBase]'
sources/orocos-rtt-2.2.0/rtt/internal/ConnFactory.cpp:89:16: warning:
converting 'false' to pointer type for argument 1 of
'boost::intrusive_ptr<T>::intrusive_ptr(T*, bool) [with T =
RTT::base::ChannelElementBase]'

When i compile OCL 2.2.0 i have these error (it's a cross compilation case see
below) :

Quote:

-- Optional library RTT_PLUGIN_rtt-scripting NOT FOUND. If the library is
already installed, use the RTT_PLUGIN_rtt-scripting_ROOT_DIR environment
variable or ccmake to set the missing variables manually.
-- Optional library RTT_PLUGIN_rtt-marshalling NOT FOUND. If the library is
already installed, use the RTT_PLUGIN_rtt-marshalling_ROOT_DIR environment
variable or ccmake to set the missing variables manually.

and later

Quote:

TaskBrowser.cpp:(.text+0x4a22): undefined reference to
`RTT::scripting::Parser::Parser(RTT::TaskContext*)'
...

Would it be possible to compile without manually defining
RTT_PLUGIN_rtt-scripting_ROOT_DIR ?
As i cross compile i use a CMAKE_INSTALL_PREFIX that refer to a target path and
an OROCOS_INSTALL that refer to an host path. Is there any mistake ?

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #14 from Philippe Hamelin <philippe [dot] hamelin [..] ...> 2011-07-05 14:35:12 CEST ---
(In reply to comment #13)
> Hi.
>
> With the Philippe's patch that is in 2.3.2, the compilation works well.
>
> There are still some problems at runtime.
>
> First the RTT COMPONENT PATH isn't set to the target local tree. In
> rtt/rtt/plugin/CMakeLists.txt, for example, DEFAULT_PLUGIN_PATH is set to
> "${CMAKE_INSTALL_PREFIX}/lib/orocos". But in ocl/deployment/CMakeLists.txt,
> DEFAULT_COMPONENT_PATH is set to "${OROCOS-RTT_PATH}/lib/orocos". The problem
> is that OROCOS-RTT_PATH is a build machine path. So i purpose a patch that
> replace OROCOS-RTT_PATH by CMAKE_INSTALL_PREFIX.

I also had this problem, but not really solved it. I just overrided the default
value using the environment variable RTT_COMPONENT_PATH. The proposed
workaround works only if RTT has been installed in the default install
directory. However, I don't have any better solution to propose right now.

>
> The second problem is that deployer-corba-gnulinux, for example, still depends
> on librtt-marshalling-gnulinux. But its rpath lack the plugins directory. So i
> purpose a patch that add
> ${CMAKE_INSTALL_PREFIX}/lib/orocos${OROCOS_SUFFIX}/plugins to the rpath.
>

Damn. I already fixed that but I forgot to push it to my branch. You can find
the commit here :

https://github.com/phamelin/orocos-ocl/commit/ec806c7f5adb1f1bf2deb13369...

I will send an e0mail on the mailing list to make sure this is merged in 2.5.

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #13 from Chavent Paul <paul [dot] chavent [..] ...> 2011-07-05 14:18:56 CEST ---
Hi.

With the Philippe's patch that is in 2.3.2, the compilation works well.

There are still some problems at runtime.

First the RTT COMPONENT PATH isn't set to the target local tree. In
rtt/rtt/plugin/CMakeLists.txt, for example, DEFAULT_PLUGIN_PATH is set to
"${CMAKE_INSTALL_PREFIX}/lib/orocos". But in ocl/deployment/CMakeLists.txt,
DEFAULT_COMPONENT_PATH is set to "${OROCOS-RTT_PATH}/lib/orocos". The problem
is that OROCOS-RTT_PATH is a build machine path. So i purpose a patch that
replace OROCOS-RTT_PATH by CMAKE_INSTALL_PREFIX.

The second problem is that deployer-corba-gnulinux, for example, still depends
on librtt-marshalling-gnulinux. But its rpath lack the plugins directory. So i
purpose a patch that add
${CMAKE_INSTALL_PREFIX}/lib/orocos${OROCOS_SUFFIX}/plugins to the rpath.

Please comment these patches.

Paul.

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #12 from Chavent Paul <paul [dot] chavent [..] ...> 2011-07-05 14:07:45 CEST ---
Created attachment 715
--> http://bugs.orocos.org/attachment.cgi?id=715
Fix the rtt component path.

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #11 from Chavent Paul <paul [dot] chavent [..] ...> 2011-07-05 14:07:25 CEST ---
Created attachment 714
--> http://bugs.orocos.org/attachment.cgi?id=714
Fix the rpath.

[Bug 804] OCL cross compile problem and RTT compile warning

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

Philippe Hamelin <philippe [dot] hamelin [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |philippe [dot] hamelin [..] ...

--- Comment #10 from Philippe Hamelin <philippe [dot] hamelin [..] ...> 2011-07-04 19:37:49 CEST ---
(In reply to comment #9)
> (In reply to comment #6)
> >
> > This patch obselete the previous patch
> > orocos-ocl-2.2.0-crosscompil_rpath.patch, but I didn't needed the two other
> > patches to make it work.
>
> What is the version this patch apply to ?
>

I'm using 2.3.1.

> The compilation fails for me (2.3.2) :
>
> Linking CXX executable cdeployer-gnulinux
> /home/ressac/work/pip22/sdk/work/pip22/toolchain_root/opt/pip22/lib/gcc/i686-pip22-linux-gnu/4.5.3/../../../../i686-pip22-linux-gnu/bin/ld:
> warning: librtt-marshalling-gnulinux.so.2.3.2, needed by
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2, not found (try using
> -rpath or -rpath-link)
> /home/ressac/work/pip22/sdk/work/pip22/toolchain_root/opt/pip22/lib/gcc/i686-pip22-linux-gnu/4.5.3/../../../../i686-pip22-linux-gnu/bin/ld:
> warning: librtt-scripting-gnulinux.so.2.3.2, needed by
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2, not found (try using
> -rpath or -rpath-link)
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to `RTT::marsh::PropertyLoader::configure(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, RTT::TaskContext*, bool)
> const'
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to `RTT::marsh::PropertyDemarshaller::deserialize(RTT::PropertyBag&)'
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to `RTT::marsh::PropertyDemarshaller::~PropertyDemarshaller()'
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to `RTT::marsh::PropertyLoader::save(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, RTT::TaskContext*, bool)
> const'
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to
> `RTT::marsh::PropertyDemarshaller::PropertyDemarshaller(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)'
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to `RTT::Scripting::Scripting(RTT::TaskContext*)'
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to `typeinfo for RTT::Scripting'
> ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
> to `RTT::marsh::PropertyLoader::load(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, RTT::TaskContext*)
> const'
> collect2: ld returned 1 exit status

Are you sure you applied the patch? Because this is exactly the error the patch
should fix.

Re: [Bug 804] OCL cross compile problem and RTT compile warning

phamelin wrote:

Are you sure you applied the patch? Because this is exactly the error the patch should fix.

Sorry. I "reversed-applied" the patch :(

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #9 from Chavent Paul <paul [dot] chavent [..] ...> 2011-07-04 19:12:04 CEST ---
(In reply to comment #6)
>
> This patch obselete the previous patch
> orocos-ocl-2.2.0-crosscompil_rpath.patch, but I didn't needed the two other
> patches to make it work.

What is the version this patch apply to ?

The compilation fails for me (2.3.2) :

Linking CXX executable cdeployer-gnulinux
/home/ressac/work/pip22/sdk/work/pip22/toolchain_root/opt/pip22/lib/gcc/i686-pip22-linux-gnu/4.5.3/../../../../i686-pip22-linux-gnu/bin/ld:
warning: librtt-marshalling-gnulinux.so.2.3.2, needed by
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2, not found (try using
-rpath or -rpath-link)
/home/ressac/work/pip22/sdk/work/pip22/toolchain_root/opt/pip22/lib/gcc/i686-pip22-linux-gnu/4.5.3/../../../../i686-pip22-linux-gnu/bin/ld:
warning: librtt-scripting-gnulinux.so.2.3.2, needed by
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2, not found (try using
-rpath or -rpath-link)
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to `RTT::marsh::PropertyLoader::configure(std::basic_string<char,
std::char_traits const'
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to `RTT::marsh::PropertyDemarshaller::deserialize(RTT::PropertyBag&)'
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to `RTT::marsh::PropertyDemarshaller::~PropertyDemarshaller()'
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to `RTT::marsh::PropertyLoader::save(std::basic_string<char,
std::char_traits const'
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to
`RTT::marsh::PropertyDemarshaller::PropertyDemarshaller(std::basic_string<char,
std::char_traits ../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to `RTT::Scripting::Scripting(RTT::TaskContext*)'
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to `typeinfo for RTT::Scripting'
../deployment/liborocos-ocl-deployment-gnulinux.so.2.3.2: undefined reference
to `RTT::marsh::PropertyLoader::load(std::basic_string<char,
std::char_traits const'
collect2: ld returned 1 exit status

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #8 from Chavent Paul <paul [dot] chavent [..] ...> 2011-07-04 18:38:01 CEST ---
Hi

I have a question for you.

Is the find RTTPlugin interface still required.

It seems to be redundant with the job that is done in UseOROCOS-RTT.cmake.

But i'am not sure.

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #7 from Chavent Paul <paul [dot] chavent [..] ...> 2011-07-04 18:36:05 CEST ---
Created attachment 713
--> http://bugs.orocos.org/attachment.cgi?id=713
Don't use find RTTPlugin

[Bug 804] OCL cross compile problem and RTT compile warning

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

Philippe Hamelin <philippe [dot] hamelin [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #622 is|0 |1
obsolete| |
Attachment #623 is|0 |1
obsolete| |
Attachment #624 is|0 |1
obsolete| |

--- Comment #6 from Philippe Hamelin <philippe [dot] hamelin [..] ...> 2011-04-08 17:59:34 CEST ---
Created attachment 676
--> http://bugs.orocos.org/attachment.cgi?id=676
Fix OCL linking error when cross-compiling

Here is an alternative workaround for bug 804. Executables linked with
ocl-deployment or ocl-taskbrowser weren't linking correctly when
cross-compiling. The executables weren't explicitely linked with the
dependencies of ocl-deployment and ocl-taskbrowser. Therefore, the linker was
using the shared libraries RPATH property to find out the path of the plugins.
This isn't good because the encoded RPATH is using a full path while the linker
seems to look at it relative to the provided sysroot. The proposed workaround
it to force the executables to link with dependencies of ocl-deployment and
ocl-taskbrowser.

An alternative workaround would be to encode the RPATH relative to the sysroot
when building. I know when can override the INSTALL_RPATH, but how about the
build RPATH? Also, I prefer the proposed workaround, since on Windows there's
no RPATH and it's a better idea to have an explicit linking.

This patch obselete the previous patch
orocos-ocl-2.2.0-crosscompil_rpath.patch, but I didn't needed the two other
patches to make it work.

[Bug 804] OCL cross compile problem and RTT compile warning

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

Chavent Paul <paul [dot] chavent [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |paul [dot] chavent [..] ...

--- Comment #5 from Chavent Paul <paul [dot] chavent [..] ...> 2011-02-26 09:46:28 CET ---
(In reply to comment #4)
> Could the original reporter of these issues ping me to sort this out ?
>
> (this bug report was a copy/paste from a post on the mailing list)
>
> Peter

Hello Peter.

I have reported these issues. I currently use these patches for
cross-compiling.

[Bug 804] OCL cross compile problem and RTT compile warning

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

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

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED

--- Comment #4 from Peter Soetens <peter [..] ...> 2011-02-25 00:40:11 CET ---
(In reply to comment #0)
> When i compile RTT 2.2.0 i have this warning :
>
>

Quote:

> sources/orocos-rtt-2.2.0/rtt/internal/ConnFactory.cpp: In static member function
> 'static RTT::base::ChannelElementBase::shared_ptr
> RTT::internal::ConnFactory::createRemoteConnection(RTT::base::OutputPortInterface&,
> RTT::base::InputPortInterface&, const RTT::ConnPolicy&)':
> sources/orocos-rtt-2.2.0/rtt/internal/ConnFactory.cpp:83:16: warning: converting
> 'false' to pointer type for argument 1 of
> 'boost::intrusive_ptr<T>::intrusive_ptr(T*, bool) [with T =
> RTT::base::ChannelElementBase]'
> sources/orocos-rtt-2.2.0/rtt/internal/ConnFactory.cpp:89:16: warning: converting
> 'false' to pointer type for argument 1 of
> 'boost::intrusive_ptr<T>::intrusive_ptr(T*, bool) [with T =
> RTT::base::ChannelElementBase]'
>

>
> When i compile OCL 2.2.0 i have these error (it's a cross compilation case see
> below) :
>
>
Quote:

> -- Optional library RTT_PLUGIN_rtt-scripting NOT FOUND. If the library is
> already installed, use the RTT_PLUGIN_rtt-scripting_ROOT_DIR environment
> variable or ccmake to set the missing variables manually.
> -- Optional library RTT_PLUGIN_rtt-marshalling NOT FOUND. If the library is
> already installed, use the RTT_PLUGIN_rtt-marshalling_ROOT_DIR environment
> variable or ccmake to set the missing variables manually.
>

>
> and later
>
>
Quote:

> TaskBrowser.cpp:(.text+0x4a22): undefined reference to
> `RTT::scripting::Parser::Parser(RTT::TaskContext*)'
> ...
>

>
> Would it be possible to compile without manually defining
> RTT_PLUGIN_rtt-scripting_ROOT_DIR ?
> As i cross compile i use a CMAKE_INSTALL_PREFIX that refer to a target path and
> an OROCOS_INSTALL that refer to an host path. Is there any mistake ?

Could the original reporter of these issues ping me to sort this out ?

(this bug report was a copy/paste from a post on the mailing list)

Peter

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #3 from Peter Soetens <peter [..] ...> 2011-01-24 21:51:11 CET ---
Created attachment 624
--> http://bugs.orocos.org/attachment.cgi?id=624
orocos-rtt-2.2.0-crosscompil_find_library.patch

For temporary fixing these problem, i use those patches.

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #2 from Peter Soetens <peter [..] ...> 2011-01-24 21:50:38 CET ---
Created attachment 623
--> http://bugs.orocos.org/attachment.cgi?id=623
orocos-ocl-2.2.0-crosscompil_rpath.patch

[Bug 804] OCL cross compile problem and RTT compile warning

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

--- Comment #1 from Peter Soetens <peter [..] ...> 2011-01-24 21:50:12 CET ---
Created attachment 622
--> http://bugs.orocos.org/attachment.cgi?id=622
patch orocos-ocl-2.2.0-crosscompil_find_library.patch