How boost is compiled

Source: Internet
Author: User
Tags documentation

A lot of new people do not have the capacity to build boost, and even give up using boost, it's really too bad, I put some of the commonly used boost compilation methods here, but also as their own notes.
First download the Bjam.exe and copy it to the $BOOST $ directory. or generate Bjam yourself, open the Visual Studio 2008 Command Prompt window $BOOST$\TOOLS\JAM\SRC, and the execution BUILD.bat will be generated in $boost$\tools\jam\src\bin.ntx86 Bjam.exe files. Copy the file Bjam.exe file to the $BOOST $\.
1. Full Compile Installation:
Bjam--toolset=msvc Install
When completed, a bin.v2 compile-time directory is generated and manually deleted. Generate another directory C:\boost with all header files and library files. The header file directory replicates the past for the Boost_1_34_1\boost directory.
2. Compile the corresponding library files only
Bjam--toolset=msvc Stage
The Bin.v2 temporary directory is also generated when completed. The other directory is the stage file, which has the corresponding library file.
3. View the list of libraries that you need to compile to use
Bjam--show-libraries
4. Compile specific libraries, such as compiling regex only
Bjam--toolset=msvc--with-regex Stage
The generated library file is in the stage directory.
5. Do not compile a library, such as not compile regex
Bjam--toolset=msvc--without-regex Stage
The generated library file is in the stage directory.
6. Compile specific libraries, such as compiling regex only, generating debug, multithreading, sharing connection versions, and saving them in stage.
Bjam--toolset=msvc--with-regex Stage Debug Threading=multi link=shared
7. Generate MT-SGD Static library (runtime-link-static)
Bjam "-stools=vc-8_0"--with-thread install debug Release runtime-link=static
8. Compile the Regex library.
Bjam--toolset=msvc--with-regex Stage Debug Release Threading=multi Threading=single link=shared link=static Runtime-link=shared runtime-link=static
How to install Boost:
for DLL versions
Bjam--toolset=msvc link=shared runtime-link=shared threading=multi stage Debug Release Install
For Lib version
Bjam--toolset=msvc link=static runtime-link=shared threading=multi stage Debug Release Install
In addition, find the following text in $boost$\tools\build\v2\user-config.jam
# -------------------
# MSVC configuration.
# -------------------
# Configure MSVC (default version, searched for in standard locations and PATH).
# using MSVC;
# Configure specific msvc version (searched for in standard locations and PATH).
# using msvc:8.0;
Configuration of the #在这里添加 vs2008
Using msvc:9.0::/wd4819/d_crt_secure_no_deprecate/d_scl_secure_no_deprecate/d_secure_scl=0;
Configuration of the #在这里添加 vs2005
Using msvc:8.0:: <compileflags>/wd4819 <compileflags>/d_crt_secure_no_deprecate <compileflags>/D _scl_secure_no_deprecate <compileflags>/d_secure_scl=0;
Then enter the $BOOST $ directory and execute the bjam.exe compilation command
Description of the options for the following command:
Prefix the path where boost is installed (both the generated header file and the library file are placed in that path).
Redefine the following variables (with the-s setting):
Vc80_root vc2005 installation path, you must specify this if the vc2005 is not installed to the default location.
Tools used in the compilation tool, vc2005 corresponds to the VC-8_0
Python_root Ython installation directory, you must specify this if boost is not installed to the default location.
Build compilation results option, default will generate as many versions as possible, such as debug version/distribution, static library/dynamic library, single-threaded/multithreading.
Bjam Command Description
Boost.build V2 (Milestone 12)
Boost.jam 03.1.16
Project-specific Help:
Project has jamfile at Jamroot
Usage:
Bjam [Options] [Properties] [Install|stage]
Builds and installs Boost.
Targets and Related Options:
Install install headers and compiled library files to the
======= configured locations (below).
--prefix=<prefix> Install architecture independent files here.
Default; C:\Boost on Win32
Default; /usr/local on Unix. Linux, etc.
--exec-prefix=<eprefix> Install architecture dependent files here.
Default; <PREFIX>
--libdir=<dir> Install library files here.
Default; <eprefix>/lib
--includedir=Default; <prefix>/include
Stage build and install only compiled library files
===== to the stage directory.
--stagedir=<stagedir> Install Library files here
Default;./stage
Other Options:
--build-type=<type> build the specified pre-defined set of variations
of the libraries. Note, the which variants get
Built depends on what each library supports.
Minimal (default)-Builds the single
"Release" version of the libraries. This
Release corresponds to specifying:
"Release <threading>multi <link>shared
<link>static <runtime-link>shared "as the"
Boost.build variant to build.
Complete-attempts to builds all possible
Variations.
--build-dir=dir build in this location instead of building
Within the distribution tree. recommended!
--show-libraries Displays the list of Boost libraries that require
Build and installation steps, then exit.
--layout=<layout> determines whether to choose library names
and header locations such that multiple
Versions of Boost or multiple compilers can
be used on the same system.
versioned (default)-Names of boost
Binaries include the Boost version
Number and the name and version of the
Compiler. Boost headers are installed
In a subdirectory of <HDRDIR> whose
Name contains the Boost version
Number.
System-binaries names do not include
The Boost version number or the name
and version number of the compiler.
Boost headers are installed directly
into Intended for system integrators who
are building distribution packages.
--buildid=id Adds The specified ID to the name of built
Libraries. The default is to not add anything.
--help this message.
--with-<library> build and install the specified <library>
If This option is used, only libraries
Specified using this option would be built.
--without-<library> do don't build, stage, or install the specified
<library>. By default, all libraries are built.
Properties:
Toolset=toolset indicates the toolset to build with.
Variant=debug|release Select The Build variant
link=static|shared Whether to build static or shared libraries
Threading=single|multi Whether to a single or multithreaded binaries
Runtime-link=static|shared
Whether to link to static or shared C and C + + runtime.
Configuration Help:
Configuration file at $boost $\tools\build\v2
User-config.jam
This file is used to configure your Boost.build installation. You can modify
This file in place, or for can place it in a permanent location so it
Does not get overwritten should you get a new version of Boost.build. The following:
Http://boost.org/boost-build2/doc/html/bbv2/reference.html#bbv2.reference.init
For documentation about possible permanent locations.
General Command line usage:
Bjam [Options] [Properties] [targets]
Options, properties and targets can be specified into any order.
Important Options:
*--clean Remove targets instead of building
*-A Rebuild everything
*-N Don ' t execute the commands, only print them
*-d+2 Show commands as they are executed
*-D0 supress all informational messages
*-Q Stop at the
*--debug-configuration Diagnose configuration
*--debug-building which targets are built with what properties
*--debug-generator Diagnose Generator search/execution
Further help:
The following options can be used to obtain additional documentation.
*--help-options Print more obscure command line options.
*--help-internal boost.build Implementation details.
*--help-doc-options Implementation Details doc formatting.
Compile all versions:
Bjam--toolset=msvc-8.0--prefix= $lib-and-dll-out-dir$--build-type=complete Install
Wait for the compilation to complete.
To set up a development environment:
Open the VS2005 selection tool-> option->vc++ Directory
Set the Include file directory $lib-and-dll-out-dir$\include\boost-1_37\boost
Set Reference file directory: $lib-and-dll-out-dir$\lib
Complete. You can use it.

http://anders0913.javaeye.com/blog/375303#
Turn from: http://sswflying.spaces.live.com/blog/cns!A1AF9E41EDCAEF99!584.entry
Http://sswflying.spaces.live.com/blog/cns!A1AF9E41EDCAEF99!515.entry

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.