File: compiler_specifics.html

package info (click to toggle)
boost 1.32.0-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 93,952 kB
  • ctags: 128,458
  • sloc: cpp: 492,477; xml: 52,125; python: 13,519; ansic: 13,013; sh: 1,773; yacc: 853; makefile: 526; perl: 418; lex: 110; csh: 6
file content (469 lines) | stat: -rw-r--r-- 18,432 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.MultiIndex Documentation - Compiler specifics</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>

<body>
<h1><img src="../../../boost.png" alt="boost.png (6897 bytes)" align=
"middle" width="277" height="86">Boost.MultiIndex Compiler specifics</h1>

<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
Key extraction
</a></div>
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
Index
</a></div>
<div class="next_link"><a href="performance.html"><img src="next.gif" alt="performance" border="0"><br>
Performance
</a></div><br clear="all" style="clear: all;">

<hr>

<p>
Boost.MultiIndex has been tried in different compilers, with
various degrees of success. We list the limitations encountered,
along with suitable workarounds when available. Up to date information
on compatibility of Boost.MultiIndex with several compilers can
be found at the <a href="http://boost.sourceforge.net/regression-logs/">
Boost Compiler Status Summary</a>. Take into account, however, that between
releases of Boost the results from these automatic tests can reflect
spurious errors due to work in progress, and may not serve as an accurate
indication of which compilers are actually supported.
</p>

<h2>Contents</h2>

<ul>
  <li><a href="#bcb_64">Borland C++ Builder 6.4</a></li>
  <li><a href="#comeau_433_win_vc7_71">Comeau C/C++ 4.3.3 for Windows (VC++ 7.0/7.1 backend)</a></li>
  <li><a href="#compaq_65">Compaq C++ 6.5-041 for Tru64 UNIX</a></li>
  <li>
    <a href="#gcc_32">GNU GCC 3.2 and later</a>
    <ul>
      <li><a href="#gcc_tru64">GNU GCC for Tru64 UNIX</a></li>
    </ul>
  </li>
  <li><a href="#va_60">IBM VisualAge C++ V6.0 for AIX</a></li>
  <li><a href="#intel_71_8x_lin">Intel C++ Compiler for Linux 7.1/8.0/8.1</a></li>
  <li><a href="#intel_7x_win">Intel C++ Compiler for Windows 32-bit 7.0/7.1</a></li>
  <li><a href="#intel_71_win_stlport_453">Intel C++ Compiler for Windows 32-bit 7.1 + STLport 4.5.3</a></li>
  <li><a href="#intel_8x_win">Intel C++ Compiler for Windows 32-bit 8.0/8.1</a></li>
  <li><a href="#cw_83_9x">Metrowerks CodeWarrior 8.3/9.2/9.3</a></li>
  <li><a href="#msvc_60">Microsoft Visual C++ 6.0 Service Pack 5</a></li>
  <li><a href="#msvc_60_stlport_453">Microsoft Visual C++ 6.0 Service Pack 5 + STLport 4.5.3</a></li>
  <li><a href="#msvc_70">Microsoft Visual C++ 7.0</a></li>
  <li><a href="#msvc_71">Microsoft Visual C++ 7.1</a></li>
  <li><a href="#msvc_80">Microsoft Visual C++ 8.0</a></li>
</ul>

<h2><a name="bcb_64">Borland C++ Builder 6.4</a></h2>

<p>
Currently, Boost.MultiIndex cannot be used with BCB 6.4. The
number of problems encountered during the tests makes it unlikely that
future versions of the library can be made to work under
this compiler.
</p>

<h2><a name="comeau_433_win_vc7_71">Comeau C/C++ 4.3.3 for Windows (VC++ 7.0/7.1 backend)</a></h2>

<p>
No problems have been detected with this compiler. The library fails to compile,
however, when Microsoft Visual C++ 6.0 is used as the backend.
</p>

<h2><a name="compaq_65">Compaq C++ 6.5-041 for Tru64 UNIX</a></h2>

<p>
No problems have been detected with this compiler.
</p>

<h2><a name="gcc_32">GNU GCC 3.2 and later</a></h2>

<p>
No problems have been detected with several versions of this compiler
starting from 3.2. The following versions have been explicitly tested:
<ul>
  <li>GCC 3.2 20020927 (prerelease) under Cygwin 1.5.7,</li>
  <li>GCC 3.2.3 under Linux,</li>
  <li>GCC 3.3 20030304 under Mac OS,</li>
  <li>GCC 3.3.1 (cygming special) under Cygwin 1.5.7, (mingw special 20030804-1) under Win32</li>
  <li>GCC 3.3.2 under Linux,</li>
  <li>GCC 3.3.3 under Linux,</li>
  <li>GCC 3.4.0 under Linux and Solaris,</li>
  <li>GCC 3.4.1 under HP-UX and Linux,</li>
  <li>GCC 3.4.2 under Linux and Tru64 (see <a href="#gcc_tru64">below</a>),
    (mingw-special) under Win32.</li>
