From 7a121840155daff018f3c78cad90dd8d99144cf2 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 11 Apr 2007 23:35:08 +0000 Subject: [PATCH] Some progress on Python build guide. Minor fixes to getting started guide. [SVN r37418] --- .../detail/build-from-source-head.rst | 2 +- getting_started/detail/header-only.rst | 7 +- getting_started/detail/library-naming.rst | 6 +- getting_started/unix-variants.html | 152 ++++++++------- getting_started/unix-variants.rst | 2 +- getting_started/windows.html | 184 +++++++++--------- 6 files changed, 182 insertions(+), 171 deletions(-) diff --git a/getting_started/detail/build-from-source-head.rst b/getting_started/detail/build-from-source-head.rst index 7e55da8..b2dfd5c 100644 --- a/getting_started/detail/build-from-source-head.rst +++ b/getting_started/detail/build-from-source-head.rst @@ -10,7 +10,7 @@ installing software. To use it, you'll need an executable called .. _precompiled-bjam: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941 -.. _Boost.Jam documentation: Boost.Jam_ +.. .. _Boost.Jam documentation: Boost.Jam_ .. _Boost.Build: ../../tools/build/index.html .. _Boost.Jam: ../../tools/jam/index.html .. _Boost.Build documentation: Boost.Build_ diff --git a/getting_started/detail/header-only.rst b/getting_started/detail/header-only.rst index 13d7e3f..c1f1dd3 100644 --- a/getting_started/detail/header-only.rst +++ b/getting_started/detail/header-only.rst @@ -15,20 +15,23 @@ Boost?” The good news is that often, there's nothing to build. require no separately-compiled library binaries or special treatment when linking. -.. _separate: +.. .. _separate: The only Boost libraries that *must* be built separately are: * Boost.Filesystem_ * Boost.IOStreams_ * Boost.ProgramOptions_ -* Boost.Python_ +* Boost.Python_ (see the `Boost.Python build documentation`__ + before building and installing it) * Boost.Regex_ * Boost.Serialization_ * Boost.Signals_ * Boost.Thread_ * Boost.Wave_ +__ ../../libs/python/doc/building.html + A few libraries have optional separately-compiled binaries: * Boost.DateTime_ has a binary component that is only needed if diff --git a/getting_started/detail/library-naming.rst b/getting_started/detail/library-naming.rst index ad1d512..76d99ed 100644 --- a/getting_started/detail/library-naming.rst +++ b/getting_started/detail/library-naming.rst @@ -19,7 +19,7 @@ following elements: *Library name*: all boost library filenames begin with ``boost_``. ``-vc71`` - *Toolset tag*: identifies the toolset and version used to build + *Toolset tag*: identifies the toolset_ and version used to build the binary. ``-mt`` @@ -68,13 +68,13 @@ following elements: ``.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 the ``gcc`` - toolset, whose names always end in ``.a``) ``.lib`` indicates a + toolset_, whose names always end in ``.a``) ``.lib`` indicates a static or import library. Where supported by toolsets on unix variants, 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. -.. _Boost.Build toolset names: toolset-name_ +.. .. _Boost.Build toolset names: toolset-name_ __ ../../libs/python/doc/building.html#variants diff --git a/getting_started/unix-variants.html b/getting_started/unix-variants.html index 1d4365f..29610be 100644 --- a/getting_started/unix-variants.html +++ b/getting_started/unix-variants.html @@ -27,43 +27,43 @@ .. _`Getting Started on Windows`: windows.html .. _Cygwin: http://www.cygwin.com .. _MinGW: http://mingw.org --> -
-

Index

+ -
-

1   Get Boost

+
+

1   Get Boost

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

    -
  1. Download boost_1_34_0.tar.bz2.

    +
  2. Download boost_1_34_0.tar.bz2.

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

    @@ -79,7 +79,7 @@ library packages, however you may need to adapt these instructions if you use third-party packages, because their 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 +and/or rename the library binaries.1 If you have any trouble, we suggest using an official Boost distribution from SourceForge.

@@ -87,8 +87,8 @@ from -

2   The Boost Distribution

+
+

2   The Boost Distribution

This is a sketch of the resulting directory structure:

 boost_1_34_0/ .................The “boost root directory”
@@ -165,8 +165,8 @@ 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.

@@ -176,12 +176,14 @@ 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 must be built separately are:

+ +

The only Boost libraries that must be built separately are:

-
-

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 @@ -237,11 +239,11 @@ echo 1 2 3 | ./example -

-

4.1   Errors and Warnings

+
+

4.1   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.3 Errors are another matter. If you're +practical.3 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.

@@ -250,12 +252,12 @@ correctly identified the Boost
-
-

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   Easy Build and Install

+
+

5.1   Easy Build and Install

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

@@ -282,8 +284,8 @@ prefix, so you can henceforth use that directory as an skip to the next step

-
-

5.2   Or, Custom Build and Install

