Orocos RTT 1.6.0 with CORBA under Win32

Hello,

I extended the work from Bug 605 (
https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=605) to add Corba
support in Win32. I successfully tested the port with a gnulinux taskbrowser
connected to a win32 remote component. It wasn't so hard, except for ACE+TAO
that gave me some headaches. Here is the installation procedure (my comments
and future work suggestions will follow) :

=====================================
RTT-WIN32 (WITH CORBA) INSTALLATION PROCEDURE
=====================================

--------------------------------------------------------------------------
1. MINGW/MSYS
--------------------------------------------------------------------------

a) Download MinGW Automated Installer and select :

i. base tools
ii. g++ compiler
iii. make

b. Add the MinGW\bin in your PATH

--------------------------------------------------------------------------
2. BOOST
--------------------------------------------------------------------------

a) Download boost sources (I used version 1.34) and bjam for ntx86.

b) Uncompress boost sources and the bjam executable in the same directory.

c) Compile boost with the following command :

bjam --toolset=gcc -sTOOL=mingw --layout=system install

d) Take a coffee.

--------------------------------------------------------------------------
3. ACE+TAO
--------------------------------------------------------------------------

a) Download and uncompress TAO. I used TAO 1.5a from
http://www.theaceorb.com/downloads/1.5a/index.html .

b) Start a MSYS session

d) export ACE_ROOT=/c/ACE_wrappers/ (if your uncompressed it in
C:\ACE_Wrappers)

d) export TAO_ROOT=/c/ACE_wrappers/TAO/

e) Create a file called config.h in the $ACE_ROOT/ace directory that
contains:

#include "ace/config-win32.h"

f) Create a file called platform_macros.GNU in the
$ACE_ROOT/include/makeinclude directory containing:

include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU

g) cd $ACE_ROOT/ace

h) make

It may not compile since there is a conflicting declaration between ACE
(os_types.h) and MinGW (types.h) for newer release of
MinGW. If so, you may need to apply the ace-conflicting-declaration.patch .
It's a known bug from the DOC Group and this
will be corrected in the next micro release of ACE+TAO (x.6.9).

Tips : Use the gnu win32 patch program (
http://gnuwin32.sourceforge.net/packages/patch.htm) inside MSYS for better
results.

i) cd $TAO_ROOT

j) make

k) Take another coffee.

--------------------------------------------------------------------------
4. RTT
--------------------------------------------------------------------------

a) RTT-1.6-Win32 Checkout

- METHOD #1 (preferred): Download RTT-1.6.0 sourcs and apply patches from
https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=605

- METHOD #2 : Checkout the git branch of Peter : git://
github.com/psoetens/orocos-rtt.git (it seems that the boost test patch is
missing)

b) You need to apply two patches on RTT :

i. There is a redefinition problem between TAO and RTT for the timespec
structure. You need to apply the timespec-redefinition.patch .
ii. There is missing a lib for TAO (TAO_AnyTypeCode). You need to apply
add-tao-lib-to-cmake.patch .

c) set ACE_ROOT=C:\ACE_Wrappers

d) set TAO_ROOT=C:\ACE_Wrappers\TAO

e) Execute cmake -G"MinGW Makefiles"

f) Modify CMake cached values for your Boost and ACE+TAO paths as needed.
Also, you need to enable corba and make sure
that the target is win32.

g) Compile RTT with : mingw32-make

I had a compilation error inside inline functions of ACE (OS_NS_stdio.inl),
so I needed to do little modification to make it work. This is
a #ifdef condition problem. A bug report will be submitted soon for that. I
tried to disable inline functions to avoid that, but then I had
linking error which I was not able to manage. In brief, you need to apply a
patch on ACE 1.5a : ace-win32-mingw32-inline-problem.patch .

--------------------------------------------------------------------------
COMMENTS
--------------------------------------------------------------------------

1) It would be fine to avoid any modification to dependant library (ie.
ACE+TAO). There is currently two issues with ACE+TAO. The first one
(timespec-redefinition.patch) will be corrected in the next release. After
the bug report, I hope that the second
(ace-win32-mingw32-inline-problem.patch) will be also corrected. Then, no
modification would be required to ACE+TAO.

