blob: 740f2a43e10fc6b50aeffb7d6ee06f48a071ef8d [file] [log] [blame]
<div class="wiki-content maincontent"><h2 id="BuildingActiveMQCPP-Dependencies">Dependencies</h2>
<h3 id="BuildingActiveMQCPP-libuuid">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" class="external-link" href="http://e2fsprogs.sourceforge.net/" rel="nofollow">http://e2fsprogs.sourceforge.net/</a> which is not always installed by default.</p>
<h3 id="BuildingActiveMQCPP-cppunit">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" class="external-link" href="http://cppunit.sourceforge.net/cppunit-wiki" rel="nofollow">http://cppunit.sourceforge.net/cppunit-wiki</a></p>
<p>or on Fedora type the following:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
sudo yum install cppunit
</pre>
</div></div>
<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" class="external-link" href="http://cppunit.sourceforge.net/cppunit-wiki/BuildingCppUnit1" rel="nofollow">CPPUnit Platform build instructions</a> this covers both MSVC along with many other platforms and tool suites.</p>
<h3 id="BuildingActiveMQCPP-GNUBuildSystem(forbuildingon*nix)">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>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Tool </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Recommended Version </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> autoconf </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> &gt;= 2.59 <br clear="none" class="atl-forced-newline"> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> automake </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> &gt;= 1.9.6 </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> libtool </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> &gt;= 1.5.22 <br clear="none" class="atl-forced-newline"> </p></td></tr></tbody></table></div>
<h2 id="BuildingActiveMQCPP-Buildingon*nix(Unix/Linux/OSX/Cygwin)">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>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
./autogen.sh
</pre>
</div></div>
<div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-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></div></div>
<p>This should be run the first time and anytime you change configure.ac or any of the Makefile.am files.</p>
<div class="confluence-information-macro confluence-information-macro-information"><p class="title">Solaris 10 Note</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-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" class="external-link" href="http://forum.sun.com/jive/thread.jspa?threadID=73150" rel="nofollow">http://forum.sun.com/jive/thread.jspa?threadID=73150</a></p></div></div>
<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>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
./configure
</pre>
</div></div>
<p>For more help on how to customize the build configuration, run:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
./configure --help
</pre>
</div></div>
<p>Once the configure script has run successfully, you are ready to build. Run:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
make
</pre>
</div></div>
<p>This will build all of the core ActiveMQ CPP source code. To build and install the code into the system directories, run:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
make install
</pre>
</div></div>
<p>You will have to become the superuser in order to be able to install the files.</p>
<h2 id="BuildingActiveMQCPP-Doxygen">Doxygen</h2>
<p>To generate the doxygen documentation for the project, just run:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
make doxygen-run
</pre>
</div></div>
<h2 id="BuildingActiveMQCPP-RunningTests">Running Tests</h2>
<h3 id="BuildingActiveMQCPP-UnitTests">Unit Tests</h3>
<p>In order to build and run the suite of unit tests, run:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
make check
</pre>
</div></div>
<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 id="BuildingActiveMQCPP-IntegrationTests">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>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
cd src/test-integration
./activemq-test-integration
</pre>
</div></div>
<p>This will take quite some time to complete, so be patient.</p>
<h2 id="BuildingActiveMQCPP-Example">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>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
g++ -o main -pthread -I ../main main.cpp ../../out/libactivemq-cpp-0_0_2.a -luuid
</pre>
</div></div>
<h2 id="BuildingActiveMQCPP-NotesforWindowsusers">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:
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
INCLUDE = D:\Program Files\Microsoft Visual Studio 8\VC\include;D:\Program Files\Microsoft Platform SDK\Include\*
</pre>
</div></div></li><li>Set the LIB env variable to include the path to your MSVC libs, and the Platform SDK libs. For example:
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
LIB = D:\Program Files\Microsoft Visual Studio 8\VC\lib;D:\Program Files\Microsoft Platform SDK\Lib
</pre>
</div></div></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>