+
+

5.2   Or, Custom Build and Install

If you're using a compiler other than your system's default, you'll need to use Boost.Build to create binaries. You'll also use this method if you need a nonstandard build variant (see the @@ -294,8 +296,9 @@ use this method if you need a nonstandard build variant (see the

Boost.Build is a text-based system for developing, testing, and installing software. To use it, you'll need an executable called bjam.

-
-

5.2.1   Get bjam

+ +
+

5.2.1   Get bjam

bjam is the command-line tool that drives the Boost Build system. To build Boost binaries, you'll invoke bjam from the Boost root.

@@ -303,8 +306,8 @@ Boost root.

Alternatively, you can build bjam yourself using these instructions.

-
-

5.2.2   Identify Your Toolset

+
+

5.2.2   Identify Your Toolset

First, find the toolset corresponding to your compiler in the following table.

@@ -405,20 +408,20 @@ affect this step in any way; you still need to select a Boost.Build toolset from the table.

-
-

5.2.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 default Boost.Build will create a bin.v2/ subdirectory for that purpose in your current working directory.

-
-

5.2.4   Invoke bjam

+
+

5.2.4   Invoke bjam

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, your session might look like this:

@@ -450,8 +453,8 @@ be interested in:

-
-

5.3   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

    @@ -474,8 +477,8 @@ look something like:

-
-

5.4   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 @@ -492,8 +495,8 @@ questions about configuring Boost for your compiler to the

-
-

6   Link Your Program to a Boost Library

+
- + - +
using a special debug build of Python.
dbuilding a debug version of your code.5building a debug version of your code.5
p using the STLPort standard library rather than the default one supplied with your compiler.
nusing STLPort's deprecated “native iostreams” feature.6using STLPort's deprecated “native iostreams” feature.6
@@ -632,18 +635,19 @@ convention. On most unix-style 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 the gcc -toolset, whose names always end in .a) .lib indicates a +toolset, whose names always end in .a) .lib indicates a static or import library. Where supported by toolsets on unix variants, 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. +
-
-

6.2   Test Your Program

+
+

6.2   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:

@@ -682,8 +686,8 @@ 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 @@ -711,7 +715,7 @@ mailing list.

-
[1]

If developers of Boost packages would like to work +

[1]

If developers of Boost packages would like to work with us to make sure these instructions can be used with their packages, we'd be glad to help. Please make your interest known to the Boost developers' list.

@@ -721,7 +725,7 @@ to the Boost devel -
[2]That option is a dash followed by a lowercase “L” +
[2]That option is a dash followed by a lowercase “L” character, which looks very much like a numeral 1 in some fonts.
@@ -731,7 +735,7 @@ character, which looks very much like a numeral 1 in some fonts.
-
[3]Remember that warnings are specific to each compiler +
[3]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 @@ -742,7 +746,7 @@ have any source code mechanism for suppressing warnings.
- @@ -751,7 +755,7 @@ same name.
[4]This convention distinguishes the static version of +
[4]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.
-
[5]These libraries were compiled without optimization +
[5]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 @@ -761,7 +765,7 @@ compiled code, you can't count on that with Boost libraries.
- diff --git a/getting_started/unix-variants.rst b/getting_started/unix-variants.rst index 6924468..fe39dba 100644 --- a/getting_started/unix-variants.rst +++ b/getting_started/unix-variants.rst @@ -40,7 +40,7 @@ distribution from SourceForge_: .. _SourceForge: `sf-download`_ -1. Download |boost.tar.bz2|. +1. Download |boost.tar.bz2|_. 2. In the directory where you want to put the Boost installation, execute diff --git a/getting_started/windows.html b/getting_started/windows.html index 11817cf..af0b041 100644 --- a/getting_started/windows.html +++ b/getting_started/windows.html @@ -23,43 +23,43 @@ should follow the instructions for MinGW's MSYS, are not supported—they may or may not work.

-
-

Index

+
+

Index

-
-

1   Get Boost

+
+

1   Get Boost

The easiest way to get a copy of Boost is to use the installer provided by Boost Consulting. We especially recommend this method if you use Microsoft Visual Studio .NET 2003 or Microsoft @@ -70,13 +70,13 @@ install the Boost.Regex<

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_34_0.exe and run it to install a complete Boost -distribution.1

+distribution.1

-
-

2   The Boost Distribution

+
+

2   The Boost Distribution

This is a sketch of the resulting directory structure:

 boost_1_34_0\ .................The “boost root directory”
@@ -158,8 +158,8 @@ 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.

@@ -169,12 +169,14 @@ 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 must be built separately are:

+ +

The only Boost libraries that must be built separately are:

-
-

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 @@ -218,8 +220,8 @@ int main() }

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

-
-

Note

+
+

Note