2) The tests didn't compile for me. The linker doesn't find orocos-rtt-win32
library. I'm not very familiar with CMake, so I hope that the boost tests
author can manage that.

3) It would be great to make all tests pass under win32. I currently don't
know why only 4 of 8 passes, but maybe someone that knows a bit of RTT core
can investigate that.

4) We would like to develop our application with RTT 1.8, so it's a major
drawback for us now that the RTT-win32 patches aren't applied on trunk. We
are now fixed to 1.6.0 since the patches are merged.

5) ACE+TAO is huge and not so user-friendly. It would be great to use
OmniOrb instead of TAO in Win32. I don't know if the current OmniOrb patch
can be directly applied in Win32.

6) The next proof of concept I have to do is to port the deployer on Win32.
The only issue seems to be for dlfcn. Maybe I will take a look at dlfcn for
Windows to minimize code porting (http://code.google.com/p/dlfcn-win32/).

I hope someone will have the time to test this procedure and give me
feedback.

Philippe Hamelin

AttachmentSize
ace-conflicting-declaration.patch499 bytes
timespec-redefinition.patch572 bytes
add-tao-lib-to-cmake.patch1 KB
ace-win32-mingw32-inline-problem.patch1.03 KB

Orocos RTT 1.6.0 with CORBA under Win32

Hello,

I managed to auto-generate the DEF file of the dynamic library, in order to
use it with MSVC compiler. Here is the patch.

Philippe Hamelin

2009/3/11 Philippe Hamelin <philippe [dot] hamelin [..] ...>

> Hello,
>
> I extended the work from Bug 605 (
> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=605) to add Corba
> support in Win32. I successfully tested the port with a gnulinux taskbrowser
> connected to a win32 remote component. It wasn't so hard, except for ACE+TAO
> that gave me some headaches. Here is the installation procedure (my comments
> and future work suggestions will follow) :
>
> =====================================
> RTT-WIN32 (WITH CORBA) INSTALLATION PROCEDURE
> =====================================
>
> --------------------------------------------------------------------------
> 1. MINGW/MSYS
> --------------------------------------------------------------------------
>
> a) Download MinGW Automated Installer and select :
>
> i. base tools
> ii. g++ compiler
> iii. make
>
> b. Add the MinGW\bin in your PATH
>
> --------------------------------------------------------------------------
> 2. BOOST
> --------------------------------------------------------------------------
>
> a) Download boost sources (I used version 1.34) and bjam for ntx86.
>
> b) Uncompress boost sources and the bjam executable in the same directory.
>
> c) Compile boost with the following command :
>
> bjam --toolset=gcc -sTOOL=mingw --layout=system install
>
> d) Take a coffee.
>
> --------------------------------------------------------------------------
> 3. ACE+TAO
> --------------------------------------------------------------------------
>
> a) Download and uncompress TAO. I used TAO 1.5a from
> http://www.theaceorb.com/downloads/1.5a/index.html .
>
> b) Start a MSYS session
>
> d) export ACE_ROOT=/c/ACE_wrappers/ (if your uncompressed it in
> C:\ACE_Wrappers)
>
> d) export TAO_ROOT=/c/ACE_wrappers/TAO/
>
> e) Create a file called config.h in the $ACE_ROOT/ace directory that
> contains:
>
> #include "ace/config-win32.h"
>
> f) Create a file called platform_macros.GNU in the
> $ACE_ROOT/include/makeinclude directory containing:
>
> include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU
>
> g) cd $ACE_ROOT/ace
>
> h) make
>
> It may not compile since there is a conflicting declaration between ACE
> (os_types.h) and MinGW (types.h) for newer release of
> MinGW. If so, you may need to apply the ace-conflicting-declaration.patch .
> It's a known bug from the DOC Group and this
> will be corrected in the next micro release of ACE+TAO (x.6.9).
>
> Tips : Use the gnu win32 patch program (
> http://gnuwin32.sourceforge.net/packages/patch.htm) inside MSYS for better
> results.
>
> i) cd $TAO_ROOT
>
> j) make
>
> k) Take another coffee.
>
> --------------------------------------------------------------------------
> 4. RTT
> --------------------------------------------------------------------------
>
> a) RTT-1.6-Win32 Checkout
>
> - METHOD #1 (preferred): Download RTT-1.6.0 sourcs and apply patches from
> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=605
>
> - METHOD #2 : Checkout the git branch of Peter : git://
> github.com/psoetens/orocos-rtt.git (it seems that the boost test patch is
> missing)
>
> b) You need to apply two patches on RTT :
>
> i. There is a redefinition problem between TAO and RTT for the timespec
> structure. You need to apply the timespec-redefinition.patch .
> ii. There is missing a lib for TAO (TAO_AnyTypeCode). You need to apply
> add-tao-lib-to-cmake.patch .
>
> c) set ACE_ROOT=C:\ACE_Wrappers
>
> d) set TAO_ROOT=C:\ACE_Wrappers\TAO
>
> e) Execute cmake -G"MinGW Makefiles"
>
> f) Modify CMake cached values for your Boost and ACE+TAO paths as needed.
> Also, you need to enable corba and make sure
> that the target is win32.
>
> g) Compile RTT with : mingw32-make
>
> I had a compilation error inside inline functions of ACE (OS_NS_stdio.inl),
> so I needed to do little modification to make it work. This is
> a #ifdef condition problem. A bug report will be submitted soon for that. I
> tried to disable inline functions to avoid that, but then I had
> linking error which I was not able to manage. In brief, you need to apply a
> patch on ACE 1.5a : ace-win32-mingw32-inline-problem.patch .
>
> --------------------------------------------------------------------------
> COMMENTS
> --------------------------------------------------------------------------
>
> 1) It would be fine to avoid any modification to dependant library (ie.
> ACE+TAO). There is currently two issues with ACE+TAO. The first one
> (timespec-redefinition.patch) will be corrected in the next release. After
> the bug report, I hope that the second
> (ace-win32-mingw32-inline-problem.patch) will be also corrected. Then, no
> modification would be required to ACE+TAO.
>
> 2) The tests didn't compile for me. The linker doesn't find
> orocos-rtt-win32 library. I'm not very familiar with CMake, so I hope that
> the boost tests author can manage that.
>
> 3) It would be great to make all tests pass under win32. I currently don't
> know why only 4 of 8 passes, but maybe someone that knows a bit of RTT core
> can investigate that.
>
> 4) We would like to develop our application with RTT 1.8, so it's a major
> drawback for us now that the RTT-win32 patches aren't applied on trunk. We
> are now fixed to 1.6.0 since the patches are merged.
>
> 5) ACE+TAO is huge and not so user-friendly. It would be great to use
> OmniOrb instead of TAO in Win32. I don't know if the current OmniOrb patch
> can be directly applied in Win32.
>
> 6) The next proof of concept I have to do is to port the deployer on Win32.
> The only issue seems to be for dlfcn. Maybe I will take a look at dlfcn for
> Windows to minimize code porting (http://code.google.com/p/dlfcn-win32/).
>
> I hope someone will have the time to test this procedure and give me
> feedback.
>
> Philippe Hamelin
>
>

Orocos RTT 1.6.0 with CORBA under Win32

Thanks for the nice writeup. The instructions are pretty good.

Some comments follow:

1.c) Install MSYS (you reference it later in 2b, and it's needed for
some things)

