Compiling RTT in Windows/MinGW + pthreads-32

This page describes the steps to take in order to compile the real-time toolkit (RTT) on a Windows machine, under MinGW and pthreads-32.

The following has been tested on Windows XP, running in a virtual machine on Mac OS X Leopard.

Outstanding issues

  • Not all RTT tests pass
  • TAO does not completely build
  • CORBA support in RTT untested due to the above

Warning: the default GCC 3.4.5 compiler in MinGW outputs a lot of warnings when compiling RTT. Mostly they are "foo might be used uninitialized in this function" in STL code.

Install MinGW

See the following links for the basic approach

See detailed instructions in URL's above and below, but basically (unless otherwise noted, all actions are in MSys Unix shell, and, all unix-built items are installed in /mingw (which is c:\msys\1.0\mingw in DOS prompt) )

  1. Install MinWG - base, C++, make (then add c:\minwg\bin to system PATH)
  2. Install msysxxx.exe
  3. Install msys DTK
  4. Install bash (i386 versions) by untarring in / in msys
  5. Install coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz by untar'ing and then manually copying contents to / (have to mv the bin/cp command)
  6. Download autoconf, automake and libtool: untar, configure with --prefix=/mingw, and build/install
  7. Set env vars in /etc/profile: CFLAGS, PKG_CONFIG_PATH
  8. Install glib2, gettext and pkg-config from gtk URL. Extract into /mingw

Install dependancy packages

Compile CMake from unix source (in build dir)
 cmake-xxx/bootstrap --prefix=/mingw --no-qt-gui
 make && make install
Run pthreads32 installer (just untar's)
    - manually copy pre-built/include/* to /c/mingw/include    (C:\mingw/include)
    - manually copy pre-built/lib/*GC2* to /c/mingw/lib        (C:\mingw/lib)
    - to run pthreads tests, need to copy prebuilt .a/.dll into .. dir, and copy queueuserapcex to ../.. 
Boost (as at 2009-Jan, use v1.35 not v1.37 until we fix RTT for v1.37)
    *** DOS shell ***
    cd boost-jam-xxx
    .\build.bat gcc        ** won't build in unix shell with build.sh **
    *** unix shell ***
    cd boost-jam-xxx
    cp binntx86/bjame.exe /mingw/bin
    cd ~/software/build/boost_1_35
    bjam --toolset=gcc --layout=system --prefix=/mingw --with-date_time --with-graph \ 
        --with-system --with-function_types  --with-program_options  install
Cppunit, get tarball from sourceforge
    untar and configure with --prefix=/mingw
    correct line 7528 in libtool, to be c:/MinGW/bin../lib/dllcrt2.o for first item 
    make && make install

Build RTT

Get trunk of RTT, patch with this file, configure (ensure set OROCOS_TARGET=win32), make, and install as usual.
 cd /path/to/rtt; patch -p0 < patch-rtt-mingw-1.patch
 

Set your PATH

Ensure your PATH in the MSYS shell contains /mingw/bin and /mingw/lib.

Test your setup

Next test your setup with a 'make check'. Currently 4 of 8 tests fail ... more work to do here.

Partial ACE/TAO CORBA build

This gets most of ACE/TAO to build, but not yet all.
    download, follow MinGW build instructions on the website.
        add "#undef ACE_LACKS_USECONDS_T" to ace/config-win32-mingw.h" before compiling
    copy ace/libACE.dll to /mingw/lib
    make TAO ** this fails
    You can build all we need by manually doing ''make'' in the following directories. Note that the last couple of TAO dir's have problems.
        ace, ace/protocols, kokyu, tao, tao/TAO_IDL, tao/orbsvcs    
NB Can parallel build ace but not its tests nor tao.

NB Not all tests pass. At least one of the ACE tests fail.

More useful URLs

http://www.mingw.org/wiki/MinGWiki http://iua-share.upf.es/wikis/clam/index.php/Devel/Windows_MinGW_build http://www.gimp.org/~tml/gimp/win32/ http://www.gtk.org/download-windows.html http://www.cleardefinition.com/page/Build_Boost_for_MinGW/ http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html#mingw http://psi-im.org/wiki/Compiling_Qt4_on_Windows http://www.qtsoftware.com/downloads/opensource/appdev/windows-cpp