Boost C++ Libraries: Ticket #4866: Tests don't account for locally-built bzip2 library https://svn.boost.org/trac10/ticket/4866 <p> I am building the iostreams library with <code>-sBZIP2_SOURCE=c:/work/bzip2-1.0.6</code>, so the build system creates its own bzip2 library in <code>bin.v2/libs/iostreams/build/bzip2/.../threading-multi/boost_bzip2-vc100-mt-gd-1_44.dll</code>. However, when I try to run the tests through <code>bjam</code> from the command prompt, I see the tests fail. So I prepared the same environment used by the tests, and find myself facing a dialog that complains that it can't find <code>LIBBZ2.DLL</code>. It seems like Boost.Build is confused about the name of the DLL on which it depends. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4866 Trac 1.4.3 Vladimir Prus Wed, 17 Nov 2010 19:59:41 GMT <link>https://svn.boost.org/trac10/ticket/4866#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:1</guid> <description> <p> What is the exact commands that Boost.Build uses to try running the test that fails? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Thu, 18 Nov 2010 00:57:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4866#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4866#comment:1" title="Comment 1">vladimir_prus</a>: </p> <blockquote class="citation"> <p> What is the exact commands that Boost.Build uses to try running the test that fails? </p> </blockquote> <p> Please see attached log </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Thu, 18 Nov 2010 01:01:12 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4866 https://svn.boost.org/trac10/ticket/4866 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.log.bz2</span> </li> </ul> <p> Output of testing command </p> Ticket Vladimir Prus Tue, 23 Nov 2010 07:43:18 GMT <link>https://svn.boost.org/trac10/ticket/4866#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:3</guid> <description> <p> In your log, I see a single failed target -- which is part of config check and does not affect iostream tests. Am I missing something? </p> <p> I note that command has: set Path=c:\work\build\boost\bin.v2\libs\iostreams\build\bzip2\msvc-10.0\debug; </p> <p> so it should catch locally-build zlib library. If you consistently get an error, can you use depends.exe to see what the test executable claims to depend on? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 27 Nov 2010 19:11:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4866#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:4</guid> <description> <p> I think you're missing my point. The actual DLL built is <code>boost_bzip2-vc100-mt-gd-1_44.dll</code> but the DLL being sought is <code>LIBBZ2.DLL</code>. Even if the former *were* in the path, it wouldn't work, right? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 29 Nov 2010 07:18:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4866#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:5</guid> <description> <p> Oh, this particular error is not likely to be caused by Boost.Build. Looking at your log, the bzip2_test executable is linked against boost_iostreams-vc100-gd-1_44.lib, and is not linked against bzip2 implementation. boost_iostreams-vc100-gd-1_44.dll, in turn, is linked against boost_bzip2-vc100-gd-1_44.lib. So, things look just fine. </p> <p> There are two reasons why dependency on libbz2 can be added. First, it's via c:\work\bzip2-1.0.6\libbz2.def. Can you check whether that file has anything suspicious, or attach it here? Second possible reason is autolink code in iostreams/detail/config/bzip2.hpp. Can you remove #pragma comment(lib, ...) there and do full rebuild ('bjam -a') and see if that improves things? </p> </description> <category>Ticket</category> </item> <item> <author>Leo Carreon <lcarreon@…></author> <pubDate>Mon, 12 Dec 2011 21:54:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4866#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:6</guid> <description> <p> Hi, </p> <p> I have encountered the same problem in Boost 1.47.0 and suspect the same problem is still present in Boost 1.48.0. With the help of dumpbin.exe, I have discovered that the import library boost_bzip2-vc100-mt-1_47.lib points to libbz2.dll instead of boost_bzip2-vc100-mt-1_47.dll. Currently, the work-around is to copy boost_bzip2-vc100-mt-1_47.dll to libbz2.dll. </p> <p> I have tried looking into the JAM files to find out why the import library is pointing to the wrong DLL name to no avail because I'm such a newbie with JAM files. I'm suspecting that the DLL and the import libraries were built using libbz2 as their names and then renamed to the Boost library naming convention thus the reason for the import library to be referring to the wrong DLL name. </p> <p> Does this make sense? </p> <p> The other thing that's confusing me is why the ZLIB library that is built together with the BZIP2 library is not exhibiting the same problem. This could disprove my theory about the renaming since the two libraries appear to be built from within the same JAM file. </p> <p> Kind regards, Leo </p> </description> <category>Ticket</category> </item> <item> <author>Leo Carreon <lcarreon@…></author> <pubDate>Mon, 12 Dec 2011 23:41:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4866#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:7</guid> <description> <p> Hi, </p> <p> I have just looked into my Boost 1.47.0 build logs and here is some clue as to why the above problem is happening. Below is an extract of the message I found in my Boost 1.47.0 build log: </p> <blockquote> <p> msvc.link.dll bin.v2\libs\iostreams\build\bzip2\msvc-10.0\release\address-model-32\threading-multi\boost_bzip2-vc100-mt-1_47.dll </p> </blockquote> <blockquote> <p> c:\bzip2-1.0.6\libbz2.def(2) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored Creating library bin.v2\libs\iostreams\build\bzip2\msvc-10.0\release\address-model-32\threading-multi\boost_bzip2-vc100-mt-1_47.lib and object bin.v2\libs\iostreams\build\bzip2\msvc-10.0\release\address-model-32\threading-multi\boost_bzip2-vc100-mt-1_47.exp </p> </blockquote> <blockquote> <p> boost_bzip2-vc100-mt-1_47.exp : warning LNK4070: /OUT:LIBBZ2.dll directive in .EXP differs from output filename 'bin.v2\libs\iostreams\build\bzip2\msvc-10.0\release\address-model-32\threading-multi\boost_bzip2-vc100-mt-1_47.dll'; ignoring directive </p> </blockquote> <p> It seems that the problem is due to a conflict in the contents of the BZIP2 .def file and the .exp file being used by the Boost build. </p> <p> I hope this information helps resolve this issue. </p> <p> Kind regards, </p> <p> Leo </p> </description> <category>Ticket</category> </item> <item> <author>Leo Carreon <lcarreon@…></author> <pubDate>Wed, 14 Dec 2011 02:09:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4866#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:8</guid> <description> <p> Hi, </p> <p> Just confirming that this issue also occurs in Boost 1.48.0. </p> <p> Kind regards, </p> <p> Leo </p> </description> <category>Ticket</category> </item> <item> <author>lcarreon@…</author> <pubDate>Sun, 26 May 2013 06:07:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4866#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4866#comment:9</guid> <description> <p> FYI, this issue is still occurring in Boost 1.53.0. </p> <p> Here is an extract of the messages generated by Boost Build that could explain why this issue is occurring: </p> <blockquote> <p> msvc.link.dll bin.v2\libs\iostreams\build\bzip2\msvc-11.0\release\address-model-32\threading-multi\boost_bzip2-vc110-mt-1_53.dll </p> </blockquote> <blockquote> <p> c:\bzip2-1.0.6\libbz2.def(2) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored </p> </blockquote> <blockquote> <p> Creating library bin.v2\libs\iostreams\build\bzip2\msvc-11.0\release\address-model-32\threading-multi\boost_bzip2-vc110-mt-1_53.lib and object bin.v2\libs\iostreams\build\bzip2\msvc-11.0\release\address-model-32\threading-multi\boost_bzip2-vc110-mt-1_53.exp </p> </blockquote> <blockquote> <p> boost_bzip2-vc110-mt-1_53.exp : warning LNK4070: /OUT:LIBBZ2.dll directive in .EXP differs from output filename 'bin.v2\libs\iostreams\build\bzip2\msvc-11.0\release\address-model-32\threading-multi\boost_bzip2-vc110-mt-1_53.dll'; ignoring directive </p> </blockquote> <blockquote> <p> msvc.manifest.dll bin.v2\libs\iostreams\build\bzip2\msvc-11.0\release\address-model-32\threading-multi\boost_bzip2-vc110-mt-1_53.dll </p> </blockquote> <p> The explanation of the linker message LNK4070 states that it is recommended to modify the .def file. Are we supposed to follow the recommendation before building Boost? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Wed, 12 Mar 2014 02:42:29 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4866 https://svn.boost.org/trac10/ticket/4866 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Jamfile.v2.patch</span> </li> </ul> <p> Patch to fix the problem </p> Ticket Steven Watanabe Wed, 12 Mar 2014 02:43:17 GMT owner, component changed https://svn.boost.org/trac10/ticket/4866#comment:10 https://svn.boost.org/trac10/ticket/4866#comment:10 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Vladimir Prus</span> to <span class="trac-author">Jonathan Turkanis</span> </li> <li><strong>component</strong> <span class="trac-field-old">build</span> → <span class="trac-field-new">iostreams</span> </li> </ul> Ticket