Compiling tests under Linux
===========================

Prerequisite: ZeroMQ (aka: 0mq, zmq).
^^^^^^^^^^^^
Please install zeromq version 2.2.0 from www.zeromq.org.
Note that if you want to install newer versions, starting from 
version 3.x.x you need also to download the zmq.hpp C++ file binding 
from  https://github.com/zeromq/cppzmq
Copy the zmq.hpp file in the <zmq-installdir>/include> directory.
With the old stable version 2.2.0 the file zmq.hpp is already in the 
tarball.

When running the make command inside the tests/d directory you may 
obtain something similar to the following:

Makefile:27: *** The ZMQ_PATH variable is not defined in your environment.  Stop.

This means that you have to define the ZMQ_PATH env variable with 
the zeromq install path. For example is zeromq is installed in the 
default directory (/usr/local) the command which defines ZMQ_PATH
is either 
  export ZMQ_PATH=/usr/local   for bash-like shells
or 
  setenv ZMQ_PATH /usr/local   for csh-like shells.

If the zmq install path is not in the linker search path you have to define 
olso LD_LIBRARY_PATH before executing the program otherwise the linker 
won't be able to find the libzmq shared library.
The command is:
  export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"   for bash-like shells
or
  setenv LD_LIBRARY_PATH "$LD_LIBRARY_PATH:/usr/local/lib"   for csh-like shells.

In order to avoid to define the env variable each time you open a new shell, 
you may either add the command at the end of the bashrc file 
(actually the .bashrc or .cshrc file in your home directory) or to insert the path 
in the ld.so.conf system file and then run (you need root privileges) 
the command ldconfig to rebuild the linker cache (see man (8) ldconfig for more
info).

*******************************************************
EXAMPLE RUN

This section gives an example run of the tests in the distributed environment.

localhost can be replaced by any host name in a network.

-----------------------------------------
allgather.cpp

Producer:
./allgather gather 1 0 localhost:8080

Consumer:
./allgather gather 0 0 localhost:8080

NOTE: This does not work
-----------------------------------------
broadcast.cpp

Producer:
./broadcast bc 1 1 localhost:8080

Consumer:
./broadcast bc 0 0 localhost:8080

-----------------------------------------
bw11.cpp

Producer:
./bw11 1 localhost:8080 64

Consumer:
./bw11 0 localhost:8080 64

-----------------------------------------
dmap.cpp

Producer:
./dmap 10 10 1 1 localhost:8080 localhost:8081

Consumer:
./dmap 10 10 0 0 localhost:8080 localhost:8081

-----------------------------------------
farm.cpp

Producer:
./farm 10 10 1 1 localhost:8080 localhost:8081

Consumer:
./farm 10 10 0 0 localhost:8080 localhost:8081

-----------------------------------------
farm_farm.cpp

Producer:
./farm_farm 10 10 1 1 2 localhost:8080 localhost:8081

Consumer:
./farm_farm 10 10 0 0 2 localhost:8080 localhost:8081

-----------------------------------------
fromany.cpp

Producer:
./fromany fromany 1 1 localhost:8080

Consumer:
./fromany fromany 0 0 localhost:8080

Note: The program stucks

-----------------------------------------
lat11.cpp

Producer:
./lat11 1 localhost:8080 localhost:8081

Consumer:
./lat11 0 localhost:8080 localhost:8081

Note: The program keeps waiting

-----------------------------------------
lat11_v2.cpp

Producer:
./lat11_v2 1 localhost:8080 localhost:8081 64

Consumer:
./lat11_v2 0 localhost:8080 localhost:8081 64

Note: Producer finishes, but consumer remain waiting

-----------------------------------------
ondemand.cpp

Producer:
./ondemand ondemand 1 1 localhost:8080

Consumer:
./ondemand ondemand 0 0 localhost:8080

Note: Consumer keeps waiting. However, if I start new consumer
./ondemand ondemand 0 1 localhost:8080
then the first consumer finishes along with the producer, but the second
consumer keeps waiting.

-----------------------------------------
pipe_farm.cpp

Producer:
./pipe_farm 2 10 10 pipe 1 localhost:8080

Consumer:
./pipe_farm 2 10 10 pipe 0 localhost:8080

-----------------------------------------
scatter.cpp

Producer:
./scatter scatter 1 1 localhost:8080

Consumer:
./scatter scatter 0 0 localhost:8080

-----------------------------------------
test11_pipe.cpp

Producer:
./test11_pipe pipe 1 localhost:8080

Consumer:
./test11_pipe pipe 0 localhost:8080

-----------------------------------------
test11_torus.cpp

Producer:
./test11_torus torus1 torus2 1 localhost:8080 localhost:8081

Consumer:
./test11_torus torus1 torus2 0 localhost:8080 localhost:8081

-----------------------------------------
test_dinout.cpp

Producer:
./test_dinout test1 test2 1 localhost:8080 localhost:8081

Consumer:
./test_dinout test1 test2 0 localhost:8080 localhost:8081

NOTE: I do not see the output values as expected.

-----------------------------------------
test_marshal.cpp

Producer:
./test_marshal marshal 1 localhost:8080

Consumer:
./test_marshal marshal 0 localhost:8080

-----------------------------------------
unicast.cpp

Producer:
./unicast unicast 1 localhost:8080

Consumer:
./unicast unicast 0 localhost:8080