</ul>
Boost.MultiIndex does not work with versions 3.1 and prior of GCC.
</p>

<h3><a name="gcc_tru64">GNU GCC for Tru64 UNIX</a></h3>

<p>
On this platform, GCC is not able to handle debug symbol names whose length
exceeds 32,768 bytes, resulting in the error <code>mips-tfile, ... string
too big</code>. You may encounter this issue with heavily templatized
code like Boost.MultiIndex, which typically produces long symbol names. The problem
can be overcome by omitting the compiler option <code>-g</code> (generate debugging
information.) Alternatively, you can restrict the maximum number of elements accepted by 
<a href="reference/indices.html#indexed_by"><code>indexed_by</code></a>,
<a href="reference/indices.html#tag"><code>tag</code></a> and
<a href="reference/key_extraction.html#composite_key"><code>composite_key</code></a>
by globally setting the values of the macros
<ul>
  <li><code>BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE</code>
    (default: 20),</li>
  <li><code>BOOST_MULTI_INDEX_LIMIT_TAG_SIZE</code>
    (default: 20),</li>
  <li><code>BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE</code>
    (default: 10).</li>
</ul>
This operation results in a modest reduction of the lengths of symbol
names.
</p>

<h2><a name="va_60">IBM VisualAge C++ V6.0 for AIX</a></h2>

<p>
<a href="reference/key_extraction.html#member"><code>member</code></a> not supported,
replace with
<a href="reference/key_extraction.html#member_offset"><code>member_offset</code></a> or
use the cross-platform macro
<a href="reference/key_extraction.html#boost_multi_index_member">
<code>BOOST_MULTI_INDEX_MEMBER</code></a>. The compiler emits warnings about the
use of <code>offsetof</code> with non-POD types: these warnings can be suppressed
by setting the compiler option <code>-qsuppress=1540-1281</code>, or, alternatively,
by inserting the following preprocessor directive:
</p>

<blockquote><pre>
<span class=preprocessor>#pragma</span> <span class=identifier>info</span><span class=special>(</span><span class=identifier>nolan</span><span class=special>)</span>
</pre></blockquote>

<p>
This latter pragma, however, may also eliminate other warnings not related
to the use of <code>offsetof</code>.
</p>

<h2><a name="intel_71_8x_lin">Intel C++ Compiler for Linux 7.1/8.0/8.1</a></h2>

<p>
No problems have been detected with these compilers.
</p>

<h2><a name="intel_7x_win">Intel C++ Compiler for Windows 32-bit 7.0/7.1</a></h2>

<p>
<a href="reference/key_extraction.html#member"><code>member</code></a> not supported,
replace with
<a href="reference/key_extraction.html#member_offset"><code>member_offset</code></a> or
use the cross-platform macro
<a href="reference/key_extraction.html#boost_multi_index_member">
<code>BOOST_MULTI_INDEX_MEMBER</code></a>.
</p>

<blockquote><hr></blockquote>

<p>
Altough Koenig lookup seems to be officially supported by this compiler,
some issues have arisen seemingly due to bugs related to this facility.
In these cases you might need to explicitly qualify global names with
<code>::boost::multi_index</code>.
</p>

<h2><a name="#intel_71_win_stlport_453">
Intel C++ Compiler for Windows 32-bit 7.1 + STLport 4.5.3</a></h2>

<p>
Boost.MultiIndex works for this configuration. The same limitations apply as
in Intel C++ 7.1 with its original Dinkumware standard library. STLport 4.6.2 has
also been confirmed to work correctly.
</p>

<h2><a name="intel_8x_win">Intel C++ Compiler for Windows 32-bit 8.0/8.1</a></h2>

<p>
No problems have been detected with these compilers.
</p>

<h2><a name="cw_83_9x">Metrowerks CodeWarrior 8.3/9.2/9.3</a></h2>

<p>
Boost.MultiIndex works correctly with these versions of the compiler, under the
two operating systems tested: Mac OS and Windows.
</p>

<h2><a name="msvc_60">Microsoft Visual C++ 6.0 Service Pack 5</a></h2>

<p>
<a href="reference/key_extraction.html#member"><code>member</code></a> not supported,
replace with
<a href="reference/key_extraction.html#member_offset"><code>member_offset</code></a> or
use the cross-platform macro
<a href="reference/key_extraction.html#boost_multi_index_member">
<code>BOOST_MULTI_INDEX_MEMBER</code></a>.
</p>

