
1. Edit .bashrc for setup boost environment.
...
#Python
PYTHON_ROOT=
PYTHON_LIB_PATH=/usr/lib/python2.3/config
export PYTHON_LIB_PATH
PYTHON_INCLUDES=/usr/include/python2.3/
export PYTHON_INCLUDES
...
#C++ Boost Library
#CPLUS_INCLUDE_PATH=$HOME/boost_1_28_0
#GCC_ROOT_DIRECTORY=/usr/lib/gcc/i386-redhat-linux/3.4.3
#export GCC_ROOT_DIRECTORY
GCC_BIN_DIRECTORY=/usr/bin
export GCC_BIN_DIRECTORY
CPLUS_INCLUDE_PATH=
/home/jackie/MyDocument/src/C++Boost/boost_1_33_1
export CPLUS_INCLUDE_PATH
BOOST_ROOT=/home/jackie/MyDocument/src/C++Boost/boost_1_33_1
export BOOST_ROOT
BOOST_BUILD_PATH=$BOOST_ROOT/tools/build
export BOOST_BUILD_PATH
...
for mac os:
...
#########################
# C++ Boost Library Environment #
#########################
export GCC_BIN_DIRECTORY=/usr/bin
export CPLUS_INCLUDE_PATH=/Users/xiemengbang/boost_1_33_1
export BOOST_ROOT=/Users/xiemengbang/boost_1_33_1
export BOOST_BUILD_PATH=$BOOST_ROOT/tools/build
#Python
PYTHON_ROOT=
export PYTHON_LIB_PATH=/usr/lib/python2.3/config
export PYTHON_INCLUDES=/usr/include/python2.3/
...
2. Building Boost.Jam
# tar -zxvf boost-jam-3.1.11.tgz
# cd boost-jam-3.1.11
# sh ./build.sh
For the Boost.Jam source included with the Boost distribution the
for mac os :
download boost-jam-3.1.11-1-macosxppc.tgz
#tar zxvf boost-jam-3.1.11-1-macosxppc.tgz
#cd boost-jam-3.1.11-1-macosxppc
#cp bjam /opt/local/bin
3. you need to change to the directory where you have the Boost distribution you downloaded. For example:
#cd boost_1_33_1
4. Build and Install
Invoke the build system, specifying the toolset(s) you wish to use, to build and install. For example for GNU/GCC.
#bjam "-sTOOLS=gcc" install
for mac os:
#sudobjam "-sTOOLS=gcc" install
Or if you are interested only in the built libraries you can have them built and collected to a common directory without installation.
5. Results
#bjam "-sTOOLS=gcc" stage
The results of building come in to forms: static libraries, and dynamic libraries. Depending on the platform the libraries produced have different names to accommodate the platform requirements. For a single Boost library the build with the default will produce eight different libraries. For example building the Boost.Datetime library on Unix type system it would produce:
[root@jackie include]# ls /usr/lib/libboost*
/usr/lib/libboost_date_time.a /usr/lib/libboost_program_options.so.1 /usr/lib/libboost_signals.so.1.33.1
/usr/lib/libboost_date_time.so /usr/lib/libboost_program_options.so.1.33.1 /usr/lib/libboost_test_exec_monitor.a
/usr/lib/libboost_date_time.so.1 /usr/lib/libboost_python.a /usr/lib/libboost_test_exec_monitor.so
/usr/lib/libboost_date_time.so.1.33.1 /usr/lib/libboost_python.so /usr/lib/libboost_test_exec_monitor.so.1
/usr/lib/libboost_filesystem.a /usr/lib/libboost_python.so.1 /usr/lib/libboost_test_exec_monitor.so.1.33.1
/usr/lib/libboost_filesystem.so /usr/lib/libboost_python.so.1.33.1 /usr/lib/libboost_thread.a
/usr/lib/libboost_filesystem.so.1 /usr/lib/libboost_regex.a /usr/lib/libboost_thread.so
/usr/lib/libboost_filesystem.so.1.33.1 /usr/lib/libboost_regex.so /usr/lib/libboost_thread.so.1
/usr/lib/libboost_prg_exec_monitor.a /usr/lib/libboost_regex.so.1 /usr/lib/libboost_thread.so.1.33.1
/usr/lib/libboost_prg_exec_monitor.so /usr/lib/libboost_regex.so.1.33.1 /usr/lib/libboost_unit_test_framework.a
/usr/lib/libboost_prg_exec_monitor.so.1 /usr/lib/libboost_serialization.a /usr/lib/libboost_unit_test_framework.so
/usr/lib/libboost_prg_exec_monitor.so.1.33.1 /usr/lib/libboost_signals.a /usr/lib/libboost_unit_test_framework.so.1
/usr/lib/libboost_program_options.a /usr/lib/libboost_signals.so /usr/lib/libboost_unit_test_framework.so.1.33.1
/usr/lib/libboost_program_options.so /usr/lib/libboost_signals.so.1 /usr/lib/libboost_wserialization.a
for mac os:
# ls /usr/local/lib/libboost*
/usr/local/lib/libboost_date_time-gcc-1_33_1.a /usr/local/lib/libboost_serialization-gcc-d.a
/usr/local/lib/libboost_date_time-gcc-d-1_33_1.a /usr/local/lib/libboost_serialization-gcc.a
/usr/local/lib/libboost_date_time-gcc-d.a /usr/local/lib/libboost_signals-gcc-1_33_1.a
/usr/local/lib/libboost_date_time-gcc.a /usr/local/lib/libboost_signals-gcc-d-1_33_1.a
/usr/local/lib/libboost_filesystem-gcc-1_33_1.a /usr/local/lib/libboost_signals-gcc-d.a
/usr/local/lib/libboost_filesystem-gcc-d-1_33_1.a /usr/local/lib/libboost_signals-gcc.a
/usr/local/lib/libboost_filesystem-gcc-d.a /usr/local/lib/libboost_test_exec_monitor-gcc-1_33_1.a
/usr/local/lib/libboost_filesystem-gcc.a /usr/local/lib/libboost_test_exec_monitor-gcc-d-1_33_1.a
/usr/local/lib/libboost_iostreams-gcc-1_33_1.a /usr/local/lib/libboost_test_exec_monitor-gcc-d.a
/usr/local/lib/libboost_iostreams-gcc-d-1_33_1.a /usr/local/lib/libboost_test_exec_monitor-gcc.a
/usr/local/lib/libboost_iostreams-gcc-d.a /usr/local/lib/libboost_thread-gcc-1_33_1.a
/usr/local/lib/libboost_iostreams-gcc.a /usr/local/lib/libboost_thread-gcc-d-1_33_1.a
/usr/local/lib/libboost_prg_exec_monitor-gcc-1_33_1.a /usr/local/lib/libboost_thread-gcc-d.a
/usr/local/lib/libboost_prg_exec_monitor-gcc-d-1_33_1.a /usr/local/lib/libboost_thread-gcc.a
/usr/local/lib/libboost_prg_exec_monitor-gcc-d.a /usr/local/lib/libboost_unit_test_framework-gcc-1_33_1.a
/usr/local/lib/libboost_prg_exec_monitor-gcc.a /usr/local/lib/libboost_unit_test_framework-gcc-d-1_33_1.a
/usr/local/lib/libboost_program_options-gcc-1_33_1.a /usr/local/lib/libboost_unit_test_framework-gcc-d.a
/usr/local/lib/libboost_program_options-gcc-d-1_33_1.a /usr/local/lib/libboost_unit_test_framework-gcc.a
/usr/local/lib/libboost_program_options-gcc-d.a /usr/local/lib/libboost_wave-gcc-1_33_1.a
/usr/local/lib/libboost_program_options-gcc.a /usr/local/lib/libboost_wave-gcc-d-1_33_1.a
/usr/local/lib/libboost_regex-gcc-1_33_1.a /usr/local/lib/libboost_wave-gcc-d.a
/usr/local/lib/libboost_regex-gcc-d-1_33_1.a /usr/local/lib/libboost_wave-gcc.a
/usr/local/lib/libboost_regex-gcc-d.a /usr/local/lib/libboost_wserialization-gcc-1_33_1.a
/usr/local/lib/libboost_regex-gcc.a /usr/local/lib/libboost_wserialization-gcc-d-1_33_1.a
/usr/local/lib/libboost_serialization-gcc-1_33_1.a /usr/local/lib/libboost_wserialization-gcc-d.a
/usr/local/lib/libboost_serialization-gcc-d-1_33_1.a /usr/local/lib/libboost_wserialization-gcc.a
|
|
|||||||||||
lib |
|
|||||||||||
boost_date_time |
|
|||||||||||
- | gcc |
|
||||||||||
- | mt |
|
||||||||||
- | d |
|
||||||||||
- | 1_32 |
|
||||||||||
.a | |
Library Prefix
The "lib" prefix on the libraries is a requirement on many platforms, like Unix, and on others like GCC running on Windows. The prefix is therefore added to all libraries on Unix type systems, and to static libraries on Windows. That is on Unix shared libraries and static libraries (object archives) are named respectively:
- lib*.so
- lib*.a
On Windows shared libraries do not have the prefix to differentiate the import libraries from static libraries. Consequently on Windows the libraries are named:
*.dll | Dynamic library version. |
*.lib | Import library for the dll. |
lib*.lib | Static library version. |
Library Name
For Boost libraries the name has the "boost_" prefix to separate them
from other libraries in your system.
Toolset
The toolset name is an abbreviation based on the compiler you are building with. The abbreviation is composed of a short, 2 to 4 characters, tag for the compiler and a version number of the compiler's major and minor revision (if available). For example if your toolset is "gcc-3_2_3" the toolset tag would be "gcc32". The toolset abbreviations used are as follows:
TOOLS Name | Abbreviation |
borland |
bcb |
como |
como |
como-win32 |
como |
cw |
cw |
darwin |
osx |
dmc |
dmc |
dmc-stlport |
dmc |
edg |
edg |
gcc |
gcc |
gcc-stlport |
gcc |
gcc-nocygwin |
gcc |
intel-linux |
il |
intel-win32 |
iw |
kcc |
kcc |
kylix |
bck |
mingw |
mgw |
mingw-stlport |
mgw |
mipspro |
mp |
msvc |
vc |
msvc-stlport |
vc |
sunpro |
sw |
tru64cxx |
tru |
tru64cxx65 |
tru |
vacpp |
xlc |
vc7 |
vc |
vc7-stlport |
vc |
vc-7_1 |
vc |
vc-7_1-stlport |
vc |
Others | The first part of the toolset name. |
Threading
This tag indicates if the library is compiled with threading support. If threading is enabled "-mt" is added, otherwise nothing is added.
Runtime
This specifies the type of runtime the library was compiled against, and the type of code that is compiled. More commonly this encodes the ABI variation used in the code. For each feature of the runtime system and code compilation option a single letter is added to this tag.
Key | Feature |
s | Static link to runtime. |
g | Debug runtime. |
y | Debug Python system. |
d | Debug enabled code. |
p | STLport runtime, instead of the vendor toolset runtime. |
n | STLport runtime using the "native" IO streams instead of the STLport IO streams. |
For example if you compile debug code for STLport using native IO streams, and statically link to the debug runtime the tag would be: "-sgdpn".
Boost Version
This is the short label for the version of the Boost Libraries. The major and minor version numbers are taken together separated by an underscore. For example version 1.31.0 would be tagged as "-1_31". The patch version number is not included because it is assumed that patch versions are upward compatible.
Library Type
The extension holds the type of library. This follows the platform requirements. On Windows this is ".dll" for shared libraries, and ".lib" for static libraries including import libraries. On Unix this is ".a" for static libraries (archives), and ".so" for shared libraries. For toolsets that support it in Unix they will also have a full version extension (for example ".so.1.31.0") with a symbolic link for the un-versioned library.