Boost C++ Libraries: Ticket #6359: Intel Composer XE 2011 (12.0) fails to build Boost.Regex with ICU support https://svn.boost.org/trac10/ticket/6359 <h3 class="section" id="Environment">Environment</h3> <ul><li>Intel C++ Composer XE 2011 Update 8 for Windows (version 2011.8.278/12.1.2.278) </li><li>Boost 1.48.0 </li><li>ICU 4.8.1.1 (using binaries downloaded from <a class="ext-link" href="http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-Win32-msvc10.zip"><span class="icon">​</span>http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-Win32-msvc10.zip</a>) </li></ul><h3 class="section" id="ReproduceSteps">Reproduce Steps</h3> <ol><li>Apply the attached patch (icubld.patch) in order to correctly have Boost.Build use the correct names for the ICU DLLs with the Intel toolset. </li></ol><ol start="2"><li>Unpack the Win32 ICU binary distribution to a temporary directory (i.e., <code>C:\tmp\icu</code>). </li></ol><ol start="3"><li>Start a command prompt with the Intel Composer XE 2011 environment (i.e., Start Menu -&gt; All Programs -&gt; Intel Parallel Studio XE 2011 -&gt; Command Prompt -&gt; Parallel Studio XE with Intel Compiler XE v12.1 Update 2 -&gt; IA-32 Visual Studio 2010 mode) </li></ol><ol start="4"><li>Change directory into the Boost source tree and run: </li></ol><pre class="wiki">b2 --build-type=complete toolset=intel-12.0 address-model=32 -sICU_PATH=C:\tmp\icu stage </pre><ol start="5"><li>Observe that building <code>libs/regex/src/icu.cpp</code> fails with the following error: </li></ol><pre class="wiki">.\boost/type_traits/is_convertible.hpp(264): error: a reference of type "const boost::icu_regex_traits::char_type={UChar32={int32_t={signed int}}} *&amp;" (not const-qualified) cannot be initialized with a value of type "ptrdiff_t={int} *" BOOST_STATIC_CONSTANT(bool, value = ^ detected during: instantiation of class "boost::detail::is_convertible_basic_impl&lt;From, To&gt; [with From=ptrdiff_t={int} *&amp;, To=const boost::icu_regex_traits::char_type={UChar32={int32_t={signed int}}} *&amp;]" at line 296 instantiation of class "boost::detail::is_convertible_impl&lt;From, To&gt; [with From=ptrdiff_t={int} *, To=const boost::icu_regex_traits::char_type={UChar32={int32_t={signed int}}} *&amp;]" at line 372 instantiation of class "boost::detail::is_convertible_impl_dispatch&lt;From, To&gt; [with From=ptrdiff_t={int} *, To=const boost::icu_regex_traits::char_type={UChar32={int32_t={signed int}}} *&amp;]" at line 419 instantiation of class "boost::is_convertible&lt;From, To&gt; [with From=ptrdiff_t={int} *, To=const boost::icu_regex_traits::char_type={UChar32={int32_t={signed int}}} *&amp;]" at line 183 of ".\boost/regex/v4/regex_format.hpp" instantiation of "int boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::toi(ForwardIter &amp;, ForwardIter, int) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 543 of ".\boost/regex/v4/regex_format.hpp" instantiation of "void boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::format_escape() [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 229 of ".\boost/regex/v4/regex_format.hpp" instantiation of "void boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::format_all() [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 207 of ".\boost/regex/v4/regex_format.hpp" instantiation of "OutputIterator boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::format(ForwardIter, ForwardIter, boost::regex_constants::match_flag_type={boost::regex_constants::match_flags={boost::regex_constants::_match_flags}}) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 838 of ".\boost/regex/v4/regex_format.hpp" instantiation of "OutputIterator boost::re_detail::regex_format_imp(OutputIterator, const boost::match_results&lt;Iterator, Alloc&gt; &amp;, ForwardIter, ForwardIter, boost::regex_constants::match_flag_type={boost::regex_constants::match_flags={boost::regex_constants::_match_flags}}, const traits &amp;) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Iterator=boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, Alloc=std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;, ForwardIter=ptrdiff_t={int} *, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;]" at line 851 of ".\boost/regex/icu.hpp" instantiation of "OutputIterator boost::re_detail::do_regex_replace(OutputIterator, const std::pair&lt;I1, I1&gt; &amp;, const boost::u32regex &amp;, const std::pair&lt;I2, I2&gt; &amp;, boost::regex_constants::match_flag_type={boost::regex_constants::match_flags={boost::regex_constants::_match_flags}}) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, I1=boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, I2=boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;]" at line 1013 of ".\boost/regex/icu.hpp" .\boost/regex/v4/regex_format.hpp(179): error: a reference of type "const boost::icu_regex_traits::char_type={UChar32={int32_t={signed int}}} *&amp;" (not const-qualified) cannot be initialized with a value of type "ptrdiff_t={int} *" return m_traits.toi(i, j, base); ^ detected during: instantiation of "int boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::toi(ForwardIter &amp;, ForwardIter, int, const boost::mpl::true_ &amp;) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 184 instantiation of "int boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::toi(ForwardIter &amp;, ForwardIter, int) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 543 instantiation of "void boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::format_escape() [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 229 instantiation of "void boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::format_all() [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 207 instantiation of "OutputIterator boost::re_detail::basic_regex_formatter&lt;OutputIterator, Results, traits, ForwardIter&gt;::format(ForwardIter, ForwardIter, boost::regex_constants::match_flag_type={boost::regex_constants::match_flags={boost::regex_constants::_match_flags}}) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Results=boost::match_results&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;&gt;, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;, ForwardIter=ptrdiff_t={int} *]" at line 838 instantiation of "OutputIterator boost::re_detail::regex_format_imp(OutputIterator, const boost::match_results&lt;Iterator, Alloc&gt; &amp;, ForwardIter, ForwardIter, boost::regex_constants::match_flag_type={boost::regex_constants::match_flags={boost::regex_constants::_match_flags}}, const traits &amp;) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, Iterator=boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, Alloc=std::allocator&lt;boost::sub_match&lt;boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;&gt;&gt;, ForwardIter=ptrdiff_t={int} *, traits=boost::regex_traits_wrapper&lt;boost::icu_regex_traits&gt;]" at line 851 of ".\boost/regex/icu.hpp" instantiation of "OutputIterator boost::re_detail::do_regex_replace(OutputIterator, const std::pair&lt;I1, I1&gt; &amp;, const boost::u32regex &amp;, const std::pair&lt;I2, I2&gt; &amp;, boost::regex_constants::match_flag_type={boost::regex_constants::match_flags={boost::regex_constants::_match_flags}}) [with OutputIterator=boost::utf16_output_iterator&lt;boost::re_detail::unicode_string_out_iterator&gt;, I1=boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;, I2=boost::u16_to_u32_iterator&lt;const UChar={__wchar_t} *, unsigned int&gt;]" at line 1013 of ".\boost/regex/icu.hpp" compilation aborted for libs\regex\build\..\src\icu.cpp (code 2) </pre><p> Note that I've ommitted the remarks and warnings output by icl for clarity. </p> <h3 class="section" id="AdditionalComments">Additional Comments</h3> <p> Note that I've had no problems building this file on Linux using the same version of Intel's Linux compiler (2011.8.273), nor with earlier versions (11.1) of Intel's Windows compiler. This compiler (intel-win-12.0) is the only one I can trigger this compilation error. As such, I suspect this is actually a compiler bug with Intel. If it turns out to be such, please let me know and I can follow up with Intel directly. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6359 Trac 1.4.3 Brian Bassett <bbassett@…> Wed, 04 Jan 2012 23:23:49 GMT attachment set https://svn.boost.org/trac10/ticket/6359 https://svn.boost.org/trac10/ticket/6359 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">icubld.diff</span> </li> </ul> <p> Patch to have intel-win toolset use the correct ICU library names </p> Ticket John Maddock Thu, 05 Jan 2012 13:32:48 GMT <link>https://svn.boost.org/trac10/ticket/6359#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6359#comment:1</guid> <description> <p> Confirmed. </p> <p> Reduced test case is just: </p> <pre class="wiki">void test(...); void test(const int*&amp;); int main() { int * p = 0; test(p); } </pre><p> Reported to Intel as support issue <a class="missing ticket">#656654</a>. </p> <p> A workaround is: </p> <pre class="wiki">Index: regex_format.hpp =================================================================== --- regex_format.hpp (revision 76120) +++ regex_format.hpp (working copy) @@ -180,8 +180,14 @@ } inline int toi(ForwardIter&amp; i, ForwardIter j, int base) { +#if defined(_MSC_VER) &amp;&amp; defined(__INTEL_COMPILER) &amp;&amp; (__INTEL_COMPILER == 9999) + // Workaround for Intel support issue #656654. + // See also https://svn.boost.org/trac/boost/ticket/6359 + return toi(i, j, base, mpl::false_()); +#else typedef typename boost::is_convertible&lt;ForwardIter, const char_type*&amp;&gt;::type tag_type; return toi(i, j, base, tag_type()); +#endif } const traits&amp; m_traits; // the traits class for localised formatting operations </pre><p> HTH, John. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 05 Jan 2012 13:33:50 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6359#comment:2 https://svn.boost.org/trac10/ticket/6359#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76319" title="Add workaround for Intel-12.1 on Windows. Fixes #6359.">[76319]</a>) Add workaround for Intel-12.1 on Windows. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6359" title="#6359: Bugs: Intel Composer XE 2011 (12.0) fails to build Boost.Regex with ICU support (closed: fixed)">#6359</a>. </p> Ticket John Maddock Thu, 05 Jan 2012 13:35:49 GMT <link>https://svn.boost.org/trac10/ticket/6359#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6359#comment:3</guid> <description> <p> PS Forgot to add that your patch will break ICU build on Intel-Linux. I haven't been able to get a version to work that selects "intel-win" as the toolset :-( </p> </description> <category>Ticket</category> </item> <item> <author>Brian Bassett <bbassett@…></author> <pubDate>Thu, 05 Jan 2012 17:02:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6359#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6359#comment:4</guid> <description> <p> That's OK...the patch was designed to facilitate demonstrating the issue, and not actually intended to be used in production. (We're actually using Boost.CMake to build our copies of Boost libraries, so we have other ways to get the right library names linked in.) </p> <p> However, I had to make a tweak to your workaround. The ifdef had to be: </p> <pre class="wiki">#if defined(_MSC_VER) &amp;&amp; defined(__INTEL_COMPILER) &amp;&amp; ((__INTEL_COMPILER == 9999) || (__INTEL_COMPILER == 1210)) </pre><p> since Composer XE 2011 Update 8 has gotten the correct value of <code>__INTEL_COMPILER</code>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 05 Jan 2012 17:31:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6359#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6359#comment:5</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76324" title="Fix pp-logic. Refs #6359.">[76324]</a>) Fix pp-logic. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6359" title="#6359: Bugs: Intel Composer XE 2011 (12.0) fails to build Boost.Regex with ICU support (closed: fixed)">#6359</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 05 Jan 2012 17:32:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6359#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6359#comment:6</guid> <description> <p> Dang.... your updated patch has been applied, also found a way to fix Boost.Build to look for the correct ICU libs... </p> <p> John. </p> </description> <category>Ticket</category> </item> </channel> </rss>