blob: 49725ca2a8807fbf65c5fc26eae911e54aec0cce [file] [log] [blame]
<div class="wiki-content maincontent"><h2>Dependencies</h2>
<h3>libuuid</h3>
<p>The build requires the <strong>libuuid</strong> library that is part of the e2fsprogs package and is available from <a shape="rect" href="http://e2fsprogs.sourceforge.net/">http://e2fsprogs.sourceforge.net/</a> which is not always installed by default.</p>
<h3>cppunit</h3>
<p>The package contains a complete set of cppunit tests. In order for you to build an run the tests, you will need to download and install the cppunit suite. See <a shape="rect" href="http://cppunit.sourceforge.net/cppunit-wiki">http://cppunit.sourceforge.net/cppunit-wiki</a></p>
<p>or on Fedora type the following:</p>
<structured-macro ac:macro-id="e1010969-446e-40b3-8b0e-6d6fec1fe8ba" ac:name="code" ac:schema-version="1"><plain-text-body>
sudo yum install cppunit
</plain-text-body></structured-macro>
<p>Make sure that the paths to the installed cppunit library and includes are visible in your current shell before you try building the tests.</p>
<p>Windows users will need to build the cppunit library using the CPPUnit MSVC project files.&#160; A discussion of the build process can be found on the CPPUnit wiki under <a shape="rect" href="http://cppunit.sourceforge.net/cppunit-wiki/BuildingCppUnit1">CPPUnit Platform build instructions</a> this covers both MSVC along with many other platforms and tool suites.</p>
<h3>GNU Build System (for building on *nix)</h3>
<p>To Generate the ./configure script use to create the Makefiles, you need the following software installed:</p>
<table><tbody><tr><th colspan="1" rowspan="1"><p> Tool </p></th><th colspan="1" rowspan="1"><p> Recommended Version </p></th></tr><tr><td colspan="1" rowspan="1"><p> autoconf </p></td><td colspan="1" rowspan="1"><p> &gt;= 2.59 <br clear="none" class="atl-forced-newline"> </p></td></tr><tr><td colspan="1" rowspan="1"><p> automake </p></td><td colspan="1" rowspan="1"><p> &gt;= 1.9.6 </p></td></tr><tr><td colspan="1" rowspan="1"><p> libtool </p></td><td colspan="1" rowspan="1"><p> &gt;= 1.5.22 <br clear="none" class="atl-forced-newline"> </p></td></tr></tbody></table>
<h2>Building on *nix (Unix/Linux/OS X/Cygwin)</h2>
<p>This assumes you have all of the project dependencies installed. We're now ready to create the configure script. To do this, run:</p>
<structured-macro ac:macro-id="73cdd5b7-0cf4-4d99-9c40-50618a8b1dfd" ac:name="code" ac:schema-version="1"><plain-text-body>
./autogen.sh
</plain-text-body></structured-macro>
<structured-macro ac:macro-id="69a5c84d-28fe-446a-8fbe-284d846c1db6" ac:name="info" ac:schema-version="1"><rich-text-body>
<p>You may see the following warnings when running this command:</p>
<p>src/test-integration/Makefile.am:44: `CXXFLAGS' is a user variable, you should not override it;<br clear="none">
src/test-integration/Makefile.am:44: use `AM_CXXFLAGS' instead.<br clear="none">
src/test/Makefile.am:104: `CXXFLAGS' is a user variable, you should not override it;<br clear="none">
src/test/Makefile.am:104: use `AM_CXXFLAGS' instead.</p>
<p>These can be ignored. We override CXXFLAGS in the makefiles for the unit and integration tests in order to suppress compiler warnings.</p></rich-text-body></structured-macro>
<p>This should be run the first time and anytime you change configure.ac or any of the Makefile.am files.</p>
<structured-macro ac:macro-id="80a1c3af-3159-43ce-8138-6ecb3d37b68c" ac:name="info" ac:schema-version="1"><parameter ac:name="title">Solaris 10 Note</parameter><rich-text-body>
<p>CPP_UNIT might not build until you correct the file libstdc++.la to contain the correct data, see this discussion.</p>
<p><a shape="rect" href="http://forum.sun.com/jive/thread.jspa?threadID=73150">http://forum.sun.com/jive/thread.jspa?threadID=73150</a></p></rich-text-body></structured-macro>
<p>The configure script will customize the way the software is built and installed into your system along with detecting the available libraries that have been installed. To use the default configuration just run:</p>
<structured-macro ac:macro-id="205c26b2-1371-4bf8-abbc-41d2eea6f006" ac:name="code" ac:schema-version="1"><plain-text-body>
./configure
</plain-text-body></structured-macro>
<p>For more help on how to customize the build configuration, run:</p>
<structured-macro ac:macro-id="9b6a11a7-08f6-4ac1-99fc-d076a7458244" ac:name="code" ac:schema-version="1"><plain-text-body>
./configure --help
</plain-text-body></structured-macro>
<p>Once the configure script has run successfully, you are ready to build. Run:</p>
<structured-macro ac:macro-id="f50bfe43-4a94-495e-99b0-1ab21f6212dd" ac:name="code" ac:schema-version="1"><plain-text-body>
make
</plain-text-body></structured-macro>
<p>This will build all of the core ActiveMQ CPP source code. To build and install the code into the system directories, run:</p>
<structured-macro ac:macro-id="cf308ba3-9be2-47a4-8d29-ab6abe737c53" ac:name="code" ac:schema-version="1"><plain-text-body>
make install
</plain-text-body></structured-macro>
<p>You will have to become the superuser in order to be able to install the files.</p>
<h2>Doxygen</h2>
<p>To generate the doxygen documentation for the project, just run:</p>
<structured-macro ac:macro-id="7a959d3b-8ad9-46bd-99e0-c2136169c31d" ac:name="code" ac:schema-version="1"><plain-text-body>
make doxygen-run
</plain-text-body></structured-macro>
<h2>Running Tests</h2>
<h3>Unit Tests</h3>
<p>In order to build and run the suite of unit tests, run:</p>
<structured-macro ac:macro-id="355a0924-32b9-43e1-af0e-35b2c78acc6f" ac:name="code" ac:schema-version="1"><plain-text-body>
make check
</plain-text-body></structured-macro>
<p>This will verify that the library is functioning correctly on the target platform. In addition, it will generate the integration tests binary.</p>
<h3>Integration Tests</h3>
<p>The library also contains a set of tests that are run against a real AMQ broker. These allow you to validate this distribution of ActiveMQ CPP against your broker. Running these without a broker will result in failed tests. The tests currently hard-code the broker url to be tcp://localhost:61613 for stomp and tcp://localhost:61616 for openwire.</p>
<p>The integration tests are built via "make check". To run them, first start a broker and then</p>
<structured-macro ac:macro-id="84f4a992-211a-4466-b719-5932731f018a" ac:name="code" ac:schema-version="1"><plain-text-body>
cd src/test-integration
./activemq-test-integration
</plain-text-body></structured-macro>
<p>This will take quite some time to complete, so be patient.</p>
<h2>Example</h2>
<p>There is an example application that ships with the distribution in src/examples. The example is compiled by default with the "make" command, but can easily be compiled manually using the command:</p>
<structured-macro ac:macro-id="b0fc5b8c-b49c-4a70-9cea-6b7bc430239d" ac:name="code" ac:schema-version="1"><plain-text-body>
g++ -o main -pthread -I ../main main.cpp ../../out/libactivemq-cpp-0_0_2.a -luuid
</plain-text-body></structured-macro>
<h2>Notes for Windows users</h2>
<p>We support using the GNU compiler on Windows, using the Cygwin package. However we also support using the MSVC compiler on Windows.</p>
<p>There are a couple or things that you will need to setup to ensure that the MSVC compile succeeds.</p>
<ul><li>You need to download and install the Platform SDK if you don't have it installed already.</li><li>Ensure that the path to you MSVC install is set in the PATH env variable. You can test this by typing cl.exe at the command line, if you get an error complaining that its not found, then you'll need to fix your PATH.</li><li>Set the INCLUDE env variable to include the path to your MSVC includes, and the platform SDK includes. For example:
<structured-macro ac:macro-id="1bcf5725-bbc2-4cfe-b378-7abd123ce11a" ac:name="code" ac:schema-version="1"><plain-text-body>
INCLUDE = D:\Program Files\Microsoft Visual Studio 8\VC\include;D:\Program Files\Microsoft Platform SDK\Include\*
</plain-text-body></structured-macro></li><li>Set the LIB env variable to include the path to your MSVC libs, and the Platform SDK libs. For example:
<structured-macro ac:macro-id="9d551a9f-b5d7-4ff7-a8f7-236917531e81" ac:name="code" ac:schema-version="1"><plain-text-body>
LIB = D:\Program Files\Microsoft Visual Studio 8\VC\lib;D:\Program Files\Microsoft Platform SDK\Lib
</plain-text-body></structured-macro></li><li>The Project files reference the CPPUnit libraries for the Integration and Unit tests builds.&#160; In order for these to build correctly you must either place the CPPUnit libraries in a directory listed in the project settings, or add a new location for your install of CPPUnit.&#160;</li></ul>
</div>