<p>
<a href="reference/key_extraction.html#const_mem_fun"><code>const_mem_fun</code></a> not
supported, replace with
<a href="reference/key_extraction.html#const_mem_fun_explicit">
<code>const_mem_fun_explicit</code></a>
or use the cross-platform macro
<a href="reference/key_extraction.html#boost_multi_index_const_mem_fun">
<code>BOOST_MULTI_INDEX_CONST_MEM_FUN</code></a>.
</p>

<p>
<a href="reference/key_extraction.html#mem_fun"><code>mem_fun</code></a> is not
supported, replace with
<a href="reference/key_extraction.html#mem_fun_explicit">
<code>mem_fun_explicit</code></a> or
use the cross-platform macro
<a href="reference/key_extraction.html#boost_multi_index_mem_fun">
<code>BOOST_MULTI_INDEX_MEM_FUN</code></a>.
</p>

<blockquote><hr></blockquote>

<p>
No support for <a href="reference/multi_index_container.html#index_retrieval">index retrieval</a>
and <a href="reference/multi_index_container.html#projection">projection</a>
nested types and member functions:
<ul>
  <li><code>nth_index</code>,</li>
  <li><code>index</code>,</li>
  <li><code>nth_index_iterator</code>,</li>
  <li><code>nth_index_const_iterator</code>,</li>
  <li><code>index_iterator</code>,</li>
  <li><code>index_const_iterator</code>,</li>
  <li><code>get</code>,</li>
  <li><code>project</code>.</li>
</ul>
You can use instead their global equivalents. Also, this compiler does not
implement Koenig lookup, so you might need to explicitly qualify these
global names with <code>::boost::multi_index</code>.
</p>

<blockquote><hr></blockquote>

<p>
The lack of partial template specialization support in MSVC++ 6.0
results in some inconveniences when using <code>composite_key</code> that
can be remedied as explained in
<a href="advanced_topics.html#composite_key_no_pts">"<code>composite_key</code>
in compilers without partial template specialization"</a> on the advanced
topics section.
</p>

<blockquote><hr></blockquote>

<p>
MSVC++ 6.0 presents serious limitations for the maximum length of
symbol names generated by the compiler, which might result in the
linker error
<code><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/lnk1179.asp">LNK1179</a>:
invalid or corrupt file: duplicate comdat
comdat</code>. To overcome this problem, you can restrict the maximum
number of elements accepted by 
<a href="reference/indices.html#indexed_by"><code>indexed_by</code></a>,
<a href="reference/indices.html#tag"><code>tag</code></a> and
<a href="reference/key_extraction.html#composite_key"><code>composite_key</code></a>
by globally setting the values of the macros
<ul>
  <li><code>BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE</code>
    (default in MSVC++ 6.0: 5),</li>
  <li><code>BOOST_MULTI_INDEX_LIMIT_TAG_SIZE</code>
    (default in MSVC++ 6.0: 3),</li>
  <li><code>BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE</code>
    (default in MSVC++ 6.0: 5).</li>
</ul>
This operation results in a modest reduction of the lengths of symbol
names.
</p>

<blockquote><hr></blockquote>

<p>
Under some circumstances, the compiler emits the error
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/C2587.asp">
<code>C2587</code></a><code>: '_U' : illegal use of local variable as
default parameter</code>, inside the MSVC internal header
<code>&lt;xlocnum></code>.
This problem is a recurrent bug of the compiler, and has been reported in
other unrelated libraries, like the
<a href="../../../libs/graph/doc/table_of_contents.html">Boost Graph Library</a>,
<a href="../../../libs/multi_array/doc/index.html">Boost.MultiArray</a>,
<a href="../../../libs/regex/doc/index.html">Boost.Regex</a>,
<a href="http://www.cgal.org/">CGAL</a> and
<a href="http://www.mysql.com/downloads/api-mysql++.html">MySQL++</a>.
The error is triggered, though not in a systematic manner, by the use
of <code>multi_index_container</code> iterator constructor. Two workarounds exist:
the first consists of avoiding this constructor and replacing
code like:
</p>

<blockquote><pre>
<span class=identifier>multi_index_container</span><span class=special>&lt;...&gt;</span> <span class=identifier>s</span><span class=special>(</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>end</span><span class=special>());</span>
</pre></blockquote>

<p>
with equivalent operations:
</p>

<blockquote><pre>
<span class=identifier>multi_index_container</span><span class=special>&lt;...&gt;</span> <span class=identifier>s</span><span class=special>;</span>
<span class=identifier>s</span><span class=special>.</span><span class=identifier>insert</span><span class=special>(</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>c</span><span class=special>.</span><span class=identifier>end</span><span class=special>());</span>
</pre></blockquote>

