From 9bdd70e0dac84da075a40ab118626323c8f377d6 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 3 Mar 2013 11:06:40 +0000 Subject: [PATCH] Merge getting started guide. Removes references to the boostpro installer. [SVN r83267] --- getting_started/index.html | 2 +- getting_started/unix-variants.html | 24 ++-- getting_started/windows.html | 176 ++++++++++++----------------- getting_started/windows.rst | 44 +------- 4 files changed, 88 insertions(+), 158 deletions(-) diff --git a/getting_started/index.html b/getting_started/index.html index f82b1e4..14a4021 100644 --- a/getting_started/index.html +++ b/getting_started/index.html @@ -3,7 +3,7 @@ - + Boost Getting Started diff --git a/getting_started/unix-variants.html b/getting_started/unix-variants.html index 4b3ee6d..598af61 100644 --- a/getting_started/unix-variants.html +++ b/getting_started/unix-variants.html @@ -3,7 +3,7 @@ - + Boost Getting Started on Unix Variants @@ -61,14 +61,14 @@

1   Get Boost

The most reliable way to get a copy of Boost is to download a -distribution from SourceForge:

+distribution from SourceForge:

    -
  1. Download boost_1_53_0.tar.bz2.

    +
  2. Download boost_1_54_0.tar.bz2.

  3. In the directory where you want to put the Boost installation, execute

    -tar --bzip2 -xf /path/to/boost_1_53_0.tar.bz2
    +tar --bzip2 -xf /path/to/boost_1_54_0.tar.bz2
     
@@ -81,7 +81,7 @@ creators usually choose to break Boost up into several packages, reorganize the directory structure of the Boost distribution, and/or rename the library binaries.1 If you have any trouble, we suggest using an official Boost distribution -from SourceForge.

+from SourceForge.

@@ -91,7 +91,7 @@ from 2   The Boost Distribution

This is a sketch of the resulting directory structure:

-boost_1_53_0/ .................The “boost root directory”
+boost_1_54_0/ .................The “boost root directory”
    index.htm .........A copy of www.boost.org starts here
    boost/ .........................All Boost Header files
     
@@ -136,7 +136,7 @@ anything you can use in these directories.