Orocos RTT 1.6.0 with CORBA under Win32

Thank you for your feedback. I don't know why you don't find some of my
patches, because they are all available as attachments at the end of my post
: http://www.orocos.org/forum/rtt/rtt-dev/orocos-rtt-160-corba-under-win32 .

We are continued our work with RTT on Win32. We have problem using rtt+corba
with MSVC compiler. ACE+TAO and RTT are compiled with mingw-gcc. Then, we
try to link with both in MSVC. This is very bad, because there is many
#ifdef for MSVC/MinGW inside ACE+TAO so it's an hard task to mix compilers.
Therefore, we are currently trying to build everything with MSVC. We have to
do many compiler specific problems to resolve to do so : inline assembly,
typeof, ...

Philippe

2009/3/17 S Roderick <kiwi [dot] net [..] ...>

> Thanks for the nice writeup. The instructions are pretty good.
> Some comments follow:
> 1.c) Install MSYS (you reference it later in 2b, and it's needed for some
> things)
>
> 1.5) Install CMake (I compiled from Linux source, with "./boostrap
> --prefix=/mingw --not-qt-gui" in MSYS shell IIRC)
>
> 2c) You can compile just the necessary parts of boost by adding
> "--with-date_time --with-graph --with-program_options". Makes things go
> quicker.
>
> 3h) I couldn't find the mentioned patch file, though I did find your post
> (the file isn't there is all). You just need to
>
> add "#undef ACE_LACKS_USECONDS_T" to ace/config-win32-mingw.h" before compiling
>
> 4e-g) In a DOS shell
>
> cmake -DOROCOS_TARGET=win32 -DCMAKE_INSTALL_PREFIX=c:\mingw
> c:\path\to\orocos\rtt -G "MinGW Makefiles"
>
> Adding the install path and running both "make" and "make install" with
> RTT, allows the tests to link later.
>
> Note that the tests and libraries are both built back in the source tree,
> and "make check" can build everything but can't find the test programs it
> built to actually run them! You have to manually run them. :-(
>
> A bunch of patch files are mentioned in here without specific URLs (eg
> 4.b.i and 4.b.ii). I couldn't find some of them. Suggest adding URLs or the
> Orocos bug number or some other way to find them.
>
> I got ACE/TAO to build, but gave up spitting and cursing at Windoze
> stupidity long before I got a chance to test it.
>
> I tried this both with cppunit (builds in MSYS fine, from Unix source
> tarball) and boost tests. The test programs all build and link, however,
> only a subset pass in each case.
>
> HTH
> S
>
> On Mar 11, 2009, at 15:12 , Philippe Hamelin wrote:
>
> Hello,
>
> I managed to auto-generate the DEF file of the dynamic library, in order to
> use it with MSVC compiler. Here is the patch.
>
> Philippe Hamelin
>
>
> 2009/3/11 Philippe Hamelin <philippe [dot] hamelin [..] ...>
>
>> Hello,
>>
>> I extended the work from Bug 605 (
>> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=605) to add Corba
>> support in Win32. I successfully tested the port with a gnulinux taskbrowser
>> connected to a win32 remote component. It wasn't so hard, except for ACE+TAO
>> that gave me some headaches. Here is the installation procedure (my comments
>> and future work suggestions will follow) :
>>
>> =====================================
>> RTT-WIN32 (WITH CORBA) INSTALLATION PROCEDURE
>> =====================================
>>
>> --------------------------------------------------------------------------
>> 1. MINGW/MSYS
>> --------------------------------------------------------------------------
>>
>> a) Download MinGW Automated Installer and select :
>>
>> i. base tools
>> ii. g++ compiler
>> iii. make
>>
>> b. Add the MinGW\bin in your PATH
>>
>> --------------------------------------------------------------------------
>> 2. BOOST
>> --------------------------------------------------------------------------
>>
>> a) Download boost sources (I used version 1.34) and bjam for ntx86.
>>
>> b) Uncompress boost sources and the bjam executable in the same directory.
>>
>> c) Compile boost with the following command :
>>
>> bjam --toolset=gcc -sTOOL=mingw --layout=system install
>>
>> d) Take a coffee.
>>
>> --------------------------------------------------------------------------
>> 3. ACE+TAO
>> --------------------------------------------------------------------------
>>
>> a) Download and uncompress TAO. I used TAO 1.5a from
>> http://www.theaceorb.com/downloads/1.5a/index.html .
>>
>> b) Start a MSYS session
>>
>> d) export ACE_ROOT=/c/ACE_wrappers/ (if your uncompressed it in
>> C:\ACE_Wrappers)
>>
>> d) export TAO_ROOT=/c/ACE_wrappers/TAO/
>>
>> e) Create a file called config.h in the $ACE_ROOT/ace directory that
>> contains:
>>
>> #include "ace/config-win32.h"
>>
>> f) Create a file called platform_macros.GNU in the
>> $ACE_ROOT/include/makeinclude directory containing:
>>
>> include $(ACE_ROOT)/include/makeinclude/platform_mingw32.GNU
>>
>> g) cd $ACE_ROOT/ace
>>
>> h) make
>>
>> It may not compile since there is a conflicting declaration between ACE
>> (os_types.h) and MinGW (types.h) for newer release of
>> MinGW. If so, you may need to apply the ace-conflicting-declaration.patch
>> . It's a known bug from the DOC Group and this
>> will be corrected in the next micro release of ACE+TAO (x.6.9).
>>
>> Tips : Use the gnu win32 patch program (
>> http://gnuwin32.sourceforge.net/packages/patch.htm) inside MSYS for
>> better results.
>>
>> i) cd $TAO_ROOT
>>
>> j) make
>>
>> k) Take another coffee.
>>
>> --------------------------------------------------------------------------
>> 4. RTT
>> --------------------------------------------------------------------------
>>
>> a) RTT-1.6-Win32 Checkout
>>
>> - METHOD #1 (preferred): Download RTT-1.6.0 sourcs and apply patches from
>> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=605
>>
>> - METHOD #2 : Checkout the git branch of Peter : git://
>> github.com/psoetens/orocos-rtt.git (it seems that the boost test patch is
>> missing)
>>
>> b) You need to apply two patches on RTT :
>>
>> i. There is a redefinition problem between TAO and RTT for the timespec
>> structure. You need to apply the timespec-redefinition.patch .
>> ii. There is missing a lib for TAO (TAO_AnyTypeCode). You need to apply
>> add-tao-lib-to-cmake.patch .
>>
>> c) set ACE_ROOT=C:\ACE_Wrappers
>>
>> d) set TAO_ROOT=C:\ACE_Wrappers\TAO
>>
>> e) Execute cmake -G"MinGW Makefiles"
>>
>> f) Modify CMake cached values for your Boost and ACE+TAO paths as needed.
>> Also, you need to enable corba and make sure
>> that the target is win32.
>>
>> g) Compile RTT with : mingw32-make
>>
>> I had a compilation error inside inline functions of ACE
>> (OS_NS_stdio.inl), so I needed to do little modification to make it work.
>> This is
>> a #ifdef condition problem. A bug report will be submitted soon for that.
>> I tried to disable inline functions to avoid that, but then I had
>> linking error which I was not able to manage. In brief, you need to apply
>> a patch on ACE 1.5a : ace-win32-mingw32-inline-problem.patch .
>>
>> --------------------------------------------------------------------------
>> COMMENTS
>> --------------------------------------------------------------------------
>>
>> 1) It would be fine to avoid any modification to dependant library (ie.
>> ACE+TAO). There is currently two issues with ACE+TAO. The first one
>> (timespec-redefinition.patch) will be corrected in the next release. After
>> the bug report, I hope that the second
>> (ace-win32-mingw32-inline-problem.patch) will be also corrected. Then, no
>> modification would be required to ACE+TAO.
>>
>> 2) The tests didn't compile for me. The linker doesn't find
>> orocos-rtt-win32 library. I'm not very familiar with CMake, so I hope that
>> the boost tests author can manage that.
>>
>> 3) It would be great to make all tests pass under win32. I currently don't
>> know why only 4 of 8 passes, but maybe someone that knows a bit of RTT core
>> can investigate that.
>>
>> 4) We would like to develop our application with RTT 1.8, so it's a major
>> drawback for us now that the RTT-win32 patches aren't applied on trunk. We
>> are now fixed to 1.6.0 since the patches are merged.
>>
>> 5) ACE+TAO is huge and not so user-friendly. It would be great to use
>> OmniOrb instead of TAO in Win32. I don't know if the current OmniOrb patch
>> can be directly applied in Win32.
>>
>> 6) The next proof of concept I have to do is to port the deployer on
>> Win32. The only issue seems to be for dlfcn. Maybe I will take a look at
>> dlfcn for Windows to minimize code porting (
>> http://code.google.com/p/dlfcn-win32/).
>>
>> I hope someone will have the time to test this procedure and give me
>> feedback.
>>
>> Philippe Hamelin
>>
>>
> <rtt-win32-generate-msvc-def.patch>--
> Orocos-Dev mailing list
> Orocos-Dev [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
>
>
>