Boost C++ Libraries: Ticket #9156: 1.54 broke NO_ZLIB=1 and NO_COMPRESSION=1 https://svn.boost.org/trac10/ticket/9156 <p> <a class="ext-link" href="https://github.com/boostorg/iostreams/commit/dfb1f61c26b77556a1cca0654d08847cf87d26ae"><span class="icon">​</span>https://github.com/boostorg/iostreams/commit/dfb1f61c26b77556a1cca0654d08847cf87d26ae</a> This commit broke the ability to build boost with without zlib. The following bjam succeeds if you remove these two lines added by this patch. Please fix for 1.55? </p> <pre class="wiki">+ [ ac.check-library /zlib//zlib : &lt;library&gt;/zlib//zlib + &lt;source&gt;zlib.cpp &lt;source&gt;gzip.cpp ] </pre><pre class="wiki">./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix=/home/ubuntu/out/staging/boost -j2 install Performing configuration checks - 32-bit : yes - arm : no - mips1 : no - power : no - sparc : no - x86 : yes - has_icu builds : no warning: Graph library does not contain MPI-based parallel components. note: to enable them, add "using mpi ;" to your user-config.jam error: at /home/ubuntu/build/boost_1_54_0/tools/build/v2/kernel/modules.jam:107 error: Unable to find file or target named error: '/zlib//zlib' error: referred to from project at error: 'libs/iostreams/build' error: could not resolve project reference '/zlib' </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9156 Trac 1.4.3 anonymous Thu, 14 Nov 2013 16:18:57 GMT <link>https://svn.boost.org/trac10/ticket/9156#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:1</guid> <description> <p> Same bug in 1.55.0 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 14 Nov 2013 16:20:58 GMT</pubDate> <title>version changed; keywords set https://svn.boost.org/trac10/ticket/9156#comment:2 https://svn.boost.org/trac10/ticket/9156#comment:2 <ul> <li><strong>keywords</strong> zlib iostreams /zlib/zlib added </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.54.0</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> Ticket Steven Watanabe Tue, 08 Apr 2014 01:46:57 GMT <link>https://svn.boost.org/trac10/ticket/9156#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:3</guid> <description> <p> If you don't have zlib installed, you can just remove NO_ZLIB. The autodetection of zlib is improved by this same commit. I will fix this, but it may not make it into 1.56. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 16 Sep 2014 10:45:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:4</guid> <description> <p> We also observed this problem when switching to Boost 1.56 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 03 Nov 2014 17:04:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:5</guid> <description> <p> On Boost 1.56 (current release), building without NO_ZLIB also fails if zlib is not available. </p> <p> It appears to me it is impossible to build iostreams without zlib support as it is. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 11 Nov 2014 05:39:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:6</guid> <description> <p> Same problem observed with building Boost 1.57 with NO_COMPRESSION or NO_ZLIB. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 20 Nov 2014 15:13:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:7</guid> <description> <p> Boost 1.57 works for me if I remove the NO_ZLIB flag and let it autodetect (lack of) zlib. </p> <p> I still consider it a bug that explicitly passing NO_ZLIB breaks the build, though. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 14 Jan 2015 14:22:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:8</guid> <description> <p> Under Ubuntu 14.04.1 LTS, this is the output of trying to build Boost 1.57 iostreams without zlib and WITHOUT specifying NO_COMPRESSION or NO_ZLIB: </p> <pre class="wiki">Performing configuration checks - zlib : no (cached) - zlib : no (cached) Component configuration: - atomic : not building - chrono : not building - container : not building - context : not building - coroutine : not building - date_time : not building - exception : not building - filesystem : not building - graph : not building - graph_parallel : not building - iostreams : building - locale : not building - log : not building - math : not building - mpi : not building - program_options : not building - python : not building - random : not building - regex : not building - serialization : not building - signals : not building - system : not building - test : not building - thread : not building - timer : not building - wave : not building ...patience... ...found 22554 targets... ...updating 8 targets... gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi/bzip2.o libs/iostreams/src/bzip2.cpp:20:56: fatal error: bzlib.h: No such file or directory #include "bzlib.h" // Julian Seward's "bzip.h" header. ^ compilation terminated. "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_IOSTREAMS_DYN_LINK=1 -DBOOST_IOSTREAMS_USE_DEPRECATED -DNDEBUG -I"." -c -o "bin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi/bzip2.o" "libs/iostreams/src/bzip2.cpp" ...failed gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi/bzip2.o... ...skipped &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi&gt;libboost_iostreams.so.1.57.0 for lack of &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi&gt;bzip2.o... ...skipped &lt;p~/projects/icam/tmp/boost_install/lib&gt;libboost_iostreams.so.1.57.0 for lack of &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi&gt;libboost_iostreams.so.1.57.0... ...skipped &lt;p~/projects/icam/tmp/boost_install/lib&gt;libboost_iostreams.so for lack of &lt;p~/projects/icam/tmp/boost_install/lib&gt;libboost_iostreams.so.1.57.0... gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi/bzip2.o libs/iostreams/src/bzip2.cpp:20:56: fatal error: bzlib.h: No such file or directory #include "bzlib.h" // Julian Seward's "bzip.h" header. ^ compilation terminated. "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -DBOOST_ALL_NO_LIB=1 -DBOOST_IOSTREAMS_USE_DEPRECATED -DNDEBUG -I"." -c -o "bin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi/bzip2.o" "libs/iostreams/src/bzip2.cpp" ...failed gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi/bzip2.o... ...skipped &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi&gt;libboost_iostreams.a(clean) for lack of &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi&gt;bzip2.o... ...skipped &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi&gt;libboost_iostreams.a for lack of &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi&gt;bzip2.o... ...skipped &lt;p~/projects/icam/tmp/boost_install/lib&gt;libboost_iostreams.a for lack of &lt;pbin.v2/libs/iostreams/build/gcc-4.8/release/link-static/threading-multi&gt;libboost_iostreams.a... ...failed updating 2 targets... ...skipped 6 targets... </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sun, 01 Mar 2015 02:24:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:9</guid> <description> <p> The workaround is to allow autodetection for zlib but specify -sNO_BZIP2. I never got around to implementing auto-detection for bzip2. I'll fix the problems with NO_ZLIB tonight. </p> </description> <category>Ticket</category> </item> <item> <author>dd0t@…</author> <pubDate>Wed, 29 Apr 2015 22:41:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:10</guid> <description> <p> The very same commit you identified seems to also break manual configuration of an external zlib in boost 1.58.0 (and earlier I guess) as described by the documentation (<a href="http://www.boost.org/doc/libs/1_58_0/libs/iostreams/doc/installation.html">http://www.boost.org/doc/libs/1_58_0/libs/iostreams/doc/installation.html</a>). Setting ZLIB_BINARY, ZLIB_INCLUDE and ZLIB_LIBPATH previously allowed to specify an externally compiled version of zlib with custom binary name. These options seem to no longer have any effect on the build configuration resulting in zlib not being found and disabled. Looking at the jamfile it seems like the previously used create-library rule had all the handling for that while the new ac.check-library probably isn't even aware of these parameters. Reverting the changes to the Jam files allows using the custom zlib version again. </p> <p> Unless the auto-detection can be made aware of those configuration options I don't think it is a viable replacement. For my use-case the whole application and dependencies (including boost) are statically linked so I have to prevent trying to link multiple versions of it when zlib is used elsewhere. Also this external zlib has a non-standard name (libzlib.a under linux instead of libz.a). </p> <p> In any case the documentation doesn't seem to properly reflect the current library behavior. Or maybe I'm just completely misunderstanding it which is always possible. </p> </description> <category>Ticket</category> </item> <item> <author>dd0t@…</author> <pubDate>Wed, 29 Apr 2015 22:43:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:10</guid> <description> <p> The very same commit you identified seems to also break manual configuration of an external zlib in boost 1.58.0 (and earlier I guess) as described by the documentation (<a href="http://www.boost.org/doc/libs/1_58_0/libs/iostreams/doc/installation.html">http://www.boost.org/doc/libs/1_58_0/libs/iostreams/doc/installation.html</a>). Setting ZLIB_BINARY, ZLIB_INCLUDE and ZLIB_LIBPATH previously allowed to specify an externally compiled version of zlib with custom binary name. These options seem to no longer have any effect on the build configuration resulting in zlib not being found and disabled. Looking at the jamfile it seems like the previously used create-library rule had all the handling for that while the new ac.check-library probably isn't even aware of these parameters. Reverting the changes to the Jam files allows using the custom zlib version again. </p> <p> Unless the auto-detection can be made aware of those configuration options I don't think it is a viable replacement. For my use-case the whole application and dependencies (including boost) are statically linked so I have to prevent trying to link multiple versions of it when zlib is used elsewhere. Also this external zlib has a non-standard name (libzlib.a under linux instead of libz.a). </p> <p> In any case the documentation doesn't seem to properly reflect the current library behavior. Or maybe I'm just completely misunderstanding it which is always possible. </p> </description> <category>Ticket</category> </item> <item> <author>dave.lowell@…</author> <pubDate>Wed, 01 Jul 2015 20:06:19 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/9156#comment:11 https://svn.boost.org/trac10/ticket/9156#comment:11 <ul> <li><strong>cc</strong> <span class="trac-author">dave.lowell@…</span> added </li> </ul> Ticket anonymous Mon, 12 Oct 2015 16:33:34 GMT <link>https://svn.boost.org/trac10/ticket/9156#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:12</guid> <description> <p> Hello, what is the status of this issue? </p> <p> I am using boost 1.59. I supply ZLIB_INCLUDE &amp; ZLIB_LIBPATH, but not ZLIB_SOURCE (along with -s NO_COMPRESSION=0 -s NO_ZLIB=0 -s NO_BZIP2=1). I see the following in the build log. </p> <pre class="wiki">notice: [zlib] Using pre-installed library notice: [zlib] Condition notice: iostreams: not using bzip2 compression notice: iostreams: not using bzip2 compression </pre><p> </p> <p> But in the end, there is no libboost_zlib library being produced. There is also no obvious error message. </p> <p> Thanks, </p> <p> Qingning </p> </description> <category>Ticket</category> </item> <item> <author>Daniel.Kruegler@…</author> <pubDate>Fri, 18 Dec 2015 07:24:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:13</guid> <description> <p> We noticed the same problem while building Boost 1.60 with NO_COMPRESSION, NO_ZLIB, and NO_BZIP2 using toolset gcc on linux. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel.S</dc:creator> <pubDate>Tue, 21 Jun 2016 08:23:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:14</guid> <description> <p> Still broken in 1.61. Hoping for 1.62 ... </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Tue, 21 Jun 2016 08:55:54 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/9156#comment:15 https://svn.boost.org/trac10/ticket/9156#comment:15 <ul> <li><strong>cc</strong> <span class="trac-author">raad@…</span> added </li> </ul> Ticket raad@… Tue, 21 Jun 2016 09:03:39 GMT <link>https://svn.boost.org/trac10/ticket/9156#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:16</guid> <description> <p> This has been fixed here: <a class="ext-link" href="https://github.com/boostorg/iostreams/commit/95515196ce2bed1a06067fc9bbfbed39337d74e2"><span class="icon">​</span>https://github.com/boostorg/iostreams/commit/95515196ce2bed1a06067fc9bbfbed39337d74e2</a> But unfortunately never been merged to master. </p> </description> <category>Ticket</category> </item> <item> <author>blf_sn@…</author> <pubDate>Tue, 31 Jan 2017 10:02:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9156#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9156#comment:17</guid> <description> <p> This resolve my issue (boost-1.57..0) ./b2 --with-iostreams -s ZLIB_INCLUDE=/home/user/build/zlib-1.2.8 -s ZLIB_LIBPATH=/home/user/build/zlib-1.2.8 s ZLIB_SOURCE=home/user/build/zlib-1.2.8 </p> </description> <category>Ticket</category> </item> </channel> </rss>