Andrea,

I had issues many years ago getting boost to build on windows with zlib & bzip support. I wrote up the problems I had an the solution I found at the time at stackoverflow (http://stackoverflow.com/questions/4589935/boost-iostreams-with-bzip2-built-from-source-on-windows). I'm not sure if this is still relevant, as a former coworker told me that my instructions no longer worked on newer versions, but I was given no detail, but maybe it could give you a starting point on how to get it to work.

Regards,
Nate

On Thu, Jan 5, 2017 at 5:48 AM, Andrea Bocci <andrea.bocci@cern.ch> wrote:
Hi,
I'm trying to build custom binaries for boost 1.63 using zlib and bzip2 from a local installation rather than the system ones, following the instructions at

http://www.boost.org/doc/libs/1_63_0/more/getting_started/unix-variants.html#or-build-custom-binaries

and

http://www.boost.org/doc/libs/1_63_0/libs/iostreams/doc/installation.html

but it looks like the build system does not like having the zlib and bzip2 libraries in different folders.

Here's what I'm doing to set up the build environment:

# create a common directory for zlib and bzip2
mkdir common

# build zlib
wget http://downloads.sourceforge.net/project/libpng/zlib/1.2.10/zlib-1.2.10.tar.xz
tar xaf zlib-1.2.10.tar.xz
cd zlib-1.2.10/
./configure
make test
make install prefix=../common
cd ..

# build bzip2
wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xaf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6/
make -f Makefile-libbz2_so
make test
make install PREFIX=../common
cp -ar libbz2.so.* ../common/lib/
cd ..

# build boost
wget https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2
tar xaf boost_1_63_0.tar.bz2
cd boost_1_63_0/

mkdir boost-build
cd tools/build/
./bootstrap.sh gcc
./b2 install --prefix=../../boost-build
cd ../../
export PATH=$PWD/boost-build/bin:$PATH


Now, if I tell boost to pick zlib and bzip2 from the common directory with

b2 -q \
   -d+2 \
   --build-dir=build \
   --stage-dir=stage \
   --disable-icu \
   --without-atomic \
   --without-chrono \
   --without-container \
   --without-context \
   --without-coroutine \
   --without-exception \
   --without-graph \
   --without-graph_parallel \
   --without-locale \
   --without-log \
   --without-math \
   --without-mpi \
   --without-random \
   --without-wave \
   toolset=gcc \
   link=shared \
   threading=multi \
   variant=release \
   cxxflags="-std=c++11 -O2" \
   -sBZIP2_INCLUDE=../common/include \
   -sBZIP2_LIBPATH=../common/lib \
   -sZLIB_INCLUDE=../common/include \
   -sZLIB_LIBPATH=../common/lib \
   stage


it works just fine.

However, if I try to build boost using two separate directories for bip2 and zlib, with

b2 -q \
   -d+2 \
   --build-dir=build \
   --stage-dir=stage \
   --disable-icu \
   --without-atomic \
   --without-chrono \
   --without-container \
   --without-context \
   --without-coroutine \
   --without-exception \
   --without-graph \
   --without-graph_parallel \
   --without-locale \
   --without-log \
   --without-math \
   --without-mpi \
   --without-random \
   --without-wave \
   toolset=gcc \
   link=shared \
   threading=multi \
   variant=release \
   cxxflags="-std=c++11 -O2" \
   -sBZIP2_INCLUDE=../bzip2-1.0.6 \
   -sBZIP2_LIBPATH=../bzip2-1.0.6 \
   -sZLIB_INCLUDE=../zlib-1.2.10 \
   -sZLIB_LIBPATH=../zlib-1.2.10 \
   stage


the build fails with

Performing configuration checks

    - 32-bit                   : no
    - 64-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes
    - symlinks supported       : yes
    - C++11 mutex              : yes
    - Boost.Config Feature Check: cxx11_auto_declarations : yes
    - Boost.Config Feature Check: cxx11_constexpr : yes
    - Boost.Config Feature Check: cxx11_defaulted_functions : yes
    - Boost.Config Feature Check: cxx11_final : yes
    - Boost.Config Feature Check: cxx11_hdr_mutex : yes
    - Boost.Config Feature Check: cxx11_hdr_tuple : yes
    - Boost.Config Feature Check: cxx11_lambdas : yes
    - Boost.Config Feature Check: cxx11_noexcept : yes
    - Boost.Config Feature Check: cxx11_nullptr : yes
    - Boost.Config Feature Check: cxx11_rvalue_references : yes
    - Boost.Config Feature Check: cxx11_template_aliases : yes
    - Boost.Config Feature Check: cxx11_thread_local : yes
    - Boost.Config Feature Check: cxx11_variadic_templates : yes
    - zlib                     : yes
error: at /home/fwyzard/src/boost/boost_1_63_0/tools/build/src/kernel/modules.jam:107
error: Name clash for '<pbuild/boost/bin.v2/standalone/ac/gcc-5.4.1/release/threading-multi>main.o'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error:     -  <dll-path>../zlib-1.2.10 <library-path>../zlib-1.2.10 <xdll-path>../zlib-1.2.10
error:     -  <dll-path>../bzip2-1.0.6 <library-path>../bzip2-1.0.6 <xdll-path>../bzip2-1.0.6
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.



I get a similar error if I specify only one of bzip and bzip2.
For example

Now, if I tell boost to pick zlib and bzip2 from the common directory with

b2 -q \
   -d+2 \
   --build-dir=build \
   --stage-dir=stage \
   --disable-icu \
   --without-atomic \
   --without-chrono \
   --without-container \
   --without-context \
   --without-coroutine \
   --without-exception \
   --without-graph \
   --without-graph_parallel \
   --without-locale \
   --without-log \
   --without-math \
   --without-mpi \
   --without-random \
   --without-wave \
   toolset=gcc \
   link=shared \
   threading=multi \
   variant=release \
   cxxflags="-std=c++11 -O2" \
   -sZLIB_INCLUDE=../common/include \
   -sZLIB_LIBPATH=../common/lib \
   stage


results in

Performing configuration checks

    - 32-bit                   : no
    - 64-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes
    - symlinks supported       : yes
    - C++11 mutex              : yes
    - Boost.Config Feature Check: cxx11_auto_declarations : yes
    - Boost.Config Feature Check: cxx11_constexpr : yes
    - Boost.Config Feature Check: cxx11_defaulted_functions : yes
    - Boost.Config Feature Check: cxx11_final : yes
    - Boost.Config Feature Check: cxx11_hdr_mutex : yes
    - Boost.Config Feature Check: cxx11_hdr_tuple : yes
    - Boost.Config Feature Check: cxx11_lambdas : yes
    - Boost.Config Feature Check: cxx11_noexcept : yes
    - Boost.Config Feature Check: cxx11_nullptr : yes
    - Boost.Config Feature Check: cxx11_rvalue_references : yes
    - Boost.Config Feature Check: cxx11_template_aliases : yes
    - Boost.Config Feature Check: cxx11_thread_local : yes
    - Boost.Config Feature Check: cxx11_variadic_templates : yes
    - zlib                     : yes
error: at /home/fwyzard/src/boost/boost_1_63_0/tools/build/src/kernel/modules.jam:107
error: Name clash for '<pbuild/boost/bin.v2/standalone/ac/gcc-5.4.1/release/threading-multi>main.o'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error:     -  <dll-path>../common/lib <library-path>../common/lib <xdll-path>../common/lib
error:     -  none
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.


As far as I can tell, this used to work with boost 1.57 - I haven't tried any version in between.

Anybody has any suggestions ?

Thank you,
.Andrea

--
Strategy is a system of expedients.

Generalfeldmarschall Helmuth Karl Bernhard Graf von Moltke

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users