Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71540 - in sandbox/local: . boost/local boost/local/aux_ boost/local/aux_/function_macros libs/local/example tools
From: lorcaminiti_at_[hidden]
Date: 2011-04-27 13:25:15


Author: lcaminiti
Date: 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
New Revision: 71540
URL: http://svn.boost.org/trac/boost/changeset/71540

Log:
Adding changes made to for profiling on Linux and to support GCC C++0x features.
Added:
   sandbox/local/libs/local/example/add_using_0x_lambda.cpp (contents, props changed)
   sandbox/local/libs/local/example/profile.03.xls (contents, props changed)
   sandbox/local/libs/local/example/profile_0x_lambda.cpp (contents, props changed)
   sandbox/local/libs/local/example/profile_boost_local_inline.cpp (contents, props changed)
   sandbox/local/tools/
   sandbox/local/tools/lorenzo-boost-env-cygwin.sh (contents, props changed)
   sandbox/local/tools/lorenzo-boost-env-linux.sh (contents, props changed)
   sandbox/local/tools/lorenzo-boost-env-windows.bat (contents, props changed)
Removed:
   sandbox/local/libs/local/example/add_using_cpp0x_lambda.cpp
   sandbox/local/libs/local/example/profile_boost_local_optimized.cpp
Text files modified:
   sandbox/local/Jamroot.jam | 5 +--
   sandbox/local/boost/local/aux_/config.hpp | 22 +++++++++++++---
   sandbox/local/boost/local/aux_/function_macros/name.hpp | 45 +++++++++++++++++++++-------------
   sandbox/local/boost/local/function.hpp | 14 ++++++---
   sandbox/local/libs/local/example/Jamfile.jam | 52 +++++++++++++++++++++++++--------------
   sandbox/local/libs/local/example/profile_helpers.hpp | 2
   6 files changed, 90 insertions(+), 50 deletions(-)

Modified: sandbox/local/Jamroot.jam
==============================================================================
--- sandbox/local/Jamroot.jam (original)
+++ sandbox/local/Jamroot.jam 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -10,8 +10,7 @@
 
 project
     : requirements
- <include>"." # For this library within Boost libraries.
- <include>"src" # For this library within Contract++.
- <include>$(BOOST_ROOT) # Boost libraries.
+ <include>"." # For this library.
+ <include>$(BOOST_ROOT) # For Boost libraries.
     ;
 

Modified: sandbox/local/boost/local/aux_/config.hpp
==============================================================================
--- sandbox/local/boost/local/aux_/config.hpp (original)
+++ sandbox/local/boost/local/aux_/config.hpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -4,12 +4,24 @@
 
 #include "../config.hpp"
 
-// If it is possible to pass a local class as a template parameter. This is
-// not possible on ISO C++ but it is possible on C++03 extensions, MSVC, etc.
-#if !defined(BOOST_LOCAL_CONFIG_COMPLIANT) && defined(_MSC_VER)
-# define BOOST_LOCAL_AUX_CONFIG_LOCAL_CLASS_AS_TEMPLATE_PARAMETER
+// If it is possible to pass local types (classes, etc) as
+// template parameters. This is not possible in ISO C++ but it
+// is possible in C++03 extensions (MSVC, GCC 4.5.x, etc).
+#if !defined(BOOST_LOCAL_CONFIG_COMPLIANT)
+# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
+ // From GCC 4.5.x when -std=c++0x specified.
+# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS
+# endif
+# if defined(_MSC_VER)
+ // For (all?) MSVC (tested on MVSC 8.0).
+# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS
+# endif
+#endif
+
+#if BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS
+# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01 1
 #else
-# undef BOOST_LOCAL_AUX_CONFIG_LOCAL_CLASS_AS_TEMPLATE_PARAMETER
+# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01 0
 #endif
 
 #endif // #include guard

Modified: sandbox/local/boost/local/aux_/function_macros/name.hpp
==============================================================================
--- sandbox/local/boost/local/aux_/function_macros/name.hpp (original)
+++ sandbox/local/boost/local/aux_/function_macros/name.hpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -11,6 +11,7 @@
 #include "../config.hpp"
 // For BOOST_TYPEOF.
 #include "../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
