Boost logo

Boost-Build :

From: egoots_at_[hidden]
Date: 2022-05-06 17:15:05


In the past I have always built boost including iostreams with zlib
using environment variables to build from sources.

set ZLIB_INCLUDE=C:\Dev\zlib\zlib-1.2.12
set ZLIB_SOURCE=C:\Dev\zlib\zlib-1.2.12

and then running b2 using the following command (from within a Visual
Studio 2017 x64 Native Tools command prompt window (In this case I am
using Boost 1.79)

.\b2 -j6 link=static,shared threading=multi variant=debug,release
toolset=msvc-14.1 address-model=64 --without-python
--stagedir=stage_x64 > build64.log 2>&1

The above works.

Now, I want to build zstd as well. It does not seem to support a source
build according to the iostreams documents. Nor does it seem to support
using environment variables and indicates I should use a user-config.jam
file.

First I thought I would start by switching my zlib build to use
user-config so I tried:

using zlib : 1.2.12 : <source>C:/Dev/zlib/zlib-1.2.12 ;

I built with --debug-configuration, and it shows good progress at the start:

...
notice: Loading user-config configuration file 'user-config.jam' from
'C:/Users/Ed'.
notice: [zlib] Building zlib from source as z
notice: [zlib] Condition
notice: [zlib] found zlib source in /C:/Dev/zlib/zlib-1.2.12
...

Building the Boost libraries

...
     - WinDbg builds : yes [9]
     - WinDbg builds : yes [10]
     - WinDbgCached builds : yes [9]
     - BOOST_COMP_GNUC >= 4.3.0 : no [9]
     - cxx11_hdr_thread : yes [9]
     - cxx11_hdr_regex : yes [9]
error: Name clash for '<pC:\Dev\boost_1_79_0\stage_x64\lib>libz.lib'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error: - <debug-symbols>on <inlining>off <optimization>off
<runtime-debugging>on <variant>debug
error: - <debug-symbols>off <define>NDEBUG <inlining>full
<optimization>speed <runtime-debugging>off <variant>release
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.

How should the zlib libraries be specified in the user-config.jam file
in order to build correctly on Windows?

Ultimately, I want to also know how to build boost iostreams with zstd.
I downloaded the release 1.5.2 which including the include header zstd.h
in the include subfolder, the libzstd.lib and libzstd.dll.a (I was
expected a .lib file here) in the dll subfolder , as well as a static
lib file libzstd_static.lib in the static folder.

I attempted to used the following settings in the user-config.jam

using zstd : 1.5.2 : <include>C:/Dev/zstd/zstd-v1.5.2-win64/include
<search>C:/Dev/zstd/zstd-v1.5.2-win64/dll ;

Then rebuilt boost with the following output snippets

notice: Loading user-config configuration file 'user-config.jam' from
'C:/Users/Ed'.
notice: [zstd] Using pre-installed library
notice: [zstd] Condition

In the Building the boost libraries section

     - zstd : no [4]
     - zstd : no (cached) [4]
     - zstd : no
     - zstd : no (cached)

Boost builds successfully, but zstd does not appear to be built into it.

What should the user-config.jam file look like to build with zstd on
windows?


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk