Boost C++ Libraries: Ticket #4607: Build errors when Python installation is explicitly specified https://svn.boost.org/trac10/ticket/4607 <p> Attempts to build 32-bits target libraries/dll of Boost.Python with MSVC running under Windows 7 x64 ends with errors. The 6 *.lib &amp; *.dll of the form boost_python-vc*-mt* are not built. </p> <p> No problems is experienced if MSVC is running under 32-bits version of Windows (XP Pro SP3 &amp; 7 Ultimate tested), or the target is 64-bits libraries even when running under Win7 x64. </p> <p> The below errors was produced with Windows 7 Ultimate x64, Visual Studio (2008 Pro &amp; 2010 Ultimate tested), and <a class="missing wiki">ActiveState</a> <a class="missing wiki">ActivePython</a> (2.6 &amp; 2.7 tested). </p> <p> msvc.link.dll x86\boost\bin.v2\libs\python\build\msvc-10.0\debug\threading-multi\boost_python-vc100-mt-gd-1_44.dll </p> <blockquote> <p> Creating library x86\boost\bin.v2\libs\python\build\msvc-10.0\debug\threading-multi\boost_python-vc100-mt-gd-1_44.lib and object x86\boost\bin.v2\libs\python\build\msvc-10.0\debug\threading-multi\boost_python-vc100-mt-gd-1_44.exp </p> </blockquote> <p> function.obj : error LNK2001: unresolved external symbol <span class="underline">imp</span>PyErr_Format numeric.obj : error LNK2019: unresolved external symbol <span class="underline">imp</span>PyErr_Format referenced in function "void <span class="underline">cdecl boost::python::numeric::`anonymous namespace'::throw_load_failure(void)" (?throw_load_failure@?A0x9a30ad83@numeric@python@boost@@YAXXZ) from_python.obj : error LNK2001: unresolved external symbol </span>imp<span class="underline">PyErr_Format registry.obj : error LNK2001: unresolved external symbol </span>imp<span class="underline">PyErr_Format class.obj : error LNK2001: unresolved external symbol </span>imp<span class="underline">PyErr_Format numeric.obj : error LNK2001: unresolved external symbol </span>imp<span class="underline">PyExc_ImportError numeric.obj : error LNK2019: unresolved external symbol </span>imp<span class="underline">PyErr_Clear referenced in function "bool </span>cdecl boost::python::numeric::`anonymous namespace'::load(bool)" (?load@?A0x9a30ad83@numeric@python@boost@@YA_N_N@Z) class.obj : error LNK2001: unresolved external symbol <span class="underline">imp</span>PyErr_Clear &lt;snip&gt; </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4607 Trac 1.4.3 Katie Chan Sun, 29 Aug 2010 00:32:32 GMT attachment set https://svn.boost.org/trac10/ticket/4607 https://svn.boost.org/trac10/ticket/4607 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">python.log</span> </li> </ul> <p> Build log </p> Ticket rwebb <richard.webb@…> Sun, 29 Aug 2010 09:28:55 GMT <link>https://svn.boost.org/trac10/ticket/4607#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:1</guid> <description> <p> Are you using a 64bit version of Python? If so, the problem might be that you only have a 64bit version of python.lib, which 32bit libs can't link with. </p> <p> You can get similar problems if you try to build a 64bit version of Boost and only have a 32bit version of Python installed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Katie Chan</dc:creator> <pubDate>Mon, 30 Aug 2010 00:32:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4607#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:2</guid> <description> <p> Yeah, that appears to be the problem. However, a problem that arise now is if I explicitly specified a location for Python installation (because we now have multiple Python installations), then I can't do a `bjam --build-type=complete -j2 stage' to build everything with a single command. </p> <p> An error of "error: link=shared together with runtime-link=static is not allowed" pops up that doesn't otherwise arise if Python is not explicitly specified. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Mon, 30 Aug 2010 18:32:13 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/4607#comment:3 https://svn.boost.org/trac10/ticket/4607#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Dave Abrahams</span> to <span class="trac-author">Vladimir Prus</span> </li> <li><strong>component</strong> <span class="trac-field-old">Python</span> → <span class="trac-field-new">build</span> </li> </ul> <p> I <em>think</em> this should be considered a Boost.Build problem; if you disagree, Volodya, let's discuss it. </p> Ticket Vladimir Prus Wed, 01 Sep 2010 09:04:33 GMT <link>https://svn.boost.org/trac10/ticket/4607#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:4</guid> <description> <p> Could you please attach your user-config.jam, so that I can know exactly how you configure 32-bit Python? </p> <p> Thanks, Volodya </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Katie Chan</dc:creator> <pubDate>Wed, 01 Sep 2010 11:24:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4607#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:5</guid> <description> <p> Well it's usually in site-config.jam rather than user-config.jam, but the effect is the same. </p> <pre class="wiki"># user-config.jam using mpi ; </pre><pre class="wiki"># site-config.jam using python : 2.7 : C:/Python27-x86 ; using msvc : 10.0 : cl.exe : &lt;compileflags&gt;-D_SECURE_SCL=0 &lt;compileflags&gt;-D_CRT_NONSTDC_NO_DEPRECATE &lt;compileflags&gt;-D_CRT_SECURE_NO_WARNINGS &lt;compileflags&gt;-D_SCL_SECURE_NO_WARNINGS ; </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Wed, 01 Sep 2010 11:57:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4607#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:6</guid> <description> <p> Thanks. Can you then run bjam with a couple of extra options: </p> <blockquote> <p> --with-python --debug-building </p> </blockquote> <p> and attach the complete output as well? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Katie Chan</dc:creator> <pubDate>Wed, 01 Sep 2010 13:11:35 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4607 https://svn.boost.org/trac10/ticket/4607 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">build-log.7z</span> </li> </ul> <p> Debugging build log </p> Ticket Katie Chan Wed, 01 Sep 2010 13:16:49 GMT summary changed https://svn.boost.org/trac10/ticket/4607#comment:7 https://svn.boost.org/trac10/ticket/4607#comment:7 <ul> <li><strong>summary</strong> <span class="trac-field-old">32-bits target build errors with MSVC under Windows x64</span> → <span class="trac-field-new">Build errors when Python installation is explicitly specified</span> </li> </ul> <p> Well, the program doesn't occur when building python. It turns out to happens when specifying python installation explicitly when building mpi. The attached zip file contain explicit-mpi.log where python was specified explicitly, and implicit-mpi.log where it wasn't. </p> Ticket anonymous Wed, 01 Sep 2010 13:53:38 GMT attachment set https://svn.boost.org/trac10/ticket/4607 https://svn.boost.org/trac10/ticket/4607 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">mpi.diff</span> </li> </ul> <p> Possible fix </p> Ticket Vladimir Prus Wed, 01 Sep 2010 13:54:23 GMT <link>https://svn.boost.org/trac10/ticket/4607#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:8</guid> <description> <p> Could you try the attached patch? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Katie Chan</dc:creator> <pubDate>Wed, 01 Sep 2010 16:22:00 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4607 https://svn.boost.org/trac10/ticket/4607 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix1-build.log</span> </li> </ul> Ticket Katie Chan Wed, 01 Sep 2010 16:22:30 GMT <link>https://svn.boost.org/trac10/ticket/4607#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:9</guid> <description> <p> Nope, doesn't work. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 27 Sep 2010 16:34:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4607#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:10</guid> <description> <p> Are you sure you get exactly the same error? For me, if I apply the patch I get a different error -- specifically that Python's extension to support MPI (called mpi.so on my system) is being installed to stage/mpi.so twice -- once as release version and another as debug. That issue is relatively long-standing -- maintained of Boost.MPI have not, to my knowledge, decided whether only one variant should be installed, or whether some of the variants should be renamed. </p> <p> However, before we go there, can you confirm that the original error is gone, and you get a different one? If possible, please attach the text of the new message. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 27 Sep 2010 16:35:48 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4607#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4607#comment:11</guid> <description> <p> I have checked in the fix I've attached before in <a class="changeset" href="https://svn.boost.org/trac10/changeset/65639" title="Also force &lt;runtime-link&gt;shared for Python extension. If we're ...">r65639</a>. </p> </description> <category>Ticket</category> </item> </channel> </rss>