It's important to note the following:

    -
  1. The path to the boost root directory (often /usr/local/boost_1_53_0) is +

  2. The path to the boost root directory (often /usr/local/boost_1_54_0) is sometimes referred to as $BOOST_ROOT in documentation and mailing lists .

  3. @@ -237,7 +237,7 @@ int main()

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

    -c++ -I path/to/boost_1_53_0 example.cpp -o example
    +c++ -I path/to/boost_1_54_0 example.cpp -o example
     

    To test the result, type:

    @@ -268,7 +268,7 @@ you'll need to acquire library binaries.

    Issue the following commands in the shell (don't type $; that represents the shell's prompt):

    -$ cd path/to/boost_1_53_0
    +$ cd path/to/boost_1_54_0
     $ ./bootstrap.sh --help
     

    Select your configuration options and invoke ./bootstrap.sh again @@ -420,7 +420,7 @@ b2 --build-dir=b please see the Boost.Build documentation.

    For example, your session might look like this:

    -$ cd ~/boost_1_53_0
    +$ cd ~/boost_1_54_0
     $ b2 --build-dir=/tmp/build-boost toolset=gcc stage
     

    That will build static and shared non-debug multi-threaded variants of the libraries. To build all variants, pass the additional option, “--build-type=complete”.

    @@ -536,14 +536,14 @@ project.
    1. You can specify the full path to each library:

      -$ c++ -I path/to/boost_1_53_0 example.cpp -o example \
      +$ c++ -I path/to/boost_1_54_0 example.cpp -o example \
          ~/boost/stage/lib/libboost_regex-gcc34-mt-d-1_36.a
       
    2. You can separately specify a directory to search (with -Ldirectory) and a library name to search for (with -llibrary,2 dropping the filename's leading lib and trailing suffix (.a in this case):

      -$ c++ -I path/to/boost_1_53_0 example.cpp -o example \
      +$ c++ -I path/to/boost_1_54_0 example.cpp -o example \
          -L~/boost/stage/lib/ -lboost_regex-gcc34-mt-d-1_36
       

      As you can see, this method is just as terse as method A for one diff --git a/getting_started/windows.html b/getting_started/windows.html index e790395..1ca06e8 100644 --- a/getting_started/windows.html +++ b/getting_started/windows.html @@ -3,7 +3,7 @@ - + Boost Getting Started on Windows @@ -26,64 +26,52 @@ not supported—they may or may not work.

      Index

      -

      1   Get Boost

      -

      The easiest way to get a copy of Boost is to use an installer. The -Boost website version of this Getting Started guide will have -updated information on installers as they become available, or see -Boost downloads or the installer provided by BoostPro -Computing. We especially recommend using an installer if you use -Microsoft Visual Studio, because the installer can download and -install precompiled library binaries, saving you the trouble of -building them yourself. To complete this tutorial, you'll need to at -least install the Static Multithreaded variants of the Boost.Regex -binaries when given the option.

      -

      If you're using an earlier version of Visual Studio or some other -compiler, or if you prefer to build everything yourself, you can -download boost_1_53_0.7z or boost_1_53_0.zip and unpack it to install a complete Boost +

      1   Get Boost

      +

      The most reliable way to get a copy of Boost is to +download boost_1_54_0.7z or boost_1_54_0.zip and unpack it to install a complete Boost distribution.1

      -

      2   The Boost Distribution

      +

      2   The Boost Distribution

      This is a sketch of the resulting directory structure:

      -boost_1_53_0\ .................The “boost root directory”
      +boost_1_54_0\ .................The “boost root directory”
          index.htm .........A copy of www.boost.org starts here
          boost\ .........................All Boost Header files
          lib\ .....................precompiled library binaries
      @@ -128,7 +116,7 @@ anything you can use in these directories.

      It's important to note the following:

        -
      1. The path to the boost root directory (often C:\Program Files\boost\boost_1_53_0) is +

      2. The path to the boost root directory (often C:\Program Files\boost\boost_1_54_0) is sometimes referred to as $BOOST_ROOT in documentation and mailing lists .

      3. @@ -163,7 +151,7 @@ contains a subset of the Boost documentation. Start with
        -

        3   Header-Only Libraries

        +

        3   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.

        @@ -210,7 +198,7 @@ use.
        -

        4   Build a Simple Program Using Boost

        +

        4   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 @@ -259,14 +247,14 @@ cd path\to\some\directory

    followed by Return. For example,

    -cd C:\Program Files\boost\boost_1_53_0
    +cd C:\Program Files\boost\boost_1_54_0
     

    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.

    -

    4.1   Build From the Visual Studio IDE

    +

    4.1   Build From the Visual Studio IDE

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

    • @@ -284,12 +272,12 @@ 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_53_0

      +

      C:\Program Files\boost\boost_1_54_0

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

      +Headers
      .2

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

      @@ -307,7 +295,7 @@ Return key.

      skip to the next step

    -

    4.3   Errors and Warnings

    +

    4.3   Errors and Warnings

    Don't be alarmed if you see compiler warnings originating in Boost headers. We try to eliminate them, but doing so isn't always -practical.5 Errors are another matter. If you're +practical.4 Errors are another matter. If you're seeing compilation errors at 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.

    @@ -346,21 +334,11 @@ correctly identified the -

    5   Prepare to Use a Boost Library Binary

    +

    5   Prepare to Use a Boost Library Binary

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

    -
    -

    5.1   Install Visual Studio Binaries

    -

    The installers supplied by BoostPro Computing will download and -install pre-compiled binaries into the lib\ subdirectory of the -boost root, typically C:\Program Files\boost\boost_1_53_0\lib\. If you installed -all variants of the Boost.Regex binary, you're done with this -step. Otherwise, please run the installer again and install them -now.

    -

    skip to the next step

    -
    -
    -

    5.2   Or, Simplified Build From Source

    +
    +

    5.1   Simplified Build From Source

    If you wish to build from source with Visual C++, you can use a simple build procedure described in this section. Open the command prompt and change your current directory to the Boost root directory. Then, type @@ -375,7 +353,7 @@ libraries. Please consult the -

    5.3   Or, Build Binaries From Source

    +

    5.2   Or, Build Binaries From Source

    If you're using an earlier version of Visual C++, or a compiler from another vendor, you'll need to use Boost.Build to create your own binaries.

    @@ -388,7 +366,7 @@ separately. See the -

    5.3.1   Install Boost.Build

    +

    5.2.1   Install Boost.Build

    Boost.Build is a text-based system for developing, testing, and installing software. First, you'll need to build and install it. To do this:

    @@ -401,7 +379,7 @@ the directory where you want Boost.Build to be installed
-

5.3.2   Identify Your Toolset

+

5.2.2   Identify Your Toolset

First, find the toolset corresponding to your compiler in the following table (an up-to-date list is always available in the Boost.Build documentation).

@@ -486,7 +464,7 @@ are using the msvc or gcc toolsets, which have special version detection code) or auto-linking will fail.

