diff --git a/BoostCon07.rst b/BoostCon07.rst index fd43938..f6bde3a 100644 --- a/BoostCon07.rst +++ b/BoostCon07.rst @@ -24,12 +24,14 @@ __ ../index.htm ---------- -This inaugural Boost conference promises to be the main -face-to-face venue for all things Boost, from using libraries to -writing them, from evangelizing Boost to deployment within your -organization, from infrastructure and process to vision and -mission, and from TR1 to TR2. Given the range and interests of the -participants, the event is going to be intense and in-depth. +.. Admonition:: What is BoostCon? + + This inaugural Boost conference promises to be the main + face-to-face venue for all things Boost, from using libraries to + writing them, from evangelizing Boost to deployment within your + organization, from infrastructure and process to vision and + mission, and from TR1 to TR2. Given the range and interests of the + participants, the event is going to be intense and in-depth. .. contents:: Index @@ -44,21 +46,18 @@ overlap day at midweek. Thus, the conference fosters interaction both within *and* across these tracks, with an emphasis on service to our user base. -Sessions will run in the morning and evening, leaving a midday -break of several hours so that attendees can get out and enjoy the -town and its surroundings, or just to have time to work together in -small, informal groups. - -Sessions -======== - In the spirit of Boost, many sessions will be participatory and/or -collaborative in nature. The program committee has issued a `call -for sessions`_. Please raise any questions about—or ideas for—the -conference on the `Boost mailing lists`__. +collaborative in nature. Sessions will run in the morning and +evening, leaving a midday break of several hours so that attendees +can get out and enjoy the town and its surroundings, or just to +have time to work together in small, informal groups. -.. _call for sessions: http://www.boost.org/more/BoostCon07_session_call.html -__ http://www.boost.org/more/mailing_lists.htm +Propose a Session +================= + +See the BoostCon `Call for Sessions`_ for details about how to submit a sesion proposal. + +.. _call for Sessions: http://www.boost.org/more/BoostCon07_session_call.html Venue ===== @@ -94,13 +93,6 @@ us to expand registration should demand prove overwhelming, but when registration opens we recommend securing your place early, in case that isn't possible. -Sessions -======== - -The program committee is currently forming and drafting a call for -sessions; watch this space in upcoming weeks for an outline of -workshop, session, and talk ideas, and a request for submissions. - Registration ============ @@ -119,6 +111,14 @@ __ interest_ __ interest_ +Questions +========= + +Please raise any other questions about—or ideas for—the conference +on the `Boost mailing lists`__. + +__ http://www.boost.org/more/mailing_lists.htm + .. _interest: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostCon Organizing Committee diff --git a/BoostCon07_session_call.html b/BoostCon07_session_call.html index 2929872..8249e72 100644 --- a/BoostCon07_session_call.html +++ b/BoostCon07_session_call.html @@ -15,7 +15,7 @@

Boost Conference 2007: - Call for Proposals

+ Call for Sessions

The first annual Boost conference will take place in Aspen, Colorado, May 14-18, 2007.

This inaugural Boost conference promises to be the main face-to-face @@ -99,12 +99,12 @@

  • A biography, suitable for the conference web site
  • Your contact information (will not be made public)
  • -

    Please submit via email to conference@boost-consulting.com, with a +

    Please submit via email to boostcon-program@lists.boost-consulting.com, with a subject that begins "BoostCon proposal"


    Revised: - 11 November 2006

    + 4 December 2006

    Copyright David Abrahams and Beman Dawes 2006

    Distributed under the Boost Software License, Version 1.0. (See accompanying file @@ -113,4 +113,4 @@

    - \ No newline at end of file + diff --git a/Jamfile.v2 b/Jamfile.v2 index de53650..a61b176 100644 --- a/Jamfile.v2 +++ b/Jamfile.v2 @@ -4,7 +4,7 @@ import docutils ; import path ; -sources = getting_started.rst ; +sources = getting_started.rst BoostCon07.rst ; bases = $(sources:S=) ; # This is a path relative to the html/ subdirectory where the @@ -15,6 +15,8 @@ for local b in $(bases) { html $(b) : $(b).rst : + # "PYTHONPATH=~/src/boost/tools && python ~/src/boost/tools/litre/active-rst.py" + # "-gdt --writer=html --source-url="./$(b).rst" --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet) "-gdt --source-url="./$(b).rst" --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet) ; } diff --git a/getting_started.html b/getting_started.html index 6a69396..665efff 100644 --- a/getting_started.html +++ b/getting_started.html @@ -14,22 +14,21 @@
    -

    1   Introduction

    +

    1   Introduction

    Welcome to the Boost libraries! By the time you've completed this tutorial, you'll be at least somewhat comfortable with the contents of a Boost distribution and how to go about using it.

    -

    1.1   What's Here

    +

    1.1   What's Here

    This document is designed to be an extremely gentle introduction, so we included a fair amount of material that may already be very familiar to you. To keep things simple, we also left out some @@ -64,7 +62,7 @@ the end of this document, we'll refer you on to resources that can help you pursue these topics further.

    -

    1.2   Preliminaries

    +

    1.2   Preliminaries

    We use one typographic convention that might not be immediately obvious: italic text in examples is meant as a descriptive placeholder for something else, usually information that you'll @@ -89,8 +87,8 @@ them for your own compiler or IDE.

    -

    2   Get Boost

    -

    There are basically three ways to get Boost on your system:

    +

    2   Get Boost

    +

    To get Boost, choose one of the following methods:

    1. Windows Installer: Boost Consulting provides an installer for Windows platforms that installs a complete Boost @@ -98,7 +96,7 @@ distribution, plus optional precompiled library binaries for Visual Studio, and (optionally) a prebuilt version of the bjam build tool.

    2. -
    3. Download: users of other platforms—and Windows +

    4. Source Download: users of other platforms—and Windows users who prefer to build everything from scratch—can download a complete Boost distribution from SourceForge.

      @@ -115,16 +113,18 @@ tar --bzip2 -xf /path/to/
    5. -
    6. Boost packages from RedHat, Debian, or some other -distribution packager: these instructions may not work for you -if you use 3rd party packages, because other packagers sometimes -choose to break Boost up into several packages or to reorganize -the directory structure of the Boost distribution.2

      +
    7. Boost packages are available from RedHat, Debian, and other +distribution packagers. You may need to adapt these +instructions if you use this method, because other packagers +usually choose to break Boost up into several packages, +reorganize the directory structure of the Boost distribution, +and/or rename the library binaries.2 If you have +trouble, we suggest going back to method 2.

    -

    3   The Structure of a Boost Distribution

    +

    3   The Structure of a Boost Distribution

    This is is a sketch of the directory structure you'll get when you unpack your Boost installation (windows users replace forward slashes with backslashes):

    @@ -159,15 +159,15 @@ the Type Traits Library's is_void example, Boost.Python's aggregate header is boost/python.hpp.
  • Most libraries place private headers in a subdirectory called -detail/ or aux_/. Don't look in these directories and -expect to find anything you can use.
  • +detail/ or aux_/. Don't +expect to find anything you can use in these directories.

    A few things are worth noting right off the bat:

    1. The path to the “boost root directory” is sometimes referred to as $BOOST_ROOT in documentation and mailing lists. If you -used the Windows installer, that will usually be C: \Program`` \ ``Files\boost\boost_1_34_0.

      +used the Windows installer, that will usually be C:\Program Files\boost\boost_1_34_0.

    2. To compile anything in Boost, you need a directory containing the boost/ subdirectory in your #include path. For most @@ -203,40 +203,41 @@ contains a subset of the Boost documentation. Start with

    -

    4   Header-Only Libraries

    +

    4   Header-Only Libraries

    The first thing many people want to know is, “how do I build Boost?” The good news is that often, there's nothing to build.

    -

    Nothing to Build

    +

    Nothing to Build?

    Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking.

    -

    The only Boost libraries that can't be used without separate -compilation are:

    +

    The only Boost libraries that must be built separately are:

    +

    A few libraries have optional separately-compiled binaries:

    +
      +
    • Boost.DateTime has a binary component that is only needed if +you're using its to_string/from_string or serialization +features, or if you're targeting Visual C++ 6.x or Borland.
    • +
    • Boost.Graph also has a binary component that is only needed if +you intend to parse GraphViz files.
    • +
    • Boost.Test ... Waiting for Gennadiy to tell me what to say here.
    -

    The DateTime library has a separately-compiled component that -is only needed if you're using its to/from_string and/or -serialization features or if you're targeting Visual C++ 6.x or -Borland. The Graph library also has a separately-compiled part, -but you won't need it unless you intend to parse GraphViz -files.

    -

    5   Build a Simple Program Using Boost

    +

    5   Build a Simple Program Using Boost

    To keep things simple, let's start by using a header-only library. The following program reads a sequence of integers from standard input, uses Boost.Lambda to multiply each number by three, and @@ -258,7 +259,7 @@ int main()

    Copy the text of this program into a file called example.cpp.

    -

    5.1   Build on *nix

    +

    5.1   Build on *nix

    In the directory where you saved example.cpp, issue the following command:

    @@ -271,7 +272,74 @@ echo 1 2 3 | ./example
     

    next...

    -

    5.2   Build from the Visual Studio Command Prompt

    +

    5.2   Build on Windows

    + +

    To build the examples in this guide, you can use an Integrated +Development Environment (IDE) like Visual Studio or you can follow +a shorter path by issuing commands from the command prompt.

    +
    +

    From the Visual Studio IDE

    +
      +
    • From Visual Studio's File menu, select New > Project…

      +
    • +
    • In the left-hand pane of the resulting New Project dialog, +select Visual C++ > Win32.

      +
    • +
    • In the right-hand pane, select Win32 Console Application +(VS8.0) or Win32 Console Project (VS7.1).

      +
    • +
    • In the name field, enter “example”

      +
    • +
    • Right-click example in the Solution Explorer pane and +select Properties from the resulting pop-up menu

      +
    • +
    • In Configuration Properties > C/C++ > General > Additional Include +Directories, enter the path to the Boost root directory, for example

      +
      +

      C:\Program Files\boost\boost_1_34_0

      +
      +
    • +
    • In Configuration Properties > C/C++ > Precompiled Headers, change +Use Precompiled Header (/Yu) to Not Using Precompiled +Headers.6

      +
    • +
    • Replace the contents of the example.cpp generated by the IDE +with the example code above.

      +
    • +
    • From the Build menu, select Build Solution.

      +
    • +
    +

    To test your application, hit the F5 key and type the following +into the resulting window, followed by the return key:

    +
    +1 2 3
    +
    +

    Then hold down the control key and press "Z", followed by the +return key.

    +

    next...

    +
    +
    +

    From the Command Prompt

    From your computer's Start menu, if you are a Visual Studio 2005 user, select

    @@ -285,45 +353,16 @@ Studio 2005 user, select

    Studio compiler. In that window, type the following command and hit the return key:

    -cl /EHsc /Ipath\to\boost_1_34_0 path\to\example.cpp
    +cl /EHsc /I path\to\boost_1_34_0 path\to\example.cpp
     

    To test the result, type:

     echo 1 2 3 | example
     
    -

    next...

    +
    -

    5.3   Build in the Visual Studio IDE

    -
      -
    • From Visual Studio's File menu, select New > Project…
    • -
    • In the left-hand pane of the resulting New Project dialog, -select Visual C++ > Win32.
    • -
    • In the right-hand pane, select Win32 Console Application -(VS8.0) or Win32 Console Project (VS7.1).
    • -
    • In the name field, enter “example”
    • -
    • Right-click example in the Solution Explorer pane and -select Properties from the resulting pop-up menu
    • -
    • In Configuration Properties > C/C++ > General > Additional Include -Directories, enter the path to the Boost root directory, e.g. -C: \Program`` \ ``Files\boost\boost_1_34_0.
    • -
    • In Configuration Properties > C/C++ > Precompiled Headers, change -Use Precompiled Header (/Yu) to Not Using Precompiled -Headers.5
    • -
    • Replace the contents of the example.cpp generated by the IDE -with the example code above.
    • -
    • From the Build menu, select Build Solution.
    • -
    -

    To test your application, hit the F5 key and type the following -into the resulting window, followed by the return key:

    -
    -1 2 3
    -
    -

    Then hold down the control key and press "Z", followed by the -return key.

    -
    -
    -

    5.4   Errors and Warnings

    +

    5.3   Errors and Warnings

    Don't be alarmed if you see compiler warnings from Boost headers. We try to eliminate them, but doing so isn't always practical.4

    Errors are another matter. If you're seeing compilation errors at @@ -333,14 +372,14 @@ Boost root directory.

    -

    6   Get Boost Library Binaries

    +

    6   Prepare to Use a Boost Library Binary

    If you want to use any of the separately-compiled Boost libraries, you'll need library binaries.

    6.1   Install Visual Studio Binaries

    The Windows installer supplied by Boost Consulting will download and install pre-compiled binaries into the lib\ subdirectory of -the boost root, typically C: \Program`` \ ``Files\boost\boost_1_34_0\lib\.

    +the boost root, typically C:\Program Files\boost\boost_1_34_0\lib\.

    next...

    @@ -357,12 +396,14 @@ directory, you'll probably want to at least use

     $ ./configure --prefix=path/to/installation/prefix
     
    -

    to install somewhere else. Finally,

    +

    to install somewhere else. Also, consider using the +--show-libraries and --with-libraries= options to limit the +long wait you'll experience if you build everything. Finally,

     $ make install
     
    -

    which will leave Boost binaries in the lib/ subdirectory of -your installation prefix. You will also find a copy of the Boost +

    will leave Boost binaries in the lib/ subdirectory of your +installation prefix. You will also find a copy of the Boost headers in the include/ subdirectory of the installation prefix, so you can henceforth use that directory as an #include path in place of the Boost root directory.

    @@ -371,7 +412,7 @@ path in place of the Boost root directory.

    6.3   Build and Install Other Binaries

    If you're not using Visual C++ 7.1 or 8.0, or you're a *nix user -who wants want to build with a toolset other than your system's +who wants to build with a toolset other than your system's default, or if you want a nonstandard variant build of Boost (e.g. optimized, but with debug symbols), you'll need to use Boost.Build to create your own binaries.

    @@ -502,20 +543,19 @@ purpose in your current working directory.

    Change your current directory to the Boost root directory and invoke bjam as follows:

    -bjam --build-dir=build-directory \
    -     --toolset=toolset-name stage
    +bjam --build-dir=build-directory --toolset=toolset-name stage
     
    -

    For example, on Windows, your session might look like:

    +

    For example, on Windows, your session might look like this:5

    -C:WINDOWS> cd C: \Program`` \ ``Files\boost\boost_1_34_0
    -C: \Program`` \ ``Files\boost\boost_1_34_0> bjam \
    -  --build-dir=%TEMP%\build-boost          \
    -  --toolset=msvc stage
    +C:WINDOWS> cd C:\Program Files\boost\boost_1_34_0
    +C:\Program Files\boost\boost_1_34_0> bjam ^
    +More? --build-dir=%TEMP%\build-boost ^
    +More? --toolset=msvc stage
     

    And on Unix:

     $ cd ~/boost_1_34_0
    -$ bjam --build-dir=~/build-boost --prefix=~/boost
    +$ bjam --build-dir=/tmp/build-boost --toolset=gcc
     

    In either case, Boost.Build will place the Boost binaries in the stage/ subdirectory of your build directory.

    @@ -529,6 +569,14 @@ parts shown in bold type above be entirely lower-case.

     bjam --help
     
    +

    In particular, to limit the amount of time spent building, you may +be interested in:

    +
      +
    • reviewing the list of library names with --show-libraries
    • +
    • limiting which libraries get built with the --with-library-name or --without-library-name options
    • +
    • choosing a specific build variant by adding release or +debug to the command line.
    • +
    @@ -574,7 +622,7 @@ questions about configuring Boost for your compiler to the

    7   Link Your Program to a Boost Library

    To demonstrate linking with a Boost binary library, we'll use the following simple program that extracts the subject lines from -emails. It uses the Boost.Regex library, which has a +emails. It uses the Boost.Regex library, which has a separately-compiled binary component.

     #include <boost/regex.hpp>
    @@ -603,12 +651,6 @@ build settings.
     whose compile configuration is compatible with the rest of your
     project.
     
    -
    -

    Note

    -

    Boost.Python users should read that library's own build -documentation as there are several library-specific issues to -consider.

    -

    7.1   Link to a Boost Library on Windows

    Most Windows compilers and linkers have so-called “auto-linking @@ -622,7 +664,7 @@ the directories you've told it to search.

    For example, we can compile and link the above program from the Visual C++ command-line by simply adding the bold text below to the command line we used earlier, assuming your Boost binaries are -in C: \Program`` \ ``Files\boost\boost_1_34_0\lib:

    +in C:\Program Files\boost\boost_1_34_0\lib:

     cl /EHsc /I path\to\boost_1_34_0 example.cpp   \
          /link /LIBPATH: C:\Program Files\boost\boost_1_34_0\lib
    @@ -638,14 +680,14 @@ earlier:

    select Properties from the resulting pop-up menu
  • In Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, -e.g. C: \Program`` \ ``Files\boost\boost_1_34_0\lib\.
  • +e.g. C:\Program Files\boost\boost_1_34_0\lib\.
  • From the Build menu, select Build Solution.
  • next...

    -

    7.2   Link to a Boost Library On *nix

    +

    7.2   Link to a Boost Library on *nix

    There are two main ways to link to libraries:

    1. You can specify the full path to each library:

      @@ -654,7 +696,7 @@ $ c++ -I /path~/boost/lib/libboost_regex-gcc-3.4-mt-d-1_34.a
    2. -
    3. You can separately specify a directory to search (with -Ldirectory) and a library name to search for (with -llibrary,6 dropping the filename's leading lib and trailing +

    4. You can separately specify a directory to search (with -Ldirectory) and a library name to search for (with -llibrary,7 dropping the filename's leading lib and trailing suffix (.a in this case):

       $ c++ -I /path/to/boost_1_34_0 example.cpp -o example \
      @@ -685,7 +727,7 @@ following elements:

      Prefix: except on Microsoft Windows, every Boost library name begins with this string. On Windows, only ordinary static libraries use the lib prefix; import libraries and DLLs do -not.7
      +not.8
      boost_regex
      Library name: all boost library filenames begin with boost_.
      -vc71
      @@ -722,14 +764,14 @@ libraries. using a special debug build of Python. d -building a debug version of your code.8 +building a debug version of your code.9 p using the STLPort standard library rather than the default one supplied with your compiler. n -using STLPort's deprecated “native iostreams” feature.9 +using STLPort's deprecated “native iostreams” feature.10 @@ -744,16 +786,16 @@ ABI tag is ommitted.

      replaced by underscores. For example, version 1.31.1 would be tagged as "-1_31_1".
      .lib
      -
      Extension: determined according to the -operating system's usual convention. On most *nix platforms the extensions are -.a and .so for static libraries (archives) and shared -libraries, respectively. On Windows—except for libraries built -by gcc toolset, which always uses the *nix -convention—``.dll`` indicates a shared library and .lib -indicates a static or import library. Where supported by *nix -toolsets, a full version extension is added (e.g. ".so.1.34"); a -symbolic link to the library file, named without the trailing -version number, will also be created.
      +
      Extension: determined according to the operating system's usual +convention. On most *nix platforms the extensions are .a +and .so for static libraries (archives) and shared libraries, +respectively. On Windows, .dll indicates a shared library +and—except for static libraries built by gcc toolset, whose +names always end in .a``— ``.lib indicates a static or import +library. Where supported by *nix toolsets, a full version +extension is added (e.g. ".so.1.34") and a symbolic link to the +library file, named without the trailing version number, will +also be created.
    @@ -815,12 +857,30 @@ them. Until then, we suggest you pursue the following resources. If you can't find what you need, or there's anything we can do to make this document clearer, please post it to the Boost Users' mailing list.

    -
    -
    -

    9   Appendix: Using command-line tools in Windows

    -

    In Windows, a command-line tool is invoked by typing its name, -optionally followed by arguments, into a Command Prompt window -and pressing the Return (or Enter) key.

    -

    To open Command Prompt, click the Start menu button, click -Run, type “cmd”, and then click OK.

    -

    All commands are executed within the context of a current -directory in the filesystem. To set the current directory, -type:

    -
    -cd path\to\some\directory
    -
    -

    followed by Return. For example,

    -
    -cd C: \Program`` \ ``Files\boost\boost_1_34_0
    -
    -

    One way to name a directory you know about is to write

    -
    -%HOMEDRIVE%%HOMEPATH%\directory-name
    -
    -

    which indicates a sibling folder of your “My Documents” folder.

    -

    Long commands can be continued across several lines by typing -backslashes at the ends of all but the last line. Many of the -examples on this page use that technique to save horizontal -space.


    @@ -896,10 +929,20 @@ where it's not worth the trouble. Finally, some compilers don't have any source code mechanism for suppressing warnings.
    + + + + + +
    [5]In this example, the caret character ^ is a +way of continuing the command on multiple lines. The command +prompt responds with More? to prompt for more input. Feel +free to omit the carets and subsequent newlines; we used them so +the example would fit on a page of reasonable width.
    - @@ -908,14 +951,14 @@ used in the examples.
    [5]There's no problem using Boost with precompiled headers; +
    [6]There's no problem using Boost with precompiled headers; these instructions merely avoid precompiled headers because it would require Visual Studio-specific changes to the source code used in the examples.
    -
    [6]That option is a dash followed by a lowercase “L” +
    [7]That option is a dash followed by a lowercase “L” character, which looks very much like a numeral 1 in some fonts.
    - @@ -924,7 +967,7 @@ same name.
    [7]This convention distinguishes the static version of +
    [8]This convention distinguishes the static version of a Boost library from the import library for an identically-configured Boost DLL, which would otherwise have the same name.
    -
    [8]These libraries were compiled without optimization +
    [9]These libraries were compiled without optimization or inlining, with full debug symbols enabled, and without NDEBUG #defined. All though it's true that sometimes these choices don't affect binary compatibility with other @@ -934,7 +977,7 @@ compiled code, you can't count on that with Boost libraries.
    - @@ -944,7 +987,7 @@ recommend it. diff --git a/getting_started.rst b/getting_started.rst index 131d7ee..4d44753 100644 --- a/getting_started.rst +++ b/getting_started.rst @@ -23,7 +23,7 @@ __ ../index.htm .. |root| replace:: ``/``\ *path*\ ``/``\ *to*\ ``/``\ |boost_ver| .. |winroot| replace:: *path*\ ``\``\ *to*\ ``\``\ |boost_ver| -.. |winroot-default| replace:: ``C:\Program``\ `` ``\ ``Files\boost\``\ |boost_ver| +.. |winroot-default| replace:: ``C:\``\ ``Program`` ``Files\boost\``\ |boost_ver| .. |bold-winroot-default| replace:: **C:\\Program Files\\boost\\**\ |boost_ver-bold| Introduction @@ -31,7 +31,7 @@ Introduction Welcome to the Boost libraries! By the time you've completed this tutorial, you'll be at least somewhat comfortable with the contents -of a Boost distribution and how to go about using it. +of a Boost distribution and how to go about using it. What's Here ----------- @@ -75,7 +75,7 @@ them for your own compiler or IDE. Get Boost ========= -There are basically three ways to get Boost on your system: +To get Boost, choose one of the following methods: 1. **Windows Installer**: Boost Consulting provides an installer_ for Windows platforms that installs a complete Boost @@ -89,7 +89,7 @@ There are basically three ways to get Boost on your system: .. _installer: `Windows installer`_ -2. **Download**: users of other platforms—and Windows +2. **Source Download**: users of other platforms—and Windows users who prefer to build everything from scratch—can `download a complete Boost distribution`__ from SourceForge. @@ -107,11 +107,13 @@ There are basically three ways to get Boost on your system: tar --bzip2 -xf */path/to/*\ |boost_ver|\ .tar.bz2 -3. **Boost packages** from RedHat, Debian, or some other - distribution packager: these instructions may not work for you - if you use 3rd party packages, because other packagers sometimes - choose to break Boost up into several packages or to reorganize - the directory structure of the Boost distribution. [#packagers]_ +3. **Boost packages** are available from RedHat, Debian, and other + distribution packagers. You may need to adapt these + instructions if you use this method, because other packagers + usually choose to break Boost up into several packages, + reorganize the directory structure of the Boost distribution, + and/or rename the library binaries. [#packagers]_ If you have + trouble, we suggest going back to method 2. The Structure of a Boost Distribution ===================================== @@ -156,8 +158,8 @@ slashes with backslashes): ``boost/python.hpp``. * Most libraries place private headers in a subdirectory called - ``detail/`` or ``aux_/``. Don't look in these directories and - expect to find anything you can use. + ``detail/`` or ``aux_/``. Don't + expect to find anything you can use in these directories. A few things are worth noting right off the bat: @@ -206,7 +208,7 @@ Header-Only Libraries The first thing many people want to know is, “how do I build Boost?” The good news is that often, there's nothing to build. -.. admonition:: Nothing to Build +.. admonition:: Nothing to Build? Most Boost libraries are **header-only**: they consist *entirely of header files* containing templates and inline functions, and @@ -215,26 +217,28 @@ Boost?” The good news is that often, there's nothing to build. .. _separate: -The only Boost libraries that can't be used without separate -compilation are: +The only Boost libraries that *must* be built separately are: -* Boost.Filesystem -* Boost.IOStreams -* Boost.ProgramOptions +* Boost.Filesystem_ +* Boost.IOStreams_ +* Boost.ProgramOptions_ * Boost.Python_ -* Boost.Regex -* Boost.Serialization -* Boost.Signals -* Boost.Test -* Boost.Thread -* Boost.Wave +* Boost.Regex_ +* Boost.Serialization_ +* Boost.Signals_ +* Boost.Thread_ +* Boost.Wave_ -The DateTime library has a separately-compiled component that -is only needed if you're using its to/from_string and/or -serialization features or if you're targeting Visual C++ 6.x or -Borland. The Graph library also has a separately-compiled part, -but you won't need it unless you intend to `parse GraphViz -files`__. +A few libraries have optional separately-compiled binaries: + +* Boost.DateTime_ has a binary component that is only needed if + you're using its ``to_string``\ /\ ``from_string`` or serialization + features, or if you're targeting Visual C++ 6.x or Borland. + +* Boost.Graph_ also has a binary component that is only needed if + you intend to `parse GraphViz files`__. + +* Boost.Test_ ... **Waiting for Gennadiy to tell me what to say here.** __ ../libs/graph/doc/read_graphviz.html @@ -288,8 +292,84 @@ To test the result, type: __ `Errors and Warnings`_ -Build from the Visual Studio Command Prompt -------------------------------------------- +Build on Windows +---------------- + +.. _`command prompt`: +.. _`command-line tool`: + +.. sidebar:: The Windows Command Prompt + :class: small + + In Windows, a command-line tool is invoked by typing its name, + optionally followed by arguments, into a *Command Prompt* window + and pressing the Return (or Enter) key. + + To open *Command Prompt*, click the *Start* menu button, click + *Run*, type “cmd”, and then click *OK*. + + All commands are executed within the context of a **current + directory** in the filesystem. To set the current directory, + type: + + .. parsed-literal:: + + cd *path*\ \\\ *to*\ \\\ *some*\ \\\ *directory* + + followed by Return. For example, + + .. parsed-literal:: + + cd |winroot-default| + + Long commands can be continued across several lines by typing a + caret (``^``) at the end of all but the last line. Some examples + on this page use that technique to save horizontal space. + +To build the examples in this guide, you can use an Integrated +Development Environment (IDE) like Visual Studio or you can follow +a shorter path by issuing commands from the command prompt. + +.. _vs-header-only: + +From the Visual Studio IDE +.......................... + +* From Visual Studio's *File* menu, select *New* > *Project…* +* In the left-hand pane of the resulting *New Project* dialog, + select *Visual C++* > *Win32*. +* In the right-hand pane, select *Win32 Console Application* + (VS8.0) or *Win32 Console Project* (VS7.1). +* In the *name* field, enter “example” +* Right-click **example** in the *Solution Explorer* pane and + select *Properties* from the resulting pop-up menu +* In *Configuration Properties* > *C/C++* > *General* > *Additional Include + Directories*, enter the path to the Boost root directory, for example + + |winroot-default| + +* In *Configuration Properties* > *C/C++* > *Precompiled Headers*, change + *Use Precompiled Header (/Yu)* to *Not Using Precompiled + Headers*. [#pch]_ +* Replace the contents of the ``example.cpp`` generated by the IDE + with the example code above. +* From the *Build* menu, select *Build Solution*. + +To test your application, hit the F5 key and type the following +into the resulting window, followed by the return key:: + + 1 2 3 + +Then hold down the control key and press "Z", followed by the +return key. + +|next|__ + +__ `Errors and Warnings`_ + + +From the Command Prompt +....................... From your computer's *Start* menu, if you are a Visual Studio 2005 user, select @@ -308,7 +388,7 @@ hit the return key: .. parsed-literal:: - cl /EHsc /I\ |winroot| *path*\ \\\ *to*\ \\example.cpp + cl /EHsc /I |winroot| *path*\ \\\ *to*\ \\example.cpp To test the result, type: @@ -316,41 +396,6 @@ To test the result, type: echo 1 2 3 | example -|next|__ - -__ `Errors and Warnings`_ - -.. _vs-header-only: - -Build in the Visual Studio IDE ------------------------------- - -* From Visual Studio's *File* menu, select *New* > *Project…* -* In the left-hand pane of the resulting *New Project* dialog, - select *Visual C++* > *Win32*. -* In the right-hand pane, select *Win32 Console Application* - (VS8.0) or *Win32 Console Project* (VS7.1). -* In the *name* field, enter “example” -* Right-click **example** in the *Solution Explorer* pane and - select *Properties* from the resulting pop-up menu -* In *Configuration Properties* > *C/C++* > *General* > *Additional Include - Directories*, enter the path to the Boost root directory, e.g. - |winroot-default|. -* In *Configuration Properties* > *C/C++* > *Precompiled Headers*, change - *Use Precompiled Header (/Yu)* to *Not Using Precompiled - Headers*. [#pch]_ -* Replace the contents of the ``example.cpp`` generated by the IDE - with the example code above. -* From the *Build* menu, select *Build Solution*. - -To test your application, hit the F5 key and type the following -into the resulting window, followed by the return key:: - - 1 2 3 - -Then hold down the control key and press "Z", followed by the -return key. - Errors and Warnings ------------------- @@ -363,8 +408,8 @@ this point in the tutorial, check to be sure you've copied the example program correctly and that you've correctly identified the Boost root directory. -Get Boost Library Binaries -========================== +Prepare to Use a Boost Library Binary +===================================== If you want to use any of the separately-compiled Boost libraries, you'll need library binaries. @@ -399,14 +444,16 @@ directory, you'll probably want to at least use **$** ./configure **--prefix=**\ *path*\ /\ *to*\ /\ *installation*\ /\ *prefix* -to install somewhere else. Finally, +to install somewhere else. Also, consider using the +``--show-libraries`` and ``--with-libraries=`` options to limit the +long wait you'll experience if you build everything. Finally, .. parsed-literal:: **$** make install -which will leave Boost binaries in the ``lib/`` subdirectory of -your installation prefix. You will also find a copy of the Boost +will leave Boost binaries in the ``lib/`` subdirectory of your +installation prefix. You will also find a copy of the Boost headers in the ``include/`` subdirectory of the installation prefix, so you can henceforth use that directory as an ``#include`` path in place of the Boost root directory. @@ -419,7 +466,7 @@ Build and Install Other Binaries -------------------------------- If you're not using Visual C++ 7.1 or 8.0, or you're a \*nix user -who wants want to build with a toolset other than your system's +who wants to build with a toolset other than your system's default, or if you want a nonstandard variant build of Boost (e.g. optimized, but with debug symbols), you'll need to use Boost.Build_ to create your own binaries. @@ -542,24 +589,23 @@ invoke ``bjam`` as follows: .. parsed-literal:: - bjam **--build-dir=**\ |build-directory|_ **\\** - **--toolset=**\ |toolset-name|_ stage + bjam **--build-dir=**\ |build-directory|_ **--toolset=**\ |toolset-name|_ stage -For example, on Windows, your session might look like: +For example, on Windows, your session might look like this: [#continuation]_ .. parsed-literal:: C:\WINDOWS> cd |winroot-default| - |winroot-default|> bjam **\\** - **--build-dir=**\ %TEMP%\\build-boost **\\** - **--toolset=msvc stage** + |winroot-default|> bjam **^** + More? **--build-dir=**\ %TEMP%\\build-boost **^** + More? **--toolset=**\ msvc stage And on Unix: .. parsed-literal:: $ cd ~/|boost_ver| - $ bjam **--build-dir=**\ ~/build-boost **--prefix=**\ ~/boost + $ bjam **--build-dir=**\ /tmp/build-boost **--toolset=**\ gcc In either case, Boost.Build will place the Boost binaries in the ``stage/`` subdirectory of your `build directory`_. @@ -572,6 +618,17 @@ For a description of other options you can pass when invoking bjam --help +In particular, to limit the amount of time spent building, you may +be interested in: + +* reviewing the list of library names with ``--show-libraries`` +* limiting which libraries get built with the ``--with-``\ + *library-name* or ``--without-``\ *library-name* options +* choosing a specific build variant by adding ``release`` or + ``debug`` to the command line. + + + Expected Build Output --------------------- @@ -640,8 +697,6 @@ separately-compiled binary component. :: } } -.. _Boost.Regex: ../libs/regex - There are two main challenges associated with linking: 1. Tool configuration, e.g. choosing command-line options or IDE @@ -651,13 +706,6 @@ There are two main challenges associated with linking: whose compile configuration is compatible with the rest of your project. -.. Note:: Boost.Python_ users should read that library's own `build - documentation`__ as there are several library-specific issues to - consider. - -.. _Boost.Python: ../libs/python/index.html -__ ../libs/python/doc/building.html - Link to a Boost Library on Windows ---------------------------------- @@ -706,7 +754,7 @@ __ vs-header-only_ __ `Test Your Program`_ -Link to a Boost Library On \*nix +Link to a Boost Library on \*nix -------------------------------- There are two main ways to link to libraries: @@ -895,6 +943,19 @@ mailing list`_. * `Boost Users' mailing list`_ * `Boost.Build mailing list`_ * `Boost.Build Wiki`_ +* Index of `All Library Documentation`_ +* Library-specific Configuration and Build Details + + - Boost.Python__ + + __ ../libs/python/doc/building.html + + - **Library authors need to send me the links for their + libraries** + + + +.. _All Library Documentation: ../libs/index.html .. Admonition:: Onward @@ -910,48 +971,6 @@ mailing list`_. .. _Boost.Build Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build_V2 .. _Boost.Build mailing list: mailing_lists.htm#jamboost - -.. _`Using command-line tools in Windows`: -.. _`command prompt`: -.. _`command-line tool`: - -Appendix: Using command-line tools in Windows -============================================= - -In Windows, a command-line tool is invoked by typing its name, -optionally followed by arguments, into a *Command Prompt* window -and pressing the Return (or Enter) key. - -To open *Command Prompt*, click the *Start* menu button, click -*Run*, type “cmd”, and then click OK. - -All commands are executed within the context of a **current -directory** in the filesystem. To set the current directory, -type: - -.. parsed-literal:: - - cd *path*\ \\\ *to*\ \\\ *some*\ \\\ *directory* - -followed by Return. For example, - -.. parsed-literal:: - - cd |winroot-default| - -One way to name a directory you know about is to write - -.. parsed-literal:: - - %HOMEDRIVE%%HOMEPATH%\\\ *directory-name* - -which indicates a sibling folder of your “My Documents” folder. - -Long commands can be continued across several lines by typing -backslashes at the ends of all but the last line. Many of the -examples on this page use that technique to save horizontal -space. - ------------------------------ .. [#zip] If you prefer not to download executable programs, download @@ -979,6 +998,12 @@ space. where it's not worth the trouble. Finally, some compilers don't have any source code mechanism for suppressing warnings. +.. [#continuation] In this example, the caret character ``^`` is a + way of continuing the command on multiple lines. The command + prompt responds with ``More?`` to prompt for more input. Feel + free to omit the carets and subsequent newlines; we used them so + the example would fit on a page of reasonable width. + .. [#pch] There's no problem using Boost with precompiled headers; these instructions merely avoid precompiled headers because it would require Visual Studio-specific changes to the source code @@ -1002,3 +1027,15 @@ space. impossible to make it work transparently to the user; we don't recommend it. +.. _Boost.DateTime: ../libs/date_time/index.html +.. _Boost.Filesystem: ../libs/filesystem/index.html +.. _Boost.Graph: ../libs/graph/index.html +.. _Boost.IOStreams: ../libs/iostreams/index.html +.. _Boost.ProgramOptions: ../libs/program_options/index.html +.. _Boost.Python: ../libs/python/index.html +.. _Boost.Regex: ../libs/regex/index.html +.. _Boost.Serialization: ../libs/serialization/index.html +.. _Boost.Signals: ../libs/signals/index.html +.. _Boost.Test: ../libs/test/index.html +.. _Boost.Thread: ../libs/thread/index.html +.. _Boost.Wave: ../libs/wave/index.html
    [9]This feature of STLPort is deprecated because it's +
    [10]This feature of STLPort is deprecated because it's impossible to make it work transparently to the user; we don't recommend it.