<p>
The second workaround has not been confirmed by the author, but it is given
on the Internet in connection with this error appearing in other libraries.
Replace line 84 of <code>&lt;xlocnum></code>

<blockquote><pre>
 <span class=preprocessor>#define</span> <span class=identifier>_VIRTUAL</span>	<span class=keyword>virtual</span>
</pre></blockquote>

<p>
with the following:
</p>

<blockquote><pre>
 <span class=preprocessor>#define</span> <span class=identifier>_VIRTUAL</span>
</pre></blockquote>
</p>

<p>
<b>Warning</b>: it is not known whether this
replacement can result in unexpected side effects in code implicitly
using <code>&lt;xlocnum></code>.
</p>

<blockquote><hr></blockquote>

<p>
In general, the extensive use of templates by Boost.MultiIndex puts this compiler
under severe stress, so that several internal limitations may be reached.
The following measures can help alleviate these problems:
<ul>
  <li>Set the compiler option <code>/Zm</code> (Specify Memory Allocation Limit)
    to increase the amount of memory available for compilation. Usual values for
    this option range from 300 to 800.</li>
  <li>If in debug mode, try switching from <code>/ZI</code> (Program Database for
    Edit and Continue) to a less demanding type of debugging information
    (<code>/Zi</code>, <code>/Z7</code> or <code>/Zd</code>.)</li>
  <li>Play with the precompiled headers options. Usually, turning this feature
    off yields the best results.</li>
  <li>If the compiler emits the error
    <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/c1055.asp">
    <code>C1055</code></a><code>: compiler limit : out of keys</code>, try
    disabling the option <code>/Gm</code> (Enable Minimal Rebuild.) In these
    cases, it is also beneficial to split the project into smaller
    subprojects.</li>
</ul>
</p>

<h2>
<a name="msvc_60_stlport_453">Microsoft Visual C++ 6.0 Service Pack 5
+ STLport 4.5.3</a>
</h2>

<p>
Boost.MultiIndex works for this configuration. The same limitations apply as
in MSVC++ 6.0 with its original Dinkumware standard library. STLport 4.6.2 has
also been confirmed to work correctly.
</p>

<h2><a name="msvc_70">Microsoft Visual C++ 7.0</a></h2>

<p>
<a href="reference/key_extraction.html#member"><code>member</code></a> not supported,
replace with
<a href="reference/key_extraction.html#member_offset"><code>member_offset</code></a> or
use the cross-platform macro
<a href="reference/key_extraction.html#boost_multi_index_member">
<code>BOOST_MULTI_INDEX_MEMBER</code></a>.
</p>

<blockquote><hr></blockquote>

<p>
No support for <a href="reference/multi_index_container.html#index_retrieval">index retrieval</a>
and <a href="reference/multi_index_container.html#projection">projection</a>
nested types and member functions:
<ul>
  <li><code>nth_index</code>,</li>
  <li><code>index</code>,</li>
  <li><code>nth_index_iterator</code>,</li>
  <li><code>nth_index_const_iterator</code>,</li>
  <li><code>index_iterator</code>,</li>
  <li><code>index_const_iterator</code>,</li>
  <li><code>get</code>,</li>
  <li><code>project</code>.</li>
</ul>
You can use instead their global equivalents. Also, this compiler does not
implement Koenig lookup, so you might need to explicitly qualify these
global names with <code>::boost::multi_index</code>.
</p>

<blockquote><hr></blockquote>

<p>
The lack of partial template specialization support in MSVC++ 7.0
results in some inconveniences when using <code>composite_key</code> that
can be remedied as explained in
<a href="advanced_topics.html#composite_key_no_pts">"<code>composite_key</code>
in compilers without partial template specialization"</a> on the advanced
topics section.
</p>

<h2><a name="msvc_71">Microsoft Visual C++ 7.1</a></h2>

<p>
Problems have been reported when compiling the library with the <code>/Gm</code>
option (Enable Minimal Rebuild.) Seemingly, this is due to an
internal defect of the compiler (see for instance
<a href="http://lists.boost.org/MailArchives/boost-users/msg05988.php">
this mention of a similar issue</a> in the Boost Users mailing list.)
If <code>/Gm</code> is turned off, Boost.MultiIndex compiles and runs
without further problems.
</p>

<h2><a name="msvc_80">Microsoft Visual C++ 8.0</a></h2>

<p>
No problems have been detected with this compiler. The Beta 1 version of
this product was used for the testing.
</p>

<hr>

<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
Key extraction
</a></div>
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
Index
</a></div>
<div class="next_link"><a href="performance.html"><img src="next.gif" alt="performance" border="0"><br>
Performance
</a></div><br clear="all" style="clear: all;">

<br>

<p>Revised October 18th 2004</p>

<p>&copy; Copyright 2003-2004 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software 
License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

</body>
</html>