• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Compilation</title>
5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../index.html" title="Chapter 1. Geometry">
8<link rel="up" href="../index.html" title="Chapter 1. Geometry">
9<link rel="prev" href="introduction.html" title="Introduction">
10<link rel="next" href="design.html" title="Design Rationale">
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="introduction.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="design.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="geometry.compilation"></a><a class="link" href="compilation.html" title="Compilation">Compilation</a>
28</h2></div></div></div>
29<div class="caution"><table border="0" summary="Caution">
30<tr>
31<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../doc/src/images/caution.png"></td>
32<th align="left">Caution</th>
33</tr>
34<tr><td align="left" valign="top"><p>
35        Boost.Geometry in Boost 1.73 deprecates support for the C++03 and will require
36        C++14 from Boost 1.75 onwards
37      </p></td></tr>
38</table></div>
39<p>
40      Boost.Geometry is a headers-only library. Users only need to include the library
41      headers in their programs in order to be able to access definitions and algorithms
42      provided by the Boost.Geometry library. No linking against any binaries is
43      required.
44    </p>
45<p>
46      Boost.Geometry is only dependant on headers-only Boost libraries. It does not
47      introduce indirect dependencies on any binary libraries.
48    </p>
49<p>
50      In order to be able to use Boost.Geometry, the only thing users need to do
51      is to download and/or install Boost and specify location to include directories,
52      so <code class="computeroutput"><span class="identifier">include</span></code> directives of this
53      scheme will work:
54    </p>
55<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/...&gt;</span>
56</pre>
57<h4>
58<a name="geometry.compilation.h0"></a>
59      <span class="phrase"><a name="geometry.compilation.supported_compilers"></a></span><a class="link" href="compilation.html#geometry.compilation.supported_compilers">Supported
60      Compilers</a>
61    </h4>
62<p>
63      Boost.Geometry library has been successfully tested with the following compilers:
64    </p>
65<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
66<li class="listitem">
67          MSVC (including Express Editions)
68          <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
69<li class="listitem">
70                14.0 (MSVC 14 CTP)
71              </li>
72<li class="listitem">
73                12.0 (MSVC 2013)
74              </li>
75<li class="listitem">
76                11.0 (MSVC 2012)
77              </li>
78<li class="listitem">
79                10.0 (MSVC 2010)
80              </li>
81<li class="listitem">
82                9.0 (MSVC 2008)
83              </li>
84<li class="listitem">
85                8.0 (MSVC 2005)
86              </li>
87</ul></div>
88        </li>
89<li class="listitem">
90          gcc
91          <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
92<li class="listitem">
93                gcc 5.0.0
94              </li>
95<li class="listitem">
96                gcc 4.9.2
97              </li>
98<li class="listitem">
99                gcc 4.9.0
100              </li>
101<li class="listitem">
102                gcc 4.8.4
103              </li>
104<li class="listitem">
105                gcc 4.8.1
106              </li>
107<li class="listitem">
108                gcc 4.8.0
109              </li>
110<li class="listitem">
111                gcc 4.7.3
112              </li>
113<li class="listitem">
114                gcc 4.7.2
115              </li>
116<li class="listitem">
117                gcc 4.7.0
118              </li>
119<li class="listitem">
120                gcc 4.6.4
121              </li>
122<li class="listitem">
123                gcc 4.6.2
124              </li>
125<li class="listitem">
126                gcc 4.6.1
127              </li>
128<li class="listitem">
129                gcc 4.6.0
130              </li>
131<li class="listitem">
132                gcc 4.5.3
133              </li>
134<li class="listitem">
135                gcc 4.5.2
136              </li>
137<li class="listitem">
138                gcc 4.4.7
139              </li>
140<li class="listitem">
141                gcc 4.4.0
142              </li>
143<li class="listitem">
144                gcc 4.3.4
145              </li>
146<li class="listitem">
147                gcc 4.2.1
148              </li>
149<li class="listitem">
150                gcc 3.4.6
151              </li>
152</ul></div>
153        </li>
154<li class="listitem">
155          clang
156          <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
157<li class="listitem">
158                clang 3.6
159              </li>
160<li class="listitem">
161                clang 3.5
162              </li>
163<li class="listitem">
164                clang 3.4
165              </li>
166<li class="listitem">
167                clang 3.3
168              </li>
169<li class="listitem">
170                clang 3.2
171              </li>
172<li class="listitem">
173                clang 3.1
174              </li>
175<li class="listitem">
176                clang 3.0
177              </li>
178<li class="listitem">
179                clang 2.9
180              </li>
181</ul></div>
182        </li>
183<li class="listitem">
184          darwin
185          <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
186<li class="listitem">
187                darwin 4.0.1
188              </li>
189<li class="listitem">
190                darwin 4.4
191              </li>
192</ul></div>
193        </li>
194<li class="listitem">
195          intel
196          <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
197<li class="listitem">
198                intel 11.1
199              </li>
200<li class="listitem">
201                intel 11.0
202              </li>
203<li class="listitem">
204                intel 10.1
205              </li>
206</ul></div>
207        </li>
208<li class="listitem">
209          pathscale
210          <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem">
211                pathscale 4.0.8
212              </li></ul></div>
213        </li>
214</ul></div>
215<p>
216      Boost.Geometry uses Boost.Build, a text-based system for developing and testing
217      software, to configure, build and execute unit tests and example programs.
218      The build configuration is provided as a collection of <code class="computeroutput"><span class="identifier">Jamfile</span></code>
219      files.
220    </p>
221<p>
222      For gcc, flag <code class="literal">-Wno-long-long</code> can be used to surpress some
223      warnings originating from Boost.
224    </p>
225<h4>
226<a name="geometry.compilation.h1"></a>
227      <span class="phrase"><a name="geometry.compilation.includes"></a></span><a class="link" href="compilation.html#geometry.compilation.includes">Includes</a>
228    </h4>
229<p>
230      The most convenient headerfile including all algorithms and strategies is
231      <code class="computeroutput"><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span></code>:
232    </p>
233<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
234</pre>
235<p>
236      This is the main header of the Boost.Geometry library and it is recommended
237      to include this file.
238    </p>
239<p>
240      Alternatively, it is possible to include Boost.Geometry header files separately.
241      However, this may be inconvenient as header files might be renamed or moved
242      occasionaly in future.
243    </p>
244<p>
245      Another often used header is <code class="computeroutput"><span class="identifier">geometries</span><span class="special">.</span><span class="identifier">hpp</span></code>:
246    </p>
247<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
248</pre>
249<p>
250      This includes definitions of all provided geometry types:
251    </p>
252<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
253<li class="listitem">
254          point,
255        </li>
256<li class="listitem">
257          linestring,
258        </li>
259<li class="listitem">
260          polygon,
261        </li>
262<li class="listitem">
263          ring,
264        </li>
265<li class="listitem">
266          multi_point,
267        </li>
268<li class="listitem">
269          multi_linestring,
270        </li>
271<li class="listitem">
272          multi_polygon,
273        </li>
274<li class="listitem">
275          box,
276        </li>
277<li class="listitem">
278          segment.
279        </li>
280</ul></div>
281<p>
282      The file <code class="computeroutput"><span class="identifier">geometries</span><span class="special">.</span><span class="identifier">hpp</span></code> is not included in the <code class="computeroutput"><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span></code> headerfile because users should be given
283      the liberty to use their own geometries and not the provided ones. However,
284      for the Boost.Geometry users who want to use the provided geometries it is
285      useful to include.
286    </p>
287<h4>
288<a name="geometry.compilation.h2"></a>
289      <span class="phrase"><a name="geometry.compilation.advanced_includes"></a></span><a class="link" href="compilation.html#geometry.compilation.advanced_includes">Advanced
290      Includes</a>
291    </h4>
292<p>
293      Users who have their own geometries and want to use algorithms from Boost.Geometry
294      might include the files containing registration macro's, like:
295    </p>
296<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="keyword">register</span><span class="special">/</span><span class="identifier">point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
297</pre>
298<h4>
299<a name="geometry.compilation.h3"></a>
300      <span class="phrase"><a name="geometry.compilation.performance"></a></span><a class="link" href="compilation.html#geometry.compilation.performance">Performance</a>
301    </h4>
302<p>
303      The enumeration below is not exhaustive but can contain hints to improve the
304      performance:
305    </p>
306<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
307<li class="listitem">
308          For Microsoft MSVC, set define <code class="computeroutput"><span class="identifier">_SECURE_SCL</span><span class="special">=</span><span class="number">0</span></code> for preprocessor.
309        </li>
310<li class="listitem">
311          For Microsoft MSVC, set define <code class="computeroutput"><span class="identifier">_HAS_ITERATOR_DEBUGGING</span><span class="special">=</span><span class="number">0</span></code> for preprocessor.
312        </li>
313<li class="listitem">
314          Use of <a href="http://sourceforge.net/projects/stlport" target="_top">STLport</a>,
315          a popular open-source implementation of the STL, may result in significantly
316          faster code than use of the C++ standard library provided by MSVC.
317        </li>
318<li class="listitem">
319          Turn on compiler optimizations, compile in release mode.
320        </li>
321</ul></div>
322<h4>
323<a name="geometry.compilation.h4"></a>
324      <span class="phrase"><a name="geometry.compilation.problems_with_intellisense"></a></span><a class="link" href="compilation.html#geometry.compilation.problems_with_intellisense">Problems
325      with Intellisense</a>
326    </h4>
327<p>
328      Both versions of MSVC, 2005 and 2008 (including Express Editions) can hang
329      trying to resolve symbols and give <a href="http://en.wikipedia.org/wiki/IntelliSense" target="_top">IntelliSense</a>
330      suggestions while typing in a bracket or angle bracket. This is not directly
331      related to Boost.Geometry, but is caused by problems with handling by this
332      IDE large C++ code base with intensively used templates, such as Boost and
333      Boost.Geometry. If this is inconvenient, IntelliSense can be turned off:
334    </p>
335<div class="blockquote"><blockquote class="blockquote">
336<p>
337        <span class="emphasis"><em><span class="quote">“<span class="quote">(...)disabling IntelliSense in VC++. There is a file called
338        <code class="computeroutput"><span class="identifier">feacp</span><span class="special">.</span><span class="identifier">dll</span></code> in <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">VS8INSTALL</span><span class="special">&gt;/</span><span class="identifier">VC</span><span class="special">/</span><span class="identifier">vcpackages</span></code>
339        folder. Renaming this file will disable Intellisense feature.</span>”</span></em></span>
340      </p>
341<p>
342        -- <a href="http://blogs.msdn.com/yash/archive/2007/09/19/intellisense-issues-in-visual-c-2005.aspx" target="_top">Intellisense
343        issues in Visual C++ 2005</a>
344      </p>
345</blockquote></div>
346</div>
347<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
348<td align="left"></td>
349<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
350      Wulkiewicz, Oracle and/or its affiliates<p>
351        Distributed under the Boost Software License, Version 1.0. (See accompanying
352        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>)
353      </p>
354</div></td>
355</tr></table>
356<hr>
357<div class="spirit-nav">
358<a accesskey="p" href="introduction.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="design.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
359</div>
360</body>
361</html>
362