Boost C++ Libraries: Ticket #986: Problem building Python modules on boost 1.34.0 https://svn.boost.org/trac10/ticket/986 <p> When trying to build a Python module from the Tutorial quickstart from libs\python\example\quickstart , I ran "bjam --toolset=gcc release" using mingw under WindowsXP. The following error happens: </p> <p> C:\Carlos\Apps\boost_1_34_0\libs\python\example\quickstart&gt;bjam --toolset=gcc release Jamroot:17: in modules.load rule python-extension unknown in module Jamfile&lt;/C:/Carlos/Apps/boost_1_34_0/lib s/python/example/quickstart&gt;. C:/Carlos/Apps/boost_1_34_0/tools/build/v2/build\project.jam:312: in load-jamfil e C:/Carlos/Apps/boost_1_34_0/tools/build/v2/build\project.jam:68: in load C:/Carlos/Apps/boost_1_34_0/tools/build/v2/build\project.jam:170: in project.fin d C:/Carlos/Apps/boost_1_34_0/tools/build/v2\build-system.jam:237: in load C:\Carlos\Apps\boost_1_34_0\libs\python\example\quickstart\..\..\..\..\tools\bui ld\v2/kernel\modules.jam:261: in import C:\Carlos\Apps\boost_1_34_0\libs\python\example\quickstart\..\..\..\..\tools\bui ld\v2/kernel/bootstrap.jam:132: in boost-build C:\Carlos\Apps\boost_1_34_0\libs\python\example\quickstart\boost-build.jam:7: in </p> <blockquote> <p> module scope </p> </blockquote> <p> The problem is in: rule python-extension unknown in module Jamfile. </p> <p> After talking to some people on #boost, I changed the file: </p> <p> tools/build/v2/user-config.jam </p> <p> and added: using python ; </p> <p> After this, the module compiles correctly. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/986 Trac 1.4.3 René Rivera Wed, 30 May 2007 00:09:46 GMT <link>https://svn.boost.org/trac10/ticket/986#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/986#comment:1</guid> <description> <p> Info from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1005" title="#1005: Bugs: Unable to compile Python example, tutorial, or quickstart with Boost 1_34_0 (closed: duplicate)">#1005</a> duplicate: </p> <p> When trying to compile Boost Python examples I received the following errors on a Mac using toolset=darwin and on a PC using toolset=msvc-8_0. </p> <p> rule python-extension unknown in module Jamfile&lt;/Users/arthurcoleman/Boost/boost_1_34_0/libs/python/example&gt;. /Users/arthurcoleman/Boost/boost_1_34_0/tools/build/v2/build/project.jam:312: in load-jamfile /Users/arthurcoleman/Boost/boost_1_34_0/tools/build/v2/build/project.jam:68: in load /Users/arthurcoleman/Boost/boost_1_34_0/tools/build/v2/build/project.jam:170: in project.find /Users/arthurcoleman/Boost/boost_1_34_0/tools/build/v2/build-system.jam:237: in load /Users/arthurcoleman/Boost/boost_1_34_0/libs/python/example/../../../tools/build/v2/kernel/modules.jam:261: in import /Users/arthurcoleman/Boost/boost_1_34_0/libs/python/example/../../../tools/build/v2/kernel/bootstrap.jam:132: in boost-build /Users/arthurcoleman/Boost/boost_1_34_0/libs/python/example/boost-build.jam:7: in module scope </p> <p> After adding import python ; per a suggestion from Dave Abrahams I was successfully able to compile all the examples on my Mac. I will test on Tuesday to confirm that it also fixes the problems I had on a PC. I am submitting this ticket per a request from Dave. </p> <p> Arhtur </p> </description> <category>Ticket</category> </item> <item> <dc:creator>René Rivera</dc:creator> <pubDate>Wed, 30 May 2007 00:13:48 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/986 https://svn.boost.org/trac10/ticket/986 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Jamroot.patch</span> </li> </ul> <p> Add "import python ;" to quickstart/Jamroot </p> Ticket René Rivera Wed, 30 May 2007 00:20:42 GMT <link>https://svn.boost.org/trac10/ticket/986#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/986#comment:2</guid> <description> <p> The attached patch "fixes" the Boost.Build errors. But it still doesn't work in my case. Without a <code>user-config.jam</code>, and mscv-8.0, and gcc-3.4.5(mingw) I get (in that order): </p> <pre class="wiki">$ bjam --toolset=msvc ...patience... ...found 1153 targets... ...updating 7 targets... msvc.link.dll bin\msvc-8.0\debug\threading-multi\extending.pyd bin\msvc-8.0\debug\threading-multi\extending.lib LINK : fatal error LNK1104: cannot open file 'boost_python-vc80-mt-gd-1_34.lib' call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 &gt;nul link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /subsystem:console /out:"bin\msvc-8.0\debug\threading-multi\extending.pyd" /IMPLIB:"bin\msvc-8.0\debug\threading-multi\extending.lib" /LIBPATH:"c:\Python24\libs" @"bin\msvc-8.0\debug\threading-multi\extending.pyd.rsp" if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% if exist "bin\msvc-8.0\debug\threading-multi\extending.pyd.manifest" ( mt -nologo -manifest "bin\msvc-8.0\debug\threading-multi\extending.pyd.manifest" "-outputresource:bin\msvc-8.0\debug\threading-multi\extending.pyd;2" ) ...failed msvc.link.dll bin\msvc-8.0\debug\threading-multi\extending.pyd bin\msvc-8.0\debug\threading-multi\extending.lib... msvc.link bin\msvc-8.0\debug\threading-multi\embedding.exe LINK : fatal error LNK1104: cannot open file 'boost_python-vc80-mt-gd-1_34.lib' call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 &gt;nul link /NOLOGO /INCREMENTAL:NO /DEBUG /subsystem:console /out:"bin\msvc-8.0\debug\threading-multi\embedding.exe" /LIBPATH:"c:\Python24\libs" @"bin\msvc-8.0\debug\threading-multi\embedding.exe.rsp" if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% if exist "bin\msvc-8.0\debug\threading-multi\embedding.exe.manifest" ( mt -nologo -manifest "bin\msvc-8.0\debug\threading-multi\embedding.exe.manifest" "-outputresource:bin\msvc-8.0\debug\threading-multi\embedding.exe;1" ) ...failed msvc.link bin\msvc-8.0\debug\threading-multi\embedding.exe... ...skipped &lt;pbin\test_ext.test\msvc-8.0\debug\threading-multi&gt;test_ext for lack of &lt;pbin\msvc-8.0\debug\threading-multi&gt;extending.pyd... ...skipped &lt;pbin\test_embed.test\msvc-8.0\debug\threading-multi&gt;test_embed.run for lack of &lt;pbin\msvc-8.0\debug\threading-multi&gt;embedding.exe... ...failed updating 3 targets... ...skipped 4 targets... </pre><pre class="wiki">$ bjam --toolset=gcc gcc.link.dll ..\..\..\..\bin.v2\libs\python\build\gcc-mingw-3.4.5\debug\boost_python-mgw34-d-1_34_1.a ..\..\..\..\bin.v2\libs\python\build\gcc-mingw-3.4.5\debug\boost_python-mgw34-d-1_34_1.dll Creating library file: ..\..\..\..\bin.v2\libs\python\build\gcc-mingw-3.4.5\debug\boost_python-mgw34-d-1_34_1.a ..\..\..\..\bin.v2\libs\python\build\gcc-mingw-3.4.5\debug\numeric.o: In function `ZN5boost6python7numeric68_GLOBAL__N_.._.._.._.._libs_python_src_numeric.cpp_62998629_0651A16318throw_load_failureEv':c:/DevRoots/Boost/boost_1_34/libs/python/example/quickstart/../../../../libs/python/src/numeric.cpp:28: undefined reference to `_imp__PyExc_ImportError' ..\..\..\..\bin.v2\libs\python\build\gcc-mingw-3.4.5\debug\numeric.o: In function `ZN5boost6python7numeric68_GLOBAL__N_.._.._.._.._libs_python_src_numeric.cpp_62998629_0651A1634loadEb':c:/DevRoots/Boost/boost_1_34/libs/python/example/quickstart/../../../../libs/python/src/numeric.cpp:56: undefined reference to `_imp__PyType_Type' [[[--- And many more of the same flavor ---]]] </pre><p> And the behavior doesn't change if I enable my <code>user-config.jam</code>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>René Rivera</dc:creator> <pubDate>Thu, 31 May 2007 22:41:13 GMT</pubDate> <title>cc, status changed; resolution set https://svn.boost.org/trac10/ticket/986#comment:3 https://svn.boost.org/trac10/ticket/986#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">Thomas Witt</span> added </li> <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> Fixed with this change &lt;<a class="ext-link" href="http://boost.cvs.sourceforge.net/boost/boost/boost/version.hpp?r1=1.15.2.1&amp;r2=1.15.2.2"><span class="icon">​</span>http://boost.cvs.sourceforge.net/boost/boost/boost/version.hpp?r1=1.15.2.1&amp;r2=1.15.2.2</a>&gt;. </p> Ticket anonymous Wed, 06 Jun 2007 09:42:00 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/986#comment:4 https://svn.boost.org/trac10/ticket/986#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> I also get: </p> <p> msvc.link.dll bin\msvc-8.0\debug\threading-multi\extending.pyd bin\msvc-8.0\debug\threading-multi\extending.lib LINK : fatal error LNK1104: cannot open file 'boost_python-vc80-mt-gd-1_34.lib' </p> <p> even after applying the change to version.hpp, but in that case it complains about not being to open file boost_python-vc80-mt-gd-1_34_1.lib </p> Ticket René Rivera Wed, 06 Jun 2007 14:37:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/986#comment:5 https://svn.boost.org/trac10/ticket/986#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/986#comment:4" title="Comment 4">anonymous</a>: </p> <blockquote class="citation"> <p> I also get: </p> <p> msvc.link.dll bin\msvc-8.0\debug\threading-multi\extending.pyd bin\msvc-8.0\debug\threading-multi\extending.lib LINK : fatal error LNK1104: cannot open file 'boost_python-vc80-mt-gd-1_34.lib' </p> <p> even after applying the change to version.hpp, but in that case it complains about not being to open file boost_python-vc80-mt-gd-1_34_1.lib </p> </blockquote> <p> It would help if you log in when poking Trac, since I'm going to assume you did something incorrect. The version.hpp bug fix is *only* for the CVS RC_1_34_0 version, it has nothing to do with the released 1.34.0 version. So the version.hpp fix would break the 1.34.0 archive if you apply it. </p> Ticket Sung-Jin Hong <serialx.net@…> Wed, 01 Aug 2007 10:12:15 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/986#comment:6 https://svn.boost.org/trac10/ticket/986#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> This bug is still open, I have these bugs too. </p> <p> I have solved it by copying boost_python-vc80-mt-gd-1_34_1.lib to the c:\python25\libs directory (since jam calls LINKer with that path included as lib path) </p> <p> It is certainly a problem and it should be fixed. </p> Ticket Sung-Jin Hong <serialx.net@…> Wed, 01 Aug 2007 10:14:54 GMT <link>https://svn.boost.org/trac10/ticket/986#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/986#comment:7</guid> <description> <p> Here's one of the errors. I've also added 'using python ;' statement to the user-config.jam, otherwise it won't even compile. </p> <p> Using MSVC 8, Windows XP (Korean), Boost 1.34.1 </p> <pre class="wiki">msvc.link.dll bin\msvc-8.0\debug\std_pair_ext.pyd bin\msvc-8.0\debug\std_pair_ex t.lib LINK : fatal error LNK1104: 'boost_python-vc80-mt-gd-1_34_1.lib' Cannot open file. call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 &gt; nul link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /subsystem:console /out:"bin\msvc-8.0\d ebug\std_pair_ext.pyd" /IMPLIB:"bin\msvc-8.0\debug\std_pair_ext.lib" /LIBPATH:"C :\Python25\libs" @"bin\msvc-8.0\debug\std_pair_ext.pyd.rsp" if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% if exist "bin\msvc-8.0\debug\std_pair_ext.pyd.manifest" ( mt -nologo -manifest "bin\msvc-8.0\debug\std_pair_ext.pyd.manifest" "-outputresource:bin\msvc-8.0\debug\std_pair_ext.pyd;2" ) ...failed msvc.link.dll bin\msvc-8.0\debug\std_pair_ext.pyd bin\msvc-8.0\debug\s td_pair_ext.lib... </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>René Rivera</dc:creator> <pubDate>Sat, 18 Aug 2007 15:18:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/986#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/986#comment:8</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/986#comment:7" title="Comment 7">Sung-Jin Hong &lt;serialx.net@gmail.com&gt;</a>: </p> <blockquote class="citation"> <p> Here's one of the errors. I've also added 'using python ;' statement to the user-config.jam, otherwise it won't even compile. </p> <p> Using MSVC 8, Windows XP (Korean), Boost 1.34.1 </p> <pre class="wiki">msvc.link.dll bin\msvc-8.0\debug\std_pair_ext.pyd bin\msvc-8.0\debug\std_pair_ex t.lib </pre></blockquote> <p> Sung-Jin, </p> <p> What commands did you run that you are having problems with? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Tue, 04 Sep 2007 13:56:29 GMT</pubDate> <title>status changed; owner set https://svn.boost.org/trac10/ticket/986#comment:9 https://svn.boost.org/trac10/ticket/986#comment:9 <ul> <li><strong>owner</strong> set to <span class="trac-author">René Rivera</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket weck <trueweck@…> Tue, 18 Sep 2007 07:57:39 GMT <link>https://svn.boost.org/trac10/ticket/986#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/986#comment:10</guid> <description> <p> I encounter such a problem too, by add 'using msvc : 8.0 ;' into user-config.jam, the problem can be resolved. Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/986#comment:7" title="Comment 7">Sung-Jin Hong &lt;serialx.net@gmail.com&gt;</a>: </p> <blockquote class="citation"> <p> Here's one of the errors. I've also added 'using python ;' statement to the user-config.jam, otherwise it won't even compile. </p> <p> Using MSVC 8, Windows XP (Korean), Boost 1.34.1 </p> <pre class="wiki">msvc.link.dll bin\msvc-8.0\debug\std_pair_ext.pyd bin\msvc-8.0\debug\std_pair_ex t.lib LINK : fatal error LNK1104: 'boost_python-vc80-mt-gd-1_34_1.lib' Cannot open file. call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 &gt; nul link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /subsystem:console /out:"bin\msvc-8.0\d ebug\std_pair_ext.pyd" /IMPLIB:"bin\msvc-8.0\debug\std_pair_ext.lib" /LIBPATH:"C :\Python25\libs" @"bin\msvc-8.0\debug\std_pair_ext.pyd.rsp" if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% if exist "bin\msvc-8.0\debug\std_pair_ext.pyd.manifest" ( mt -nologo -manifest "bin\msvc-8.0\debug\std_pair_ext.pyd.manifest" "-outputresource:bin\msvc-8.0\debug\std_pair_ext.pyd;2" ) ...failed msvc.link.dll bin\msvc-8.0\debug\std_pair_ext.pyd bin\msvc-8.0\debug\s td_pair_ext.lib... </pre></blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 01 Nov 2007 17:03:37 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/986#comment:11 https://svn.boost.org/trac10/ticket/986#comment:11 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.34.1</span> → <span class="trac-field-new">Boost 1.35.0</span> </li> </ul> Ticket Marshall Clow Sat, 12 Jun 2010 17:35:05 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/986#comment:12 https://svn.boost.org/trac10/ticket/986#comment:12 <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> It appears Dave added the 'using python ;' to the Jamroot in revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/40714" title=" Merging some of the more obvious changes from RC_1_34_0 ">[40714]</a> (back in 2007), but never closed this bug. If anyone is still having this problem, please reopen it. </p> Ticket