multi_index/doc/compiler_specifics.html
Joaquín M. López Muñoz b7da8d2a00 added CW 9.3
[SVN r24994]
2004-09-10 09:04:45 +00:00

439 lines
17 KiB
HTML

<!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="../../../c++boost.gif" alt="c++boost.gif (8819 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></li>
<li><a href="#va_60">IBM VisualAge C++ V6.0 for AIX</a></li>
<li><a href="#intel_7_8_lin">Intel C++ Compiler for Linux 7.1/8.0</a></li>
<li><a href="#intel_7_win">Intel C++ Compiler for Windows 32-bit 7.0/7.1</a></li>
<li><a href="#intel_7_win_stlport_453">Intel C++ Compiler for Windows 32-bit 7.1 + STLport 4.5.3</a></li>
<li><a href="#intel_8_win">Intel C++ Compiler for Windows 32-bit 8.0</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,</li>
<li>GCC 3.3.2 under Linux,</li>
<li>GCC 3.3.3 under Linux,</li>
<li>GCC 3.4.0 under Linux,</li>
<li>GCC 3.4.0 under Solaris,</li>
<li>GCC 3.4.1 under Linux.</li>
</ul>
Boost.MultiIndex do not work with versions 3.1 and prior of GCC.
</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_7_8_lin">Intel C++ Compiler for Linux 7.1/8.0</a></h2>
<p>
No problems have been detected with these compilers.
</p>
<h2><a name="intel_7_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_7_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_8_win">Intel C++ Compiler for Windows 32-bit 8.0</a></h2>
<p>
No problems have been detected with this compiler.
</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 September 10th 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>