Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / math / doc / html / math_toolkit / perf_test_app.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>The Performance Test Applications</title>
5 <link rel="stylesheet" href="../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../index.html" title="Math Toolkit 2.11.0">
8 <link rel="up" href="../perf.html" title="Chapter&#160;21.&#160;Performance">
9 <link rel="prev" href="comparisons.html" title="Comparisons to Other Open Source Libraries">
10 <link rel="next" href="../backgrounders.html" title="Chapter&#160;22.&#160;Backgrounders">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="comparisons.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../perf.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../backgrounders.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="math_toolkit.perf_test_app"></a><a class="link" href="perf_test_app.html" title="The Performance Test Applications">The Performance Test Applications</a>
28 </h2></div></div></div>
29 <p>
30       Under <span class="emphasis"><em>boost-path</em></span>/libs/math/reporting/performance you will
31       find some reasonable comprehensive performance test applications for this library.
32     </p>
33 <p>
34       In order to generate the tables you will have seen in this documentation (or
35       others for your specific compiler) you need to invoke <code class="computeroutput"><span class="identifier">bjam</span></code>
36       in this directory, using a C++11 capable compiler. Note that results extend/overwrite
37       whatever is already present in <span class="emphasis"><em>boost-path</em></span>/libs/math/reporting/performance/doc/performance_tables.qbk,
38       you may want to delete this file before you begin so as to make a fresh start
39       for your particular system.
40     </p>
41 <p>
42       The programs produce results in Boost's Quickbook format which is not terribly
43       human readable. If you configure your user-config.jam to be able to build Docbook
44       documentation, then you will also get a full summary of all the data in HTML
45       format in <span class="emphasis"><em>boost-path</em></span>/libs/math/reporting/performance/html/index.html.
46       Assuming you're on a 'nix-like platform the procedure to do this is to first
47       install the <code class="computeroutput"><span class="identifier">xsltproc</span></code>, <code class="computeroutput"><span class="identifier">Docbook</span> <span class="identifier">DTD</span></code>,
48       and <code class="computeroutput"><span class="identifier">Bookbook</span> <span class="identifier">XSL</span></code>
49       packages. Then:
50     </p>
51 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
52 <li class="listitem">
53           Copy <span class="emphasis"><em>boost-path</em></span>/tools/build/example/user-config.jam
54           to your home directory.
55         </li>
56 <li class="listitem">
57           Add <code class="computeroutput"><span class="keyword">using</span> <span class="identifier">xsltproc</span>
58           <span class="special">;</span></code> to the end of the file (note the
59           space surrounding each token, including the final ";", this is
60           important!) This assumes that <code class="computeroutput"><span class="identifier">xsltproc</span></code>
61           is in your path.
62         </li>
63 <li class="listitem">
64           Add <code class="computeroutput"><span class="keyword">using</span> <span class="identifier">boostbook</span>
65           <span class="special">:</span> <span class="identifier">path</span><span class="special">-</span><span class="identifier">to</span><span class="special">-</span><span class="identifier">xsl</span><span class="special">-</span><span class="identifier">stylesheets</span> <span class="special">:</span>
66           <span class="identifier">path</span><span class="special">-</span><span class="identifier">to</span><span class="special">-</span><span class="identifier">dtd</span>
67           <span class="special">;</span></code> to the end of the file. The <code class="computeroutput"><span class="identifier">path</span><span class="special">-</span><span class="identifier">to</span><span class="special">-</span><span class="identifier">dtd</span></code>
68           should point to version 4.2.x of the Docbook DTD, while <code class="computeroutput"><span class="identifier">path</span><span class="special">-</span><span class="identifier">to</span><span class="special">-</span><span class="identifier">xsl</span><span class="special">-</span><span class="identifier">stylesheets</span></code> should point to the folder
69           containing the latest XSLT stylesheets. Both paths should use all forward
70           slashes even on Windows.
71         </li>
72 </ul></div>
73 <p>
74       At this point you should be able to run the tests and generate the HTML summary,
75       if GSL, RMath or libstdc++ are present in the compilers path they will be automatically
76       tested. For DCDFLIB you will need to place the C source in <span class="emphasis"><em>boost-path</em></span>/libs/math/reporting/performance/third_party/dcdflib.
77     </p>
78 <p>
79       If you want to compare multiple compilers, or multiple options for one compiler,
80       then you will need to invoke <code class="computeroutput"><span class="identifier">bjam</span></code>
81       multiple times, once for each compiler. Note that in order to test multiple
82       configurations of the same compiler, each has to be given a unique name in
83       the test program, otherwise they all edit the same table cells. Suppose you
84       want to test GCC with and without the -ffast-math option, in this case bjam
85       would be invoked first as:
86     </p>
87 <pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">gcc</span> <span class="special">-</span><span class="identifier">a</span> <span class="identifier">cxxflags</span><span class="special">=-</span><span class="identifier">std</span><span class="special">=</span><span class="identifier">gnu</span><span class="special">++</span><span class="number">11</span>
88 </pre>
89 <p>
90       Which would run the tests using default optimization options (-O3), we can
91       then run again using -ffast-math:
92     </p>
93 <pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">gcc</span> <span class="special">-</span><span class="identifier">a</span> <span class="identifier">cxxflags</span><span class="special">=</span><span class="char">'-std=gnu++11 -ffast-math'</span> <span class="identifier">define</span><span class="special">=</span><span class="identifier">COMPILER_NAME</span><span class="special">=</span><span class="char">'"GCC with -ffast-math"'</span>
94 </pre>
95 <p>
96       In the command line above, the -a flag forces a full rebuild, and the preprocessor
97       define COMPILER_NAME needs to be set to a string literal describing the compiler
98       configuration, hence the double quotes - one for the command line, one for
99       the compiler.
100     </p>
101 </div>
102 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
103 <td align="left"></td>
104 <td align="right"><div class="copyright-footer">Copyright &#169; 2006-2019 Nikhar
105       Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
106       Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
107       R&#229;de, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
108       Daryle Walker and Xiaogang Zhang<p>
109         Distributed under the Boost Software License, Version 1.0. (See accompanying
110         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
111       </p>
112 </div></td>
113 </tr></table>
114 <hr>
115 <div class="spirit-nav">
116 <a accesskey="p" href="comparisons.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../perf.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../backgrounders.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
117 </div>
118 </body>
119 </html>