+#include <boost/detail/preprocessor/keyword/inline.hpp>
 
 // PRIVATE //
 
@@ -56,36 +57,46 @@
 #define BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name) \
     BOOST_LOCAL_AUX_INTERNAL_SYMBOL(local_function_name)
 
-// PUBLIC //
 
-// Limitation: This is faster (smaller run-time than `FUNCION_NAME`) but it
-// cannot be passed as template parameter on ISO C++ but it can on C++03.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_OPTIMIZED(local_function_name) \
+// This is faster on some compilers but not all (e.g., it is faster on GCC
+// because its optimization inlines it but not on MSVC). However, it cannot be
+// passed as a template parameter on non C++03 compilers.
+#define BOOST_LOCAL_AUX_FUNCTION_NAME_INLINE_(local_function_name) \
     BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_( \
             local_function_name, \
             local_function_name, \
             BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name), \
             __LINE__)
 
-// ISO C++ does not allow to pass local classes as template parameters. But
-// if can use C++03 (no ISO C++) features and MSVC compiler (which allows to
-// pass local classes as template parameters), than pass local class as
-// template parameter without the extra global functor to reduce run-time.
-#ifdef BOOST_LOCAL_AUX_CONFIG_LOCAL_CLASS_AS_TEMPLATE_PARAMETER
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME(local_function_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_OPTIMIZED(local_function_name)
-
-#else
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME(local_function_name) \
+// This can always be passed as a template parameters (on all compilers).
+// However, it is slower because it cannot be inlined.
+#define BOOST_LOCAL_AUX_FUNCTION_NAME_(local_function_name) \
     BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_( \
             local_function_name, \
             BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name), \
             local_function_name, \
             __LINE__)
 
-#endif
+// PUBLIC //
+
+// If the function name is specified as `inline name` then the local function
+// can be faster on some compilers that can inline it (like GCC but not MSVC)
+// but inlined local functions can be passed as template parameters only on
+// C++03 compilers. On C++03 compilers, the local function will be inlined if
+// possible even if `inline name` is not specified.
+#define BOOST_LOCAL_AUX_FUNCTION_NAME(maybe_inline_name) \
+ BOOST_PP_IIF(BOOST_PP_BITOR( \
+ BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01, \
+ BOOST_DETAIL_PP_KEYWORD_IS_INLINE_FRONT(maybe_inline_name)), \
+ /* on C++03 always use inlining because compilers might optimize */ \
+ /* it to be faster and it can also be passed as tparam */ \
+ BOOST_LOCAL_AUX_FUNCTION_NAME_INLINE_ \
+ , \
+ /* on non C++03 don't use liniling unless explicitly specified by */ \
+ /* programmers `inline name` the inlined local function cannot be */ \
+ /* passed as tparam */ \
+ BOOST_LOCAL_AUX_FUNCTION_NAME_ \
+ )(BOOST_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT(maybe_inline_name))
 
 #endif // #include guard
 

