Boost C++ Libraries

PrevUpHomeNext

Installation Recipes

Windows
OS X
Debian and Ubuntu

Since most of these command line tools were developed for Unix, and Unix style, platforms they are an awkward fit for windows and recipes requires more effort. This leads to two possible techniques, firstly install with cygwin which handles much of the complexity for you, but requires that you always use it from within Cygwin. The other is to manually install the toolchain for use from the windows command prompt. This gives a more integrated user experience but is quite fiddly to get right.

These instruction assume that cygwin has been installed to c:\cygwin.

Install these packages:

  • Libs/libxml2
  • Libs/libxslt
  • Text/docbook-xml42
  • Text/docbook-xsl
  • Devel/gcc4-g++ (optional, if you don't have a compiler).
  • Devel/doxygen (optional, for generating reference documentation from C++ source files).

Now we need to configure Boost.Build to use these tools. This step is different depending on whether you're using Boost.Build built with cygwin, or for native windows. For cygwin you need to add to your user-config.jam file:

using xsltproc ;

using boostbook
    : /usr/share/docbook-xsl
    : /usr/share/xml/docbook/4.2
    ;

using quickbook ;

# If you installed doxygen:
using doxygen ;

When using a native (non-Cygwin) Boost.Build, you'll need to specify the windows paths to the various tools:

# Adjust this path to the location of your cygwin install.
CYGWIN_DIR = c:/cygwin ;

using xsltproc
    : $(CYGWIN_DIR)/bin/xsltproc.exe ;

using boostbook
    : $(CYGWIN_DIR)/usr/share/docbook-xsl
    : $(CYGWIN_DIR)/usr/share/xml/docbook/4.2
    ;

using quickbook ;

# If you installed doxygen:
using doxygen
    : $(CYGWIN_DIR)/bin/doxygen.exe
    ;

In order to install the tools under windows, we need to create a directory structure somewhat similar to the unix filesystem. We're going to place this in c:\boost-tools, if you want to put it elsewhere, just follow the instructions, adjusting the paths accordingly. This is also a good location to use as the prefix when installing Boost.Build.

  • Create directory for boost tools, say c:\boost-tools.
  • Create directory for binaries, c:\boost-tools\bin.
  • Add the bin directory to the path (e.g. in Xp, right click on 'My Computer', click on 'Properties', then the 'Advanced' tab and click on 'Environment variables' to open a dialog where you can edit the PATH variable).

Next you need to download several xml tools from Igor Zlatkovic. You require: iconv, libxml2 and libxslt, zlib. Then unzip these into the c:\boost-tools directory. This should place the xsltproc exectuable in c:\boost-tools\bin.

Next make a directory for xml processing files at c:\boost-tools\xml.

user-config.jam in the boost build search path, for most people this will be C:\Documents and Settings\username.

BOOST_TOOLS_DIR = c:/boost-tools ;
using xsltproc
    : $(BOOST_TOOLS_DIR)/bin/xsltproc.exe"
    ;

using boostbook
    : $(BOOST_TOOLS_DIR)/xml/docbook-xsl
    : $(BOOST_TOOLS_DIR)/xml/docbook-xml
    ;

using quickbook ;

Also, if you wish to use doxygen to generate reference documentation from C++ source headers, you'll need to install it. You can download it from the doxygen website. The installer should add the executable to your path, so you just need to add to your user-config.jam:

using doxygen ;

If you're using Snow Leopard (OS X 10.6) or later, then you should already have the xml tools installed, so you just need to install the docbook xml and xslt files. The easiest way to do that is probably to use macports, install them with:

sudo port install docbook-xml-4.2 docbook-xsl

For earlier versions of OS X, you'll also need to install libxslt to get an up to date version of xsltproc:

sudo port install libxslt docbook-xml-4.2 docbook-xsl

You can also install doxygen, for generating reference documentation from C++ source files:

sudo port install doxygen

Boost.Build knows the default install location for macports, so all you need to add to your user-config.jam is an instruction to use them:

using boostbook ;
using quickbook ;

# If you've installed doxygen:
using doxygen ;

Installing on Debian and Ubuntu is pretty easy, just install the packages using apt-get (or an alternative, such as aptitude):

sudo apt-get install xsltproc docbook-xsl docbook-xml

You can also install doxygen, for generating reference documentation from C++ source files:

sudo apt-get install doxygen

Boost.Build should be to find these packages without an explicit path, so just add to your user-config.jam:

using boostbook ;
using quickbook ;

# If you've installed doxygen:
using doxygen ;

PrevUpHomeNext