Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49534 - in sandbox/math_toolkit/libs/math: doc/sf_and_dist example test
From: john_at_[hidden]
Date: 2008-11-02 08:45:38


Author: johnmaddock
Date: 2008-11-02 08:45:37 EST (Sun, 02 Nov 2008)
New Revision: 49534
URL: http://svn.boost.org/trac/boost/changeset/49534

Log:
Added a new section on building to the docs.
Added explanatory note to example.
Added examples to test Jamfile.v2.
Added:
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/building.qbk (contents, props changed)
Text files modified:
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk | 1 +
   sandbox/math_toolkit/libs/math/example/students_t_single_sample.cpp | 2 +-
   sandbox/math_toolkit/libs/math/test/Jamfile.v2 | 1 +
   3 files changed, 3 insertions(+), 1 deletions(-)

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/building.qbk
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/building.qbk 2008-11-02 08:45:37 EST (Sun, 02 Nov 2008)
@@ -0,0 +1,95 @@
+[section:building How to Build the Library and it's Examples and Tests]
+
+[h4 Building the Library]
+
+The first thing you need to ask yourself is "do I need to build anything at all"
+as the bulk of this library is header only: meaning you can use it just by
+#including the necessary headers.
+
+The ['only] time you need to build the library is if you want to use the
+`extern "C"` functions declared in `<boost/math/tr1.hpp>`. To build this
+using Boost.Build then from Boost's root directory a command like:
+
+ bjam toolset=gcc --with-math install
+
+will do the job on Linux, while:
+
+ bjam toolset=msvc --with-math --build-type=complete stage
+
+will work better on Windows. Either way you should consult the
+[@http://www.boost.org/doc/libs/release/more/getting_started/index.html
+getting started guide] for more information.
+
+You can also build the libraries from your favourite IDE or command line tool:
+each `extern "C"` function declared in `<boost/math/tr1.hpp>` has it's own
+source file with the same name in `libs/math/src/tr1`. Just select the
+sources corresponding to the functions you are using and build them into
+a library, or else add them directly to your project. Note that the
+directory `libs/math/src/tr1` will need to be in your compiler's
+#include path as well as the boost-root directory.
+
+[note If you are using
+a Windows compiler that supports auto-linking and you have built the sources
+yourself (or added them directly to your project) then you will need to
+prevent `<boost/math/tr1.hpp>` from trying to auto-link to the binaries
+that Boost.Build generates. You can do this by defining either
+BOOST_MATH_NO_LIB or BOOST_ALL_NO_LIB at project level
+(so the defines get passed to each compiler invocation).
+]
+
+Optionally the sources in `libs/math/src/tr1` have support for using
+`libs/math/src/tr1/pch.hpp` as a precompiled header
+['if your compiler supports precompiled headers.] Note that normally
+this header is a do-nothing include: to activate the header so that
+it #includes everything required by all the sources you will need to
+define BOOST_BUILD_PCH_ENABLED on the command line, both when building
+the pre-compiled header and when building the sources. Boost.Build
+will do this automatically when appropriate.
+
+[h4 Building the Examples]
+
+The examples are all located in `libs/math/example`, they can all
+be built without reference to any external libraries, either with
+Boost.Build using the supplied Jamfile, or from your compiler's
+command line. The only requirement is that the Boost headers are
+in your compilers #include search path.
+
+[h4 Building the Tests]
+
+The tests are located in `libs/math/test` and are best built
+using Boost.Build and the supplied Jamfile. If you plan to
+build them separately from your favourite IDE then you will
+need to add `libs/math/test` to the list of your compiler's
+search paths.
+
+You will also need to build and link to
+the Boost.Regex library for many of the tests: this can built
+from the command line by following the
+[@http://www.boost.org/doc/libs/release/more/getting_started/index.html
+getting started guide], using a command such as:
+
+ bjam toolset=gcc --with-regex install
+
+or
+
+ bjam toolset=msvc --with-regex --build-type=complete stage
+
+depending on whether you are on Linux or Windows.
+
+Many of the tests have optional precompiled header support
+using the header `libs/math/test/pch.hpp`.
+Note that normally
+this header is a do-nothing include: to activate the header so that
+it #includes everything required by all the sources you will need to
+define BOOST_BUILD_PCH_ENABLED on the command line, both when building
+the pre-compiled header and when building the sources. Boost.Build
+will do this automatically when appropriate.
+
+[endsect]
+
+[/ logistic.qbk
+ Copyright 2006, 2007, 2008 John Maddock and Paul A. Bristow.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]

Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk 2008-11-02 08:45:37 EST (Sun, 02 Nov 2008)
@@ -331,6 +331,7 @@
 [section:perf_over Performance]
 [performance_overview]
 [endsect]
+[include building.qbk]
 [section:history1 History and What's New]
 [history]
 [endsect]

Modified: sandbox/math_toolkit/libs/math/example/students_t_single_sample.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/example/students_t_single_sample.cpp (original)
+++ sandbox/math_toolkit/libs/math/example/students_t_single_sample.cpp 2008-11-02 08:45:37 EST (Sun, 02 Nov 2008)
@@ -203,7 +203,7 @@
       // calculate df for single sided test:
       double df = students_t::find_degrees_of_freedom(
          fabs(M - Sm), alpha[i], alpha[i], Sd);
- // convert to sample size:
+ // convert to sample size, always one more than the degrees of freedom:
       double size = ceil(df) + 1;
       // Print size:
       cout << fixed << setprecision(0) << setw(16) << right << size;

Modified: sandbox/math_toolkit/libs/math/test/Jamfile.v2
==============================================================================
--- sandbox/math_toolkit/libs/math/test/Jamfile.v2 (original)
+++ sandbox/math_toolkit/libs/math/test/Jamfile.v2 2008-11-02 08:45:37 EST (Sun, 02 Nov 2008)
@@ -499,3 +499,4 @@
 compile ntl_concept_check.cpp : <dependency>../config//has_ntl_rr ;
 compile mpfr_concept_check.cpp : <dependency>../config//has_mpfr_class ;
 
+build-project ../example ;
\ No newline at end of file


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