To build the examples in this guide, you can use an Integrated Development Environment (IDE) like Visual Studio, or you can issue commands from the command prompt. Since every @@ -252,8 +254,8 @@ cd C:\Program ^) 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…

  • @@ -276,7 +278,7 @@ Directories, enter the path to the Boost root directory, for example

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

    +Headers.3

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

    @@ -293,8 +295,8 @@ into the resulting window, followed by the Return key:

    Return key.

    skip to the next step

-
-

4.2   Or, Build From the Command Prompt

+
+

4.2   Or, Build From the Command Prompt

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

@@ -319,11 +321,11 @@ echo 1 2 3 | example
-
-

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

@@ -332,12 +334,12 @@ correctly identified the Boost
-
-

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 (2005 or .NET 2003) Binaries

+
+

5.1   Install Visual Studio (2005 or .NET 2003) Binaries

The 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\. If you installed @@ -346,8 +348,8 @@ step. Otherwise, please run the installer again and install them now.

skip to the next step

-
-

5.2   Or, Build and Install Binaries From Source

+
+

5.2   Or, Build and Install 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.

@@ -357,8 +359,9 @@ own binaries.

Boost.Build is a text-based system for developing, testing, and installing software. To use it, you'll need an executable called bjam.

-
-

5.2.1   Get bjam

+ +
+

5.2.1   Get bjam

bjam is the command-line tool that drives the Boost Build system. To build Boost binaries, you'll invoke bjam from the Boost root.

@@ -366,8 +369,8 @@ Boost root.

Alternatively, you can build bjam yourself using these instructions.

-
-

5.2.2   Identify Your Toolset

+
+

5.2.2   Identify Your Toolset

First, find the toolset corresponding to your compiler in the following table.

[6]This feature of STLPort is deprecated because it's +
[6]This feature of STLPort is deprecated because it's impossible to make it work transparently to the user; we don't recommend it.
@@ -468,22 +471,22 @@ affect this step in any way; you still need to select a Boost.Build toolset from the table.

-
-

5.2.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 default Boost.Build will create a bin.v2/ subdirectory for that purpose in your current working directory.

-
-

5.2.4   Invoke bjam

+
+

5.2.4   Invoke bjam

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, your session might look like this:4

+

For example, your session might look like this:4

 C:WINDOWS> cd C:\Program Files\boost\boost_1_34_0
 C:\Program Files\boost\boost_1_34_0> bjam ^
@@ -515,8 +518,8 @@ be interested in:

-
-

5.3   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

    @@ -539,8 +542,8 @@ look something like:

-
-

5.4   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 @@ -557,8 +560,8 @@ questions about configuring Boost for your compiler to the

-
-

6   Link Your Program to a Boost Library

+ -
-

6.1   Link From Within the Visual Studio IDE

+ -
-

6.2   Or, Link From the Command Prompt

+ -
-

6.3   Library Naming

+
+

6.3   Library Naming

Note

If, like Visual C++, your compiler supports auto-linking, @@ -647,11 +650,11 @@ 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.6
boost_regex
Library name: all boost library filenames begin with boost_.
-vc71
-
Toolset tag: identifies the toolset and version used to build +
Toolset tag: identifies the toolset and version used to build the binary.
-mt
Threading tag: indicates that the library was @@ -685,14 +688,14 @@ libraries.
- + - +
using a special debug build of Python.
dbuilding a debug version of your code.7building a debug version of your code.7
p using the STLPort standard library rather than the default one supplied with your compiler.
nusing STLPort's deprecated “native iostreams” feature.8using STLPort's deprecated “native iostreams” feature.8
@@ -713,18 +716,19 @@ convention. On most unix-style 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 the gcc -toolset, whose names always end in .a) .lib indicates a +toolset, whose names always end in .a) .lib indicates a static or import library. Where supported by toolsets on unix variants, 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. +
-
-

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:

@@ -745,8 +749,8 @@ 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 @@ -774,7 +778,7 @@ mailing list.

- @@ -783,7 +787,7 @@ it can be painfully slow for large archives.
[1]If you prefer not to download executable programs, +
[1]If you prefer not to download executable programs, download boost_1_34_0.zip and use an external tool to decompress it. 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 +
[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 @@ -793,7 +797,7 @@ you won't be able to rebuild libraries from scratch.
- @@ -802,7 +806,7 @@ used in the examples.
[3]There's no problem using Boost with precompiled headers; +
[3]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 +
[4]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 @@ -815,7 +819,7 @@ the example would fit on a page of reasonable width.
-
[5]Remember that warnings are specific to each compiler +
[5]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 @@ -826,7 +830,7 @@ have any source code mechanism for suppressing warnings.
- @@ -835,7 +839,7 @@ same name.
[6]This convention distinguishes the static version of +
[6]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 +
[7]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 @@ -845,7 +849,7 @@ compiled code, you can't count on that with Boost libraries.
-
[8]This feature of STLPort is deprecated because it's +
[8]This feature of STLPort is deprecated because it's impossible to make it work transparently to the user; we don't recommend it.