Go to the Boost homepage, www. Download and unpack either the latest release of the package boost or the latest release of the package boost-build. The former includes the full collection of Boost libraries, while the latter is a standalone release of Boost. Place the unpacked files in a suitable permanent location.
Download and unpack the latest version of the package boost-jam for your platform; this package includes a prebuilt bjam executable. If the package boost-jam is not available for your platform, follow the instructions provided with the package you downloaded in step 2 to build the executable from the source. Copy bjam to a location in your PATH environment variable.
Build root directory. For example, using apt-get :. If you're planning on building boost's documentation, you'll also need to install the doxygen package as well. Distributed under the Boost Software License, Version 1. Installation and configuration. Mac OS X. Mac OS X, using macports. Build the utility by issuing bjam. Section contributed by Julio M. Merino Vidal.
Download Docbook XML 4. Download the latest Docbook XSL version and unpack it. Be careful that you download the correct file, sometimes the 'looking for the latest version' link often links to another file. The name should be of the form docbook-xsl Note that on Mac OSX, the paths are unconditionally hardcoded by the linker, and it is not possible to disable that behaviour.
The value of those features is passed without modification to the corresponding tools. The features are handy when you are trying to do something special that cannot be achieved by a higher-level feature in Boost. Specifies an preprocessor symbol that should be defined on the command line. You may either specify just the symbol, which will be defined without any value, or both the symbol and the value, separated by equal sign.
It has the following values:. The value on enables this behaviour. The default value is off. The build feature is used to conditionally disable build of a target. Combined with conditional requirements this allows you to skip building some target in configurations where the build is known to fail.
The tag feature is used to customize the name of the generated files. The value should have the form:. The rule will be called for each target with the default name computed by Boost.
Build, the type of the target, and property set. The rule can either return a string that must be used as the name of the target, or an empty string, in which case the default name will be used.
Most typical use of the tag feature is to encode build properties, or library version in library target names. The debug-symbols feature specifies if produced object files, executables, and libraries should include debug information. Typically, the value of this feature is implicitly set by the variant feature, but it can be explicitly specified by the user. The most common usage is to build release variant with debugging information.
The runtime-debugging feature specifies whether produced object files, executables, and libraries should include behaviour useful only for debugging, such as asserts.
The most common usage is to build release variant with debugging output. The operating system for which the code is to be generated. The compiler you used should be the compiler for that operating system. This option causes Boost. Build to use naming conventions suitable for that operating system, and adjust build process accordingly. For example, with gcc, it controls if import libraries are produced for shared libraries or not. The complete list of possible values for this feature is: aix, appletv, bsd, cygwin, darwin, freebsd, hpux, iphone, linux, netbsd, openbsd, osf, qnx, qnxnto, sgi, solaris, unix, unixware, windows.
Allowed values: x86 , ia64 , sparc , power , mips1 , mips2 , mips3 , mips4 , mips32 , mips32r2 , mips64 , parisc , arm , combined , combined-xpower. The architecture features specifies the general processor family to generate code for.
The instruction-set specifies for which specific instruction set the code should be generated. While Boost. Build allows a large set of possible values for this features, whether a given value works depends on which compiler you use.
The address-model specifies if bit or bit code should be generated by the compiler. Whether this feature works depends on the used compiler, its version, how the compiler is configured, and the values of the architecture instruction-set features.
Specific toolsets may or may not provide support for this feature depending on whether their compilers provide a corresponding command-line option. This feature is used to indicate which other features are relevant for a given target.
It is usually not necessary to manage it explicitly, as Boost. Build can deduce it in most cases. Features which are not relevant will not affect target paths, and will not cause conflicts.
Indirect conditionals. Action rules that read properties. Solution: add toolset. Build that the feature is actually used. Generators and targets that manipulate property-sets directly.
This section documents how to use those tools. This is done by calling the using rule, typically in your user-config. This section lists all Boost. The name of support module for compiler is also the value for the toolset feature that can be used to explicitly request that compiler.
This statement may be repeated several times, if you want to configure several versions of the compiler. The supported products are listed below. The version reported by the command lines tools is also listed for reference. If the command is not specified, Boost. Build will search for a binary named bcc32 in PATH. Build will search for a binary named como in PATH. The cw module support CodeWarrior compiler, originally produced by Metrowerks and presently developed by Freescale.
Build supports only the versions of the compiler that target x86 processors. All such versions were released by Metrowerks before acquisition and are not sold any longer. The last version known to work is 9. Build will search for a binary named mwcc in default installation paths and in PATH. The command that sets up environment variables prior to invoking the compiler.
If not specified, cwenv. If not specified, mwcc will be used. The command will be invoked after the setup script was executed and adjusted the PATH variable. The command that links executables and dynamic libraries. If not specified, mwld will be used. Build will search for a binary named dmc in PATH. If the version is not explicitly specified, it will be automatically detected by running the compiler with the -v option.
Specifies root directory of the compiler installation. Specifies the archiver command that is used to produce static libraries. Normally, it is autodetected using gcc -print-prog-name option or defaulted to ar , but in some cases you might want to override it, for example to explicitly use a system version instead of one included with gcc. Specifies the ranlib command that is used to generated symbol table for static libraries.
Normally, it is autodetected using gcc -print-prog-name option or defaulted to ranlib , but in some cases you might want to override it, for example to explicitly use a system version instead of one included with gcc.
Specifies the resource compiler command that will be used with the version of gcc that is being configured. This setting makes sense only for Windows and only if you plan to use resource files. By default windres will be used.
Specifies the type of resource compiler. Currently, those include nocona , opteron , athlon64 and athlon-fx. If compiler command is not specified, then Boost. The supported products and versions of command line tools are listed below:.
The user would then call the boost build executable with the toolset set equal to msvc-[version number] for example to build with Visual Studio one could run:.
If the version is not explicitly specified, the most recent version found in the registry will be used instead. If the special value all is passed as the version, all versions found in the registry will be configured. If a version is specified, but the command is not, the compiler binary will be searched in standard installation paths for that version, followed by PATH.
The command that compiles assembler sources. If not specified, ml will be used. If not specified, cl will be used. Command through which to pipe the output of running the compiler. For example to pass the output to STLfilt. The command that compiles Microsoft COM interface definition files.
If not specified, midl will be used. If not specified, link will be used. The command that compiles Microsoft message catalog files. If not specified, mc will be used. The command that compiles resource files. If not specified, rc will be used. The filename of the global environment setup script to run before invoking any of the tools defined in this toolset.
Will not be used in case a target platform specific script has been explicitly specified for the current target platform. If not specified a default script is chosen based on the used compiler binary, e. The filename of the target platform specific environment setup script to run before invoking any of the tools defined in this toolset. If not specified the global environment setup script is used. Starting with version 8.
In addition, compilers that are itself run in bit mode, for better performance, are provided. The bit host compilers can be always used, even on bit Windows.
On the contrary, bit host compilers require both bit host processor and bit Windows, but can be faster. By default, only bit host, bit target compiler is installed, and additional compilers need to be installed explicitly. Configure you compiler as usual.
If you provide a path to the compiler explicitly, provide the path to the bit compiler. If you try to specify the path to any of bit compilers, configuration will not work. Starting with version To specify which Windows API set to target, use the windows-api feature. Available options are desktop , store , or phone.
If not specified, desktop will be used. When using store or phone the specified toolset determines what Windows version is targeted. The following options are available:.
Note that when targeting Windows Phone 8. They can be separately downloaded from here. Versions 7. The module does not accept any initialization options. They were not tested with the the vacpp module. Build supports using that library on Windows platform.
Linux is hampered by different naming of libraries in each STLport version and is not officially supported. Before using STLport, you need to configure it in user-config. Where version is the version of STLport, for example 5. Note that STLport 5. Provides support for the zlib library. Sets the tag property to adjust the file name of the library.
Ignored when using precompiled binaries. Provides support for the bzip2 library. Provides support for the python language environment to be linked in as a library. The version of Python to use. Should be in Major. Minor format, for example 2. Do not include the subminor version.
Preferably, a command that invokes a Python interpreter. Alternatively, the installation prefix for Python libraries and includes. If empty, will be guessed. Build selects a Python configuration to use. A string to append to the name of extension modules before the true filename extension.
Where xsltproc is the xsltproc executable. Otherwise, xsltproc will be searched for in PATH. The xsltproc module provides the following rules. Note that these operate on jam targets and are intended to be used by another toolset, such as boostbook, rather than directly by users.
Runs xsltproc to create multiple outputs in a directory. The output directory is determined from the target. Otherwise, we let the XML processor load the stylesheets remotely. Allowed values: html , xhtml , htmlhelp , onehtml , man , pdf , ps , docbook , fo , tests. Everything before this will be stripped off. Creates a doxygen target. If the target name ends with. If it is not specified, Boost. Build will compile it from source. If it is unable to find the source it will search for a quickbook executable in PATH.
This section describes the modules that are provided by Boost. The import rule allows rules from one module to be used in another module or Jamfile. A module defines a number of rules that can be used in other modules. Modules can contain code at the top level to initialize the module.
This code is executed the first time the module is loaded. Each module has its own namespaces for variables and rules. If two modules A and B both use a variable named X, each one gets its own copy of X.
Similarly, importing rules into one module has no effect on any other module. Every module has two special variables. Call the given rule locally in the given module.
Load the indicated module and import rule names into the current module. If rename-opt is supplied, it must have the same number of elements as rules-opt. Performs various path manipulations. Paths are always in a 'normalized' representation. In it, a path may be either:. In plain english, a path can be rooted, '..
The path may not contain ".. Concatenates the passed path elements. Generates an error if any element other than the first one is rooted. Skips any empty or undefined path elements.
Returns the list of files matching the given pattern in the specified directory. Both directories and patterns are supplied as portable paths. Each slash separated element of a pattern can contain the following special characters:. Recursive version of glob. Builds the glob of files while also searching in the subdirectories of the given roots. An optional set of exclusion patterns will filter out the matching entries from the result.
The exclusions also apply to the subdirectory scanning, such that directories that match the exclusion patterns will not be searched. Find out the absolute name of path and return the list of all the parents, starting with the immediate one. Parents are returned as relative names. Assuming child is a subdirectory of parent , return the relative path from parent to child. A character range such as "[a-z]" matches any character between "a" and "z".
Returns the concatenated results of applying regex. Match string against pattern , and return the elements indicated by indices.
Matches all elements of list against the pattern and returns a list of elements indicated by indices of all successful matches. If indices is omitted returns a list of first parenthesized groups of all successful matches. Escapes all of the characters in symbols using the escape symbol escape-symbol for the given string, and returns the escaped string. Replaces occurrences of a match string in a given string and returns the new string.
The match string can be a regex expression. Replaces occurrences of a match string in a given list of strings and returns a list of new strings. Various useful list functions. Also note that most predicates can be multi-element lists. In that case, all but the first element are prepended to the first argument which is passed to the rule named by the first element. Join the elements of s into one long string.
If joint is supplied, it is used as a separator. Removes duplicates from list. If stable is passed, then the order of the elements will be unchanged. Returns the maximum number in elements. Uses ordered for comparisons or numbers. Returns all of elements for which the corresponding element in the parallel list rank is equal to the maximum value in rank. Registers a target type, possible derived from a base-type. Providing a list of suffixes here is a shortcut for separately calling the register-suffixes rule with the given suffixes and the set-generated-target-suffix rule with the first given suffix.
Specifies that files with suffix from suffixes be recognized as targets of type type. Issues an error if a different type is already specified for any of the suffixes. Returns true if type is equal to base or has base as its direct or indirect base. Sets a file suffix to be used when generating a target of type with the specified properties. Can be called with no properties if no suffix has already been specified for the type. The suffix parameter can be an empty string "" to indicate that no suffix should be used.
Note that this does not cause files with suffix to be automatically recognized as being of type. Two different types can use the same suffix for their generated files but only one type can be auto-detected for a file with that suffix. User should explicitly specify which one using the register-suffixes rule. If suffix is not yet specified, sets it.
Sets a target prefix that should be used when generating targets of type with the specified properties. Can be called with empty properties if no prefix for type has been specified yet.
The prefix parameter can be empty string "" to indicate that no prefix should be used. If prefix is not yet specified, sets it. Returns file type given its name. If there are several dots in filename, tries each suffix. Generates virtual targets for this abstract target using the specified properties, unless a different value of some feature is required by the target.
This is an abstract method which must be overriden by derived classes. If property-set is empty, performs the default build of this target, in a way specific to the derived class. Overrides abstract-target. Generates virtual targets for all the targets contained in this project. Returns a main-target class instance corresponding to name. Can only be called after the project has been fully loaded. Returns whether a main-target with the specified name exists.
Find and return the target with the specified id, treated relative to self. Id may specify either a target or a file name with the target taking priority. May report an error or return nothing if the target is not found depending on the no-error parameter.
A main-target represents a named top-level target in a Jamfile. Select an alternative for this main target, by finding all alternatives whose requirements are satisfied by property-set and picking the one with the longest requirements set. Returns the result of calling generate on that alternative.
Implements the most standard way of constructing main target alternative from sources. Allows sources to be either files or other main targets and handles generation of those dependency targets.
Determines final build properties, generates sources, and calls construct. This method should not be overridden. Constructs virtual targets for this abstract target. Returns a usage-requirements property-set and a list of virtual targets. Should be overriden in derived classes. Rules for creating typed targets are defined automatically for each type. Implements basic-target. Attempts to create a target of the correct type using generators appropriate for the given property-set.
Returns a property-set containing the usage requirements and a list of virtual targets. No two instances of the class are equal. To maintain this property, the 'property-set. Instances are immutable. Returns a property-set containing all the propagated properties in this property-set. Returns a new property-set containing the union of the properties in this property-set and in ps. Link add , except that it takes a list of properties instead of a property-set. If you have multiple Python versions installed, the version will usually be the only configuration argument required.
Alternatively, the installation prefix for Python libraries and header files. Only use the alternative formulation if there is no appropriate Python executable available. Build properties that are matched against the build configuration when Boost. Build selects a Python configuration to use. See examples below for details. A string to append to the name of extension modules before the true filename extension. You almost certainly don't need to use this.
Note that in the examples below, case and especially whitespace are significant. If you have both python 2. The first version configured 2.
0コメント