-

5.3.3   Select a Build Directory

+

5.2.3   Select a Build Directory

Boost.Build will place all intermediate files it generates while building into the build directory. If your Boost root directory is writable, this step isn't strictly necessary: by @@ -494,18 +472,18 @@ default Boost.Build will create a bin.v2/ subd purpose in your current working directory.

-

5.3.4   Invoke b2

+

5.2.4   Invoke b2

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

-b2 --build-dir=build-directory toolset=toolset-name --build-type=complete stage
+b2 --build-dir=build-directory toolset=toolset-name --build-type=complete stage
 

For a complete description of these and other invocation options, please see the Boost.Build documentation.

-

For example, your session might look like this:4

+

For example, your session might look like this:3

-C:\WINDOWS> cd C:\Program Files\boost\boost_1_53_0
-C:\Program Files\boost\boost_1_53_0> b2 ^
+C:\WINDOWS> cd C:\Program Files\boost\boost_1_54_0
+C:\Program Files\boost\boost_1_54_0> b2 ^
 More? --build-dir="C:\Documents and Settings\dave\build-boost" ^
 More? --build-type=complete msvc stage
 
@@ -550,7 +528,7 @@ file by appending “>build.log -

5.4   Expected Build Output

+

5.3   Expected Build Output

During the process of building Boost libraries, you can expect to see some messages printed on the console. These may include

    @@ -574,7 +552,7 @@ look something like:

-

5.5   In Case of Build Errors

+

5.4   In Case of Build Errors

The only error messages you see when building Boost—if any—should be related to the IOStreams library's support of zip and bzip2 formats as described here. Install the relevant development @@ -591,7 +569,7 @@ for your compiler to the -

6   Link Your Program to a Boost Library

+

6   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 @@ -636,7 +614,7 @@ GCC users should refer to the -

6.1   Link From Within the Visual Studio IDE

+

6.1   Link From Within the Visual Studio IDE

Starting with the header-only example project we created earlier:

    @@ -644,24 +622,24 @@ earlier:

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

skip to the next step

-

6.3   Library Naming

+

6.3   Library Naming

Note

If, like Visual C++, your compiler supports auto-linking, @@ -683,7 +661,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.6
+not.5
boost_regex
Library name: all boost library filenames begin with boost_.
-vc71
@@ -726,7 +704,7 @@ libraries. python-debugging=on d -building a debug version of your code.7 +building a debug version of your code.6 variant=debug p @@ -764,7 +742,7 @@ version number, will also be created.
-

6.4   Test Your Program

+

6.4   Test Your Program

To test our subject extraction, we'll filter the following text file. Copy it out of your browser and save it as jayne.txt:

@@ -786,7 +764,7 @@ Spoil Rock Hunter?”

-

7   Conclusion and Further Resources

+

7   Conclusion and Further Resources

This concludes your introduction to Boost and to integrating it with your programs. As you start using Boost in earnest, there are surely a few additional points you'll wish we had covered. One day @@ -813,26 +791,16 @@ mailing list.