Modified: sandbox/local/boost/local/function.hpp
==============================================================================
--- sandbox/local/boost/local/function.hpp (original)
+++ sandbox/local/boost/local/function.hpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -160,9 +160,16 @@
  *
  * @Params
  * @Param{name,
- * The name of the local function. This name cannot be the name of an operator
+ * The name of the local function.
+ * The local function name can be prefixed by the keyword <c>inline</c> as in
+ * <c>BOOST_LOCAL_FUNCTION_NAME(inline <em>name</em>)</c> to increases the
+ * likelihood that the compiler will inline the local function (thus reducing
+ * its run-time) but inlined local functions can be passed as template
+ * parameters only on C++03 compilers (and not on ISO C++ standard compilers)
+ * -- see the @RefSect2{Advanced_Topics\, Advanced Topics} section.
+ * The local function name cannot be the name of an operator
  * <c>operator...</c> and it cannot be the same name of another local function
- * declared within the same enclosing scope (i.e.\, it is not possible to
+ * declared within the same enclosing scope (i.e.\, it is not possible to
  * overload local function declarations) -- see the
  * @RefSect2{Advanced_Topics\, Advanced Topics} section.
  * }
@@ -174,9 +181,6 @@
 #define BOOST_LOCAL_FUNCTION_NAME(name) \
     BOOST_LOCAL_AUX_FUNCTION_NAME(name)
 
-#define BOOST_LOCAL_FUNCTION_NAME_OPTIMIZED(name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_OPTIMIZED(name)
-
 namespace boost { namespace local {
 
 /**

Modified: sandbox/local/libs/local/example/Jamfile.jam
==============================================================================
--- sandbox/local/libs/local/example/Jamfile.jam (original)
+++ sandbox/local/libs/local/example/Jamfile.jam 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -4,19 +4,24 @@
 # License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
 # copy at http://www.boost.org/LICENSE_1_0.txt).
 
+# Usages:
+# bjam define=BOOST_LOCAL_CONFIG_COMPLIANT ...
+# Disable Boost.Local variadic macro syntax and local types as template
+# parameters optimization.
+# bjam define=BOOST_TYPEOF_COMPLIANT ...
+# Disable Boost.Typeof compiler specific type-of support.
+# bjam cxxflags=-std=c++0x ...
+# Enable GCC C++0x features like lambdas and local types as template
+# parameters.
+
 import feature ;
+import os ;
+
+local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
 
-# `bjam boost_local_config_compliant ...` for pure ISO C++ (no variadic, etc).
-feature.feature boost_local_config_compliant : off on
- : composite propagated link-incompatible ;
-feature.compose <boost_local_config_compliant>on
- : <define>BOOST_LOCAL_CONFIG_COMPLIANT ;
-
-# `biam boost_local_compliant_typeof ...` for ISO C++ compliant `typeof`.
-feature.feature boost_local_compliant_typeof : off on
- : composite propagated link-incompatible ;
-feature.compose <boost_local_compliant_typeof>on
- : <define>BOOST_TYPEOF_COMPLIANT ;
+# Boost.Chrono (which needs Boost.System) for GCC (not part of official Boost release yet).
+lib libboost_chrono : : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.so ;
+lib libboost_system : : <file>$(BOOST_ROOT)/stage/lib/libboost_system.so ;
 
 exe add : add.cpp ;
 exe add_va : add_va.cpp ;
@@ -110,15 +115,24 @@
 exe add_using_boost_local_va : add_usign_boost_local_va.cpp ;
 exe add_using_local_functor : add_using_local_functor.cpp ;
 exe add_using_global_functor : add_using_global_functor.cpp ;
-exe add_using_cpp0x_lambda : add_using_cpp0x_lambda.cpp ;
+exe add_using_0x_lambda : add_using_0x_lambda.cpp ;
 exe add_using_boost_lambda : add_using_boost_lambda.cpp ;
 exe add_using_boost_phoenix : add_using_boost_phoenix.cpp ;
 
-exe profile_boost_local : profile_boost_local.cpp ;
-exe profile_boost_local_optimized : profile_boost_local_optimized.cpp ;
-exe profile_boost_local_for_loop : profile_boost_local_for_loop.cpp ;
-exe profile_local_functor : profile_local_functor.cpp ;
-exe profile_global_functor : profile_global_functor.cpp ;
-exe profile_boost_lambda : profile_boost_lambda.cpp ;
-exe profile_boost_phoenix : profile_boost_phoenix.cpp ;
+exe profile_boost_local : profile_boost_local.cpp
+ libboost_chrono libboost_system ;
+exe profile_boost_local_inline : profile_boost_local_inline.cpp
+ libboost_chrono libboost_system ;
+exe profile_boost_local_for_loop : profile_boost_local_for_loop.cpp
+ libboost_chrono libboost_system ;
+exe profile_local_functor : profile_local_functor.cpp
+ libboost_chrono libboost_system ;
+exe profile_global_functor : profile_global_functor.cpp
+ libboost_chrono libboost_system ;
+exe profile_0x_lambda : profile_0x_lambda.cpp
+ libboost_chrono libboost_system ;
+exe profile_boost_lambda : profile_boost_lambda.cpp
+ libboost_chrono libboost_system ;
+exe profile_boost_phoenix : profile_boost_phoenix.cpp
+ libboost_chrono libboost_system ;
 

Added: sandbox/local/libs/local/example/add_using_0x_lambda.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/example/add_using_0x_lambda.cpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -0,0 +1,43 @@
+
+// Copyright (C) 2009-2011 Lorenzo Caminiti
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
+// copy at http://www.boost.org/LICENSE_1_0.txt).
+
+#include <boost/config.hpp>
+#ifdef BOOST_NO_LAMBDAS
+#include <iostream>
+int main() {
+ std::cerr << "Error: This program requires C++0x lambdas" << std::endl;
+ return 0;
+}
+#else
+
+//[ add_using_cpp0x_lambda_cpp
+#include <iostream>
+#include <vector>
+#include <algorithm>
+
+int main() {
+ double sum = 0.0;
+ int factor = 10;
+
+ std::vector<double> v(3);
+ v[0] = 1.0; v[1] = 2.0; v[2] = 3.0;
+
+ // Passed as template parameter and also defined at expression level.
+ std::for_each(v.begin(), v.end(), [&sum, factor](double num) {
+ // Unfortunately, cannot bind `factor` by constant reference (but only
+ // by constant value requiring copy constructor and extra operation).
+ // Body uses normal C++ syntax.
+ sum += factor * num;
+ std::cout << "Summed: " << sum << std::endl;
+ });
+
+ std::cout << sum << std::endl;
+ return 0;
+}
+//]
+
+#endif
+

Deleted: sandbox/local/libs/local/example/add_using_cpp0x_lambda.cpp
==============================================================================
--- sandbox/local/libs/local/example/add_using_cpp0x_lambda.cpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
+++ (empty file)
@@ -1,43 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
-// copy at http://www.boost.org/LICENSE_1_0.txt).
-
-#include <boost/config.hpp>
-#ifdef BOOST_NO_LAMBDAS
-#include <iostream>
-int main() {
- std::cerr << "Error: This program requires C++0x lambdas" << std::endl;
- return 0;
-}
-#else
-
-//[ add_using_cpp0x_lambda_cpp
-#include <iostream>
-#include <vector>
-#include <algorithm>
-
-int main() {
- double sum = 0.0;
- int factor = 10;
-
- std::vector<double> v(3);
- v[0] = 1.0; v[1] = 2.0; v[2] = 3.0;
-
- // Passed as template parameter and also defined at expression level.
- std::for_each(v.begin(), v.end(), [&sum, factor](double num) {
- // Unfortunately, cannot bind `factor` by constant reference (but only
- // by constant value requiring copy constructor and extra operation).
- // Body uses normal C++ syntax.
- sum += factor * num;
- std::cout << "Summed: " << sum << std::endl;
- });
-
- std::cout << sum << std::endl;
- return 0;
-}
-//]
-
-#endif
-

Added: sandbox/local/libs/local/example/profile.03.xls
==============================================================================
Binary file. No diff available.

Added: sandbox/local/libs/local/example/profile_0x_lambda.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/example/profile_0x_lambda.cpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -0,0 +1,47 @@
+
+// Copyright (C) 2009-2011 Lorenzo Caminiti
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
+// copy at http://www.boost.org/LICENSE_1_0.txt).
+
+#include <boost/config.hpp>
+#ifdef BOOST_NO_LAMBDAS
+#include <iostream>
+int main() {
+ std::cerr << "Error: This program requires C++0x lambdas" << std::endl;
+ return 0;
+}
+#else
+
+#include <boost/chrono.hpp>
+#include <vector>
+#include <algorithm>
+#include <iostream>
+#include "profile_helpers.hpp"
+
+int main(int argc, char* argv[]) {
+ unsigned long size = 0, trials = 0;
+ begin(argc, argv, size, trials);
+
+ double sum = 0.0;
+ int factor = 1;
+
+ std::vector<double> v(size);
+ std::fill(v.begin(), v.end(), 1.0);
+
+ boost::chrono::duration<double> trials_sec;
+ for (unsigned long i = 0; i < trials; ++i) {
+ boost::chrono::system_clock::time_point start =
+ boost::chrono::system_clock::now();
+ std::for_each(v.begin(), v.end(), [&sum, factor](const double& num) {
+ sum += factor * num;
+ });
+ trials_sec += boost::chrono::system_clock::now() - start;
+ }
+
+ end(size, trials, sum, trials_sec.count());
+ return 0;
+}
+
+#endif
+

Added: sandbox/local/libs/local/example/profile_boost_local_inline.cpp
==============================================================================
--- (empty file)
+++ sandbox/local/libs/local/example/profile_boost_local_inline.cpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -0,0 +1,39 @@
+
+#include <boost/chrono.hpp>
+#include <boost/local/function.hpp>
+#include <vector>
+#include <algorithm>
+#include <iostream>
+#include "profile_helpers.hpp"
+
+int main(int argc, char* argv[]) {
+ unsigned long size = 0, trials = 0;
+ begin(argc, argv, size, trials);
+
+ double sum = 0.0;
+ int factor = 1;
+
+ boost::chrono::system_clock::time_point start =
+ boost::chrono::system_clock::now();
+ void BOOST_LOCAL_FUNCTION_PARAMS( (const double& num)
+ (bind& sum) (const bind& factor) ) {
+ sum += factor * num;
+ } BOOST_LOCAL_FUNCTION_NAME(inline add) // Note the `inline` specifier.
+ boost::chrono::duration<double> decl_sec =
+ boost::chrono::system_clock::now() - start;
+
+ std::vector<double> v(size);
+ std::fill(v.begin(), v.end(), 1.0);
+
+ boost::chrono::duration<double> trials_sec;
+ for (unsigned long i = 0; i < trials; ++i) {
+ boost::chrono::system_clock::time_point start =
+ boost::chrono::system_clock::now();
+ for (unsigned long j = 0; j < v.size(); ++j) add(v[j]); // No for_each.
+ trials_sec += boost::chrono::system_clock::now() - start;
+ }
+
+ end(size, trials, sum, trials_sec.count(), decl_sec.count());
+ return 0;
+}
+

Deleted: sandbox/local/libs/local/example/profile_boost_local_optimized.cpp
==============================================================================
--- sandbox/local/libs/local/example/profile_boost_local_optimized.cpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
+++ (empty file)
@@ -1,39 +0,0 @@
-
-#include <boost/chrono.hpp>
-#include <boost/local/function.hpp>
-#include <vector>
-#include <algorithm>
-#include <iostream>
-#include "profile_helpers.hpp"
-
-int main(int argc, char* argv[]) {
- unsigned long size = 0, trials = 0;
- begin(argc, argv, size, trials);
-
- double sum = 0.0;
- int factor = 1;
-
- boost::chrono::system_clock::time_point start =
- boost::chrono::system_clock::now();
- void BOOST_LOCAL_FUNCTION_PARAMS( (const double& num)
- (bind& sum) (const bind& factor) ) {
- sum += factor * num;
- } BOOST_LOCAL_FUNCTION_NAME_OPTIMIZED(add)
- boost::chrono::duration<double> decl_sec =
- boost::chrono::system_clock::now() - start;
-
- std::vector<double> v(size);
- std::fill(v.begin(), v.end(), 1.0);
-
- boost::chrono::duration<double> trials_sec;
- for (unsigned long i = 0; i < trials; ++i) {
- boost::chrono::system_clock::time_point start =
- boost::chrono::system_clock::now();
- for (unsigned long j = 0; j < v.size(); ++j) add(v[j]); // No for_each.
- trials_sec += boost::chrono::system_clock::now() - start;
- }
-
- end(size, trials, sum, trials_sec.count(), decl_sec.count());
- return 0;
-}
-

Modified: sandbox/local/libs/local/example/profile_helpers.hpp
==============================================================================
--- sandbox/local/libs/local/example/profile_helpers.hpp (original)
+++ sandbox/local/libs/local/example/profile_helpers.hpp 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -7,7 +7,7 @@
 
 void begin(int argc, char* argv[], unsigned long& size, unsigned long& trials) {
     size = 100000000; // Defaults.
- trials = 100; // Default.
+ trials = 10; // Default.
     if (argc != 1 && argc != 2 && argc != 3) {
         std::cerr << "ERROR: Incorrect argument(s)" << std::endl;
         std::cerr << "Usage: " << argv[0] << " [SIZE] [TRIALS]" <<

Added: sandbox/local/tools/lorenzo-boost-env-cygwin.sh
==============================================================================
--- (empty file)
+++ sandbox/local/tools/lorenzo-boost-env-cygwin.sh 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -0,0 +1,42 @@
+
+# Copyright (C) 2009-2011 Lorenzo Caminiti
+# Use, modification, and distribution is subject to the
+# Boost Software License, Version 1.0
+# (see accompanying file LICENSE_1_0.txt or a copy at
+# http://www.boost.org/LICENSE_1_0.txt).
+
+# Source this file `$ source ...`.
+
+# Setup environment to build examples and documentation using Boost.BJam.
+
+echo '
+WARNING: This script is NOT smart -- it assumes all Boost installation paths. Edit this script if these paths do not match your Boost installation!
+
+Before running this script you must have downloaded and compiled Boost.Build (to build the examples), Boost.QuickBook (to build the documentation), and installed Boost.QuickBook related tools (DocBook, XSL, etc) -- see the Boost online documentation.
+However, you do not strictly need to do this because you can use any compiler to build the examples (just add this headers-only library to your #include path) and you do not need to re-build the documentation.
+'
+
+export BOOST_ROOT="C:\PROGRA~1\boost\boost_1_45_0"
+export BOOST=$BOOST_ROOT
+export BOOST_BUILD_PATH="$BOOST_ROOT\tools\build\v2"
+export PATH="$PATH:/cygdrive/c/PROGRA~1/boost/boost_1_45_0/tools/build/v2/engine/src/bin.ntx86"
+
+user_config_jam="$HOME/user-config.jam"
+if [ -e $user_config_jam ]; then
+ echo "Assumed existing $user_config_jam has correct paths for Boost.QuickBook tools, change this file if that is not the case."
+else
+ echo '
+import os ;
+local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
+
+using msvc ; # Toolset.
+
+# Boost.QuickBook (and related tools).
+using quickbook : $(BOOST_ROOT)"/bin.v2/tools/quickbook/src/msvc-8.0/debug/link-static/threading-multi/quickbook.exe" : ;
+using xsltproc : "C:/Users/example/Documents/boost/xml/bin/xsltproc.exe" ;
+using boostbook : "C:/Users/example/Documents/boost/xml/docbook-xsl" : "C:/Users/example/Documents/boost/xml/docbook-xml" ;
+using doxygen : "C:/Program Files/doxygen/bin/doxygen.exe" ;
+' > $user_config_jam
+ echo "Created $user_config_jam (assumed Boost.QuickBook tool paths)."
+fi
+

Added: sandbox/local/tools/lorenzo-boost-env-linux.sh
==============================================================================
--- (empty file)
+++ sandbox/local/tools/lorenzo-boost-env-linux.sh 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -0,0 +1,40 @@
+
+# Copyright (C) 2009-2011 Lorenzo Caminiti
+# Use, modification, and distribution is subject to the
+# Boost Software License, Version 1.0
+# (see accompanying file LICENSE_1_0.txt or a copy at
+# http://www.boost.org/LICENSE_1_0.txt).
+
+# Source this file `$ source ...`.
+
+# Setup environment to build examples and documentation using Boost.BJam.
+
+echo '
+WARNING: This script is NOT smart -- it assumes all Boost installation paths. Edit this script if these paths do not match your Boost installation.
+
+Before running this script you must have downloaded and compiled Boost.Build (to build the examples), Boost.QuickBook (to build the documentation), and installed Boost.QuickBook related tools (DocBook, XSL, etc) -- see the Boost online documentation.
+However, you do not strictly need to do this because you can use any compiler to build the examples (just add this headers-only library to your #include path) and you do not need to re-build the documentation.
+'
+
+export BOOST_ROOT=$HOME/sandbox/boost-trunk
+export BOOST=$BOOST_ROOT
+export BOOST_BUILD_PATH=$BOOST_ROOT/tools/build/v2
+export PATH=$BOOST_BUILD_PATH/engine/bin.linuxx86:$PATH
+
+user_config_jam="$HOME/user-config.jam"
+if [ -e $user_config_jam ]; then
+ echo "Assumed existing $user_config_jam has correct paths for Boost.QuickBook tools, change this file if that is not the case."
+else
+ echo '
+using gcc ; # Toolset.
+
+using xsltproc ;
+using boostbook
+ : /usr/share/xml/docbook/stylesheet/nwalsh
+ : /usr/share/xml/docbook/schema/dtd/4.2
+ ;
+using doxygen ;
+' > $user_config_jam
+ echo "Created $user_config_jam (assumed Boost.QuickBook tool paths)."
+fi
+

Added: sandbox/local/tools/lorenzo-boost-env-windows.bat
==============================================================================
--- (empty file)
+++ sandbox/local/tools/lorenzo-boost-env-windows.bat 2011-04-27 13:25:13 EDT (Wed, 27 Apr 2011)
@@ -0,0 +1,54 @@
+
+@ECHO OFF
+
+REM Copyright (C) 2009-2011 Lorenzo Caminiti
+REM Use, modification, and distribution is subject to the
+REM Boost Software License, Version 1.0
+REM (see accompanying file LICENSE_1_0.txt or a copy at
+REM http://www.boost.org/LICENSE_1_0.txt).
+
+REM Setup environment to build examples and documentation using Boost.BJam.
+
+ECHO.
+ECHO WARNING: This script is NOT smart -- it assumes all Boost installation paths. Edit this script if these paths do not match your Boost installation.
+ECHO.
+ECHO Before running this script you must have downloaded and compiled Boost.Build (to build the examples), Boost.QuickBook (to build the documentation), and installed Boost.QuickBook related tools (DocBook, XSL, etc) -- see the Boost online documentation.
+ECHO However, you do not strictly need to do this because you can use any compiler to build the examples (just add this headers-only library to your #include path) and you do not need to re-build the documentation.
+ECHO.
+
+set BOOST_ROOT=C:\PROGRA~1\boost\boost_1_46_1
+REM set BOOST_ROOT=e:\sandbox\boost-trunk
+set LIBPATH=%LIBPATH%;%BOOST_ROOT%\stage\lib
+set BOOST=%BOOST_ROOT%
+set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build\v2
+set PATH=%PATH%;C:\PROGRA~1\boost\xml\bin;%BOOST_BUILD_PATH%\engine\src\bin.ntx86
+
+set user_config_jam="%HOMEDRIVE%%HOMEPATH%/user-config.jam"
+if exist %user_config_jam% (
+ goto :configured_jam
+) else (
+ goto :configure_jam
+)
+goto :end
+
+:configured_jam
+ECHO Assumed existing %user_config_jam% has correct paths for Boost.QuickBook tools, change this file if that is not the case.
+goto :end
+
+:configure_jam
+ECHO. > %user_config_jam%
+ECHO import os ; >> %user_config_jam%
+ECHO local BOOST_ROOT = [ os.environ BOOST_ROOT ] ; >> %user_config_jam%
+ECHO. >> %user_config_jam%
+ECHO using msvc ; # Toolset. >> %user_config_jam%
+ECHO. >> %user_config_jam%
+ECHO # Boost.QuickBook (and related tools). >> %user_config_jam%
+ECHO using quickbook : $(BOOST_ROOT)"/bin.v2/tools/quickbook/src/msvc-8.0/release/link-static/threading-multi/quickbook.exe" : ; >> %user_config_jam%
+ECHO using xsltproc : "C:/Program Files/boost/xml/bin/xsltproc.exe" ; >> %user_config_jam%
+ECHO using boostbook : "C:/Program Files/boost/xml/docbook-xsl" : "C:/Program Files/boost/xml/docbook-xml" ; >> %user_config_jam%
+ECHO using doxygen : "C:/Program Files/doxygen/bin/doxygen.exe" ; >> %user_config_jam%
+ECHO Created %user_config_jam% (assumed Boost.QuickBook tool paths).
+goto :end
+
+:end
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk