This directory contains source code for the Middleware News Brief article of
February, 2010.  The Middleware News Brief archive can be found here:  
http://www.ociweb.com/mnb.  This Middleware News Brief discusses the use of 
QuickFAST (http://code.google.com/p/quickfast/) and OpenDDS 
(http://www.opendds.org) for a low-latency market data feed.

This directory contains the following files:

   bin/          Directory for executables and related scripys

   config/       Directory for OpenDDS configuration files, and for the
                 MPC base project
   
   lib/          Directory for generated shared libraries

   src/          Directory containing source code

   opendds/      Directory containing OpenDDS test code

   boost/        Directory containing Boost test code

   zeromq/       Directory containing ZeroMQ tests for comparison
                 purposes; we compare to the OpenDdsRawPublisher and 
                 OpenDdsRawSubscriber tests

   mnb.features  MPC feature file, used by MPC to generate Makefiles

   mnb.mwc       MPC workspace file, used by MPC to generate Makefiles


The code in this Middleware News Brief depends on the following:

   ACE+TAO, version 1.6p5 or later:     http://www.theaceorb.com

   OpenDDS, version 2.1 or later:       http://www.opendds.org

   Boost, version 1.39 or later:        http://www.boost.org

   ZeroMQ, for those tests              http://www.zeromq.org
                                        http://www.zeromq.org/bindings:clr

   Goolgle Protocol Buffers             http://code.google.com/p/protobuf


Documentation for each of those contains build and configuration instructions.
There are also some brief instructions at the end of this README file.

The environment should be set up as follows:


   # ACE+TAO, OpenDDS

   export ACE_ROOT=<path to ACE_wrappers directory>
   export TAO_ROOT=$ACE_ROOT/TAO
   export DDS_ROOT=$TAO_ROOT/DDS
   export MPC_ROOT=$ACE_ROOT/MPC
   export MPC_CONFIG=$ACE_ROOT/bin/MakeProjectCreator/config

   export PATH=.:$ACE_ROOT/bin:$ACE_ROOT/lib:$DDS_ROOT/bin:$PATH

   (Windows only)
   set PATH=%ACE_ROOT%\lib;%DDS_ROOT%\lib;%PATH%

   (Unix only)
   export LD_LIBRARY_PATH=$ACE_ROOT/lib:$DDS_ROOT/lib:$LD_LIBRARY_PATH

   # Boost

   export BOOST_ROOT=<path to Boost root dirctory>
   export BOOST_ROOT_LIB=$BOOST_ROOT/lib
   export BOOST_CFG=<Boost compiler config, e.g. "-gcc41-mt", "-vc90-mt">
   export BOOST_VERSION=<Boost version, e.g. "boost-1_39">
   export LD_LIBRARY_PATH=$BOOST_ROOT_LIB:$LD_LIBRARY_PATH

   # ZeroMQ
   export ZEROMQ_ROOT=<path to ZeroMQ root diectory>
   export LD_LIBRARY_PATH=$ZEROMQ_ROOT/lib:$LD_LIBRARY_PATH

   (Windows only)
   set ZEROMQ_DOTNET_ROOT=<path to ZeroMQ clrzmq diectory>
   set PATH=%ZEROMQ_ROOT%\lib;%PATH%
   set PATH=%ZEROMQ_DOTNET_ROOT%\clrzmq\bin\Release;%PATH%
   set PATH=%ZEROMQ_DOTNET_ROOT%\clrzmq\bin\Debug;%PATH%

   # Google Protocol Buffers
   export PROTOBUF_ROOT=<path to Protocol Buffers root directory>

   (Unix only)
   export PATH=$PROTOBUF_ROOT/src/.libs:$PATH
   export LD_LIBRARY_PATH=$PROTOBUF_ROOT/src/.libs:$LD_LIBRARY_PATH

   (Windows only)
   set PATH=%PROTOBUF_ROOT%\vsprojects\Release;%PATH%
   set PATH=%PROTOBUF_ROOT%\vsprojects\Debug;%PATH%

   # Middleware News Brief

   export MNB_ROOT=<path to this directory>
   export PATH=$MNB_ROOT/bin:$MNB_ROOT/lib:$PATH
   export LD_LIBRARY_PATH=$MNB_ROOT/lib:$LD_LIBRARY_PATH


To build Boost:

   cd $BOOST_ROOT
   sh bootstrap.sh
   ./bjam
   ./bjam install

To build ACE+TAO and OpenDDS:

   cd $ACE_ROOT/ace
   create a file called "config.h" containing the line
      #include <ace/config-linux.h>
   cd $ACE_ROOT/include/makeinclude
   create a file called platform_macros.GNU containing the line
      include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
   cd $TAO_ROOT

   Unix:
     mwc.pl -type gnuace TAO_ACE.mwc (Unix)
     gmake debug=0
     cd $DDS_ROOT 
     mwc.pl -type gnuace DDS.mwc
     gmake debug=0

   Windows:
     perl %ACE_ROOT%\bin\mwc.pl -type vc9 TAO_ACE.mwc 
     Build TAO_ACE.sln with vc9 (Release configuration)
     cd %DDS_ROOT% 
     perl %ACE_ROOT%\bin\mwc.pl -type vc9 DDS.mwc 
     Build DDS.sln with vc9 (Release configuration)

To build ZeroMQ

   Unix:
     cd $ZEROMQ_ROOT
     ./configure
     make
     cp src/.libs/libzmq.so lib 
     cd lib; ln -s libzmq.so libzmq.so.0; cd -

   Windows:
     cd %ZEROMQ_ROOT%
     cd builds\msvc
     Build msvc.sln with vc9 (Release configuration)

     Get the .NET bindings from http://www.zeromq.org/bindings:clr
     Build clrzmq.sln with vc9 (Release configuration)

To build Google Protocol Buffers

   Unix:
     cd $PROTOBUF_ROOT
     ./autogen.sh
     ./configure
     make     

   Windows:
     cd %PROTOBUF_ROOT%
     cd vsprojects
     build protobuf.sln with vc9 (Release configuration)

To build the Middleware News Brief code:

   Unix:
     cd $MNB_ROOT
     mwc.pl -type make -features dotnet=0,protobuf=1 mnb.mwc
     make

   Windows:
     cd %MNB_ROOT%
     perl %ACE_ROOT%\bin\mwc.pl -type vc9 -features dotnet=1,protobuf=1 mnb.mwc
     Build mnb.sln with vc9 (Release configuration)


To run the "OpenDdsRaw" test, which just sends a raw octet buffer back 
and forth. This test is used for comparison purposes with ZeroMQ.

   cd $MNB_ROOT

   perl ./bin/opendds_test.pl OpenDdsRaw -num-subs 3 -num 10000 -s 1000


To run the ZeroMQ test:

   ZeromqPublisher  <message size> <num messages> \
                    <my endpoint> \
                    [<subscriber's endpoint>]+

   ZeromqSubscriber <message size> <num messages> \
                    <my endpoint> \
                    <publishers's endpoint>

e.g. (Linux)

   ZeromqSubscriber 1000 10000 tcp://eth0:54322 tcp://spider:54321
   ZeromqSubscriber 1000 10000 tcp://eth0:54323 tcp://spider:54321
   ZeromqSubscriber 1000 10000 tcp://eth0:54324 tcp://spider:54321

   ZeromqPublisher  1000 10000 tcp://eth0:54321 tcp://spider:54322 \
                                                tcp://spider:54323 \
                                                tcp://spider:54324

e.g. (My Windows Laptop)

   ZeromqSubscriber 1000 10000 tcp://10.201.200.72:54322 \
                               tcp://10.201.200.72:54321

   ZeromqSubscriber 1000 10000 tcp://10.201.200.72:54323 \
                               tcp://10.201.200.72:54321

   ZeromqSubscriber 1000 10000 tcp://10.201.200.72:54324 \
                               tcp://10.201.200.72:54321

   ZeromqPublisher  1000 10000 tcp://10.201.200.72:54321 \
                               tcp://10.201.200.72:54322 \
                               tcp://10.201.200.72:54323 \
                               tcp://10.201.200.72:54324

OR, use the Perl script to run the ZeroMQ tests:

   perl ./bin/zeromq_test.pl Zeromq 1000 10000 -num-subs 3

   perl ./bin/zeromq_test.pl Zeromq 1000 10000 -bind eth0 -connect spider \
                             -num-subs 3

   perl ./bin/zeromq_test.pl Zeromq 1000 10000 -num-subs 3

   perl ./bin/zeromq_test.pl ZeromqDotnet 1000 10000 -num-subs 3

   perl ./bin/zeromq_test.pl ZeromqTyped 10000 -num-subs 3

   perl ./bin/zeromq_test.pl ZeromqTypedDotnet 10000 -num-subs 3



To run the OpenDdsTypedDotNet OpenDDS tests, which send serialized .NET types
through the OpenDDS raw buffer test and deserialize them on the other side:

   perl ./bin/opendds_test.pl OpenDdsTypedDotnet -num-subs 3 -num 10000 


To run the Boost comparison tests:

   perl ./bin/boost_test.pl Boost 1000 10000 -num-subs 3

   perl ./bin/boost_test.pl BoostTyped 10000 -num-subs 3

   perl ./bin/boost_test.pl BoostTypedDotnet 10000 -num-subs 3


****
**** See $MNB_ROOT\bin\README for more information on the executables 
**** and scripts
****