[1]We recommend -downloading boost_1_53_0.7z and using 7-Zip to decompress +downloading boost_1_54_0.7z and using 7-Zip to decompress it. We no longer recommend .zip files for Boost because they are twice as large as the equivalent .7z files. We don't recommend using Windows' built-in decompression as it can be painfully slow for large archives. - - - - - -
[2]If you used the installer from Boost -Consulting and deselected “Source and Documentation” (it's -selected by default), you won't see the libs/ subdirectory. -That won't affect your ability to use precompiled binaries, but -you won't be able to rebuild libraries from scratch.
- @@ -841,7 +809,7 @@ used in the examples.
[3]There's no problem using Boost with precompiled headers; +
[2]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.
-
[4]

In this example, the caret character ^ is a +

[3]

In this example, the caret character ^ is a way of continuing the command on multiple lines, and must be the final character used on the line to be continued (i.e. do not follow it with spaces). The command prompt responds with @@ -868,7 +836,7 @@ command-line argument contains spaces, as in

-
[5]Remember that warnings are specific to each compiler +
[4]Remember that warnings are specific to each compiler implementation. The developer of a given Boost library might not have access to your compiler. Also, some warnings are extremely difficult to eliminate in generic code, to the point @@ -879,7 +847,7 @@ have any source code mechanism for suppressing warnings.
- @@ -888,7 +856,7 @@ same name.
[6]This convention distinguishes the static version of +
[5]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.
-
[7]These libraries were compiled without optimization +
[6]These libraries were compiled without optimization or inlining, with full debug symbols enabled, and without NDEBUG #defined. Although it's true that sometimes these choices don't affect binary compatibility with other @@ -898,7 +866,7 @@ compiled code, you can't count on that with Boost libraries.
- diff --git a/getting_started/windows.rst b/getting_started/windows.rst index a8fb652..29d5b5e 100644 --- a/getting_started/windows.rst +++ b/getting_started/windows.rst @@ -35,25 +35,7 @@ __ ../../index.htm Get Boost ========= -The easiest way to get a copy of Boost is to use an installer. The -`Boost website version of this Getting Started guide`_ will have -updated information on installers as they become available, or see -`Boost downloads`_ or the installer_ provided by `BoostPro -Computing`_. We especially recommend using an installer if you use -Microsoft Visual Studio, because the installer can download and -install precompiled library binaries, saving you the trouble of -building them yourself. To complete this tutorial, you'll need to at -least install the Static Multithreaded variants of the Boost.Regex_ -binaries when given the option. - -.. _`Boost website version of this Getting Started guide`: - http://www.boost.org/more/getting_started/index.html -.. _`Boost downloads`: `sf-download`_ -.. _installer: http://www.boostpro.com/products/free -.. _BoostPro Computing: http://www.boostpro.com - -If you're using an earlier version of Visual Studio or some other -compiler, or if you prefer to build everything yourself, you can +The most reliable way to get a copy of Boost is to download |boost.7z|_ or |boost_zip|_ and unpack it to install a complete Boost distribution. [#zip]_ @@ -185,22 +167,8 @@ To test the result, type: .. include:: detail/binary-head.rst -Install Visual Studio Binaries ------------------------------- - -The installers supplied by BoostPro Computing will download and -install pre-compiled binaries into the ``lib\`` subdirectory of the -boost root, typically |default-root|\ ``\lib\``. If you installed -all variants of the Boost.Regex_ binary, you're done with this -step. Otherwise, please run the installer again and install them -now. - -|next|__ - -__ `Link Your Program to a Boost Library`_ - -Or, Simplified Build From Source --------------------------------- +Simplified Build From Source +---------------------------- If you wish to build from source with Visual C++, you can use a simple build procedure described in this section. Open the command prompt @@ -340,12 +308,6 @@ Spoil Rock Hunter?” .. _7-Zip: http://www.7-zip.org -.. [#installer-src] If you used the installer_ from Boost - Consulting and deselected “Source and Documentation” (it's - selected by default), you won't see the ``libs/`` subdirectory. - That won't affect your ability to use precompiled binaries, but - you won't be able to rebuild libraries from scratch. - .. [#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
[8]This feature of STLPort is deprecated because it's +
[7]This feature of STLPort is deprecated because it's impossible to make it work transparently to the user; we don't recommend it.