Boost C++ Libraries: Ticket #4657: Boost.MPI Compile failure with Python 3 https://svn.boost.org/trac10/ticket/4657 <p> Boost 1.44 configured to use Python 3.1 fails on two Boost.MPI files. The two fatal error messages are reproduced below, edited (see <a class="ext-link" href="http://lists.boost.org/Archives/boost/2010/09/170659.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2010/09/170659.php</a> for the full error output). </p> <p> This failure was discussed in Debian (<a class="ext-link" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595786"><span class="icon">​</span>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595786</a>) and Andreas Kloeckner provided a patch. See attached. </p> <p> -Steve </p> <blockquote> <p> "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -g -D_REENTRANT -pthread -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_MPI_DYN_LINK=1 -DBOOST_MPI_PYTHON_DYN_LINK=1 -DBOOST_PYTHON_DYN_LINK=1 -DNDEBUG -I"." -I"/usr/include/python3.1" -I"/usr/lib/openmpi/include" -I"/usr/lib/openmpi/include/openmpi" -c -o "bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/datatypes.o" "libs/mpi/src/python/datatypes.cpp" </p> </blockquote> <p> libs/mpi/src/python/datatypes.cpp: In function ‘void boost::mpi::python::export_datatypes()’: libs/mpi/src/python/datatypes.cpp:20: error: ‘PyInt_Type’ was not declared in this scope In file included from ./boost/function/detail/prologue.hpp:17, </p> <blockquote> <p> from ./boost/function/function_template.hpp:13, from ./boost/function/detail/maybe_include.hpp:13, from ./boost/function/function0.hpp:11, from ./boost/python/errors.hpp:13, from ./boost/python/handle.hpp:11, from ./boost/python/converter/arg_to_python_base.hpp:7, from ./boost/python/converter/arg_to_python.hpp:14, from ./boost/python/call.hpp:15, from ./boost/python/object_core.hpp:14, from ./boost/python/object.hpp:9, from ./boost/mpi/python/serialize.hpp:25, from libs/mpi/src/python/datatypes.cpp:13: </p> </blockquote> <p> ...failed gcc.compile.c++ bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/datatypes.o... </p> <p> and </p> <blockquote> <p> "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -g -D_REENTRANT -pthread -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_MPI_DYN_LINK=1 -DBOOST_MPI_PYTHON_DYN_LINK=1 -DBOOST_PYTHON_DYN_LINK=1 -DNDEBUG -I"." -I"/usr/include/python3.1" -I"/usr/lib/openmpi/include" -I"/usr/lib/openmpi/include/openmpi" -c -o "bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/py_environment.o" "libs/mpi/src/python/py_environment.cpp" </p> </blockquote> <p> libs/mpi/src/python/py_environment.cpp: In function ‘bool boost::mpi::python::mpi_init(boost::python::list, bool)’: libs/mpi/src/python/py_environment.cpp:53: error: cannot convert ‘char<strong>’ to ‘wchar_t</strong>’ for argument ‘2’ to ‘void PySys_SetArgv(int, wchar_t<strong>)’ ...failed gcc.compile.c++ bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/py_environment.o... </strong></p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4657 Trac 1.4.3 anonymous Sat, 18 Sep 2010 18:05:18 GMT attachment set https://svn.boost.org/trac10/ticket/4657 https://svn.boost.org/trac10/ticket/4657 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-1.44-py3.1.patch</span> </li> </ul> Ticket Matthias Troyer Wed, 03 Nov 2010 19:36:37 GMT <link>https://svn.boost.org/trac10/ticket/4657#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:1</guid> <description> <p> What are the license conditions for the part inserted as " <em> Code stolen from py3k/Modules/python.c."? </em></p> </description> <category>Ticket</category> </item> <item> <dc:creator>Matthias Troyer</dc:creator> <pubDate>Wed, 03 Nov 2010 19:36:53 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/4657#comment:2 https://svn.boost.org/trac10/ticket/4657#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Matthias Troyer</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket inform@… Thu, 04 Nov 2010 02:30:28 GMT <link>https://svn.boost.org/trac10/ticket/4657#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:3</guid> <description> <p> <a class="ext-link" href="http://docs.python.org/py3k/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python"><span class="icon">​</span>http://docs.python.org/py3k/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python</a> </p> <p> Andreas </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 04 Nov 2010 07:09:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:4</guid> <description> <p> Thanks! The only issue I see here is that they require that "PSF’s License Agreement " is retained, while we want to publish it under the Boost license. Do you know the authors of that piece of code so that we can ask them whether we can use it here? Otherwise we'll have to reimplement a similar idea but can't just copy&amp;paste. </p> </description> <category>Ticket</category> </item> <item> <author>inform@…</author> <pubDate>Thu, 04 Nov 2010 17:46:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:5</guid> <description> <p> Well, I think we can consider the patch a reimplementation, since I had to change their UCS handling functions to codecvt. I don't think it's likely that the Python guys will come suing us over this. </p> <p> Andreas </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 04 Nov 2010 20:54:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:6</guid> <description> <p> Thanks for the clarification. </p> </description> <category>Ticket</category> </item> <item> <author>Tim Dawborn <tim.dawborn@…></author> <pubDate>Mon, 09 May 2011 00:07:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:7</guid> <description> <p> This problem still exists in 1.46.1. Is there any chance of getting this patch pushed through into trunk? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 04 Dec 2011 05:58:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:8</guid> <description> <p> This problem still exists in 1.48.0 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 03 Jan 2012 17:28:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:9</guid> <description> <p> Can you test whether the trunk works for you? </p> </description> <category>Ticket</category> </item> <item> <author>smr@…</author> <pubDate>Wed, 04 Jan 2012 03:03:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:10</guid> <description> <p> I can confirm the trunk now works: I built against python 3.2. Thanks, -Steve </p> </description> <category>Ticket</category> </item> <item> <author>smr@…</author> <pubDate>Wed, 01 Feb 2012 03:59:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:11</guid> <description> <p> Can this be pushed to release, please? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 05 Feb 2012 10:54:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4657#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:12</guid> <description> <p> The attached patch (as well as <a class="changeset" href="https://svn.boost.org/trac10/changeset/76290" title="Applied patch for #4657">r76290</a>) seems to introduce memory leak in argv conversion code. When you return false from the loop in <code>bool mpi_init(list python_argv, bool abort_on_exception)</code>, memory allocated for argv_copy and argv_copy2 is not freed. </p> <p> Also, the following code returns 1 in case of error, which is converted to true (because function is returning boolean): </p> <div class="wiki-code"><div class="code"><pre><span class="k">if</span> <span class="p">(</span><span class="n">myresult</span> <span class="o">!=</span> <span class="n">std</span><span class="o">::</span><span class="n">codecvt</span><span class="o">&lt;</span><span class="kt">wchar_t</span><span class="p">,</span><span class="kt">char</span><span class="p">,</span><span class="kt">mbstate_t</span><span class="o">&gt;::</span><span class="n">ok</span> <span class="p">)</span> <span class="p">{</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">&quot;failure translating argv</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span> <span class="p">}</span> </pre></div></div> </description> <category>Ticket</category> </item> <item> <author>Ivan A. Melnikov <iv@…></author> <pubDate>Sun, 05 Feb 2012 10:54:46 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/4657#comment:13 https://svn.boost.org/trac10/ticket/4657#comment:13 <ul> <li><strong>cc</strong> <span class="trac-author">iv@…</span> added </li> </ul> Ticket anonymous Tue, 03 Dec 2013 09:18:26 GMT <link>https://svn.boost.org/trac10/ticket/4657#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4657#comment:14</guid> <description> <p> Still broken in 1.54 with Python 3.3.3. </p> </description> <category>Ticket</category> </item> </channel> </rss>