Discussion:
boost 1.63 fails to build with zlib and bzip2 in different directories
(too old to reply)
Andrea Bocci
2017-01-05 11:48:30 UTC
Permalink
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
Edward Diener
2017-01-05 17:34:18 UTC
Permalink
Post by Andrea Bocci
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.
# 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
Try removing the -sBZIP2... and -sZLIB... lines and adding to your
userconfig.jam:

using bzip2 : 1.0.6 : <include>full-path-to/bzip2-1.0.6
<search>full-path-to/bzip2-1.0.6 ;
using zlib : 1.2.10 : <include>full-path-to/zlib-1.2.10
<search>full-path-to/zlib-1.2.10 ;
Post by Andrea Bocci
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: Tried to build the target twice, with property sets having
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: 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: Tried to build the target twice, with property sets having
error: - <dll-path>../common/lib <library-path>../common/lib
<xdll-path>../common/lib
error: - none
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
Steven Watanabe
2017-01-05 17:42:32 UTC
Permalink
AMDG
Post by Edward Diener
Post by Andrea Bocci
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
<snip>
but it looks like the build system does not like having the zlib and
bzip2 libraries in different folders.
<snip>
Try removing the -sBZIP2... and -sZLIB... lines and adding to your
using bzip2 : 1.0.6 : <include>full-path-to/bzip2-1.0.6
<search>full-path-to/bzip2-1.0.6 ;
using zlib : 1.2.10 : <include>full-path-to/zlib-1.2.10
<search>full-path-to/zlib-1.2.10 ;
That will have the same problem. The bug
is at a pretty low level. It will trigger
regardless of how you specify the paths.

In Christ,
Steven Watanabe
Andrea Bocci
2017-01-05 18:13:15 UTC
Permalink
Post by Edward Diener
Try removing the -sBZIP2... and -sZLIB... lines and adding to your
using bzip2 : 1.0.6 : <include>full-path-to/bzip2-1.0.6
<search>full-path-to/bzip2-1.0.6 ;
using zlib : 1.2.10 : <include>full-path-to/zlib-1.2.10
<search>full-path-to/zlib-1.2.10 ;
That will have the same problem. The bug
is at a pretty low level. It will trigger
regardless of how you specify the paths.
Hi Edward, Steven,
indeed, replacing the -SBZIP2... and -sZLIB... lines with the suggested
entries in user-config.jam gives me the same problem.

In the meantime I've followed the problem down to
libs/iostreams/build/Jamfile.v2 - here is a simplified version of it that
causes the same error:

$ cat ~/user-config.jam
# local installation of bzip2
using bzip2 : 1.0.6 : <include>/home/fwyzard/src/boost/bzip2-1.0.6
<search>/home/fwyzard/src/boost/bzip2-1.0.6 ;

# local installation of zlib
using zlib : 1.2.10 : <include>/home/fwyzard/src/boost/zlib-1.2.10
<search>/home/fwyzard/src/boost/zlib-1.2.10 ;


$ cat Jamfile.v2
project /boost/iostreams : source-location ../src ;

local sources = file_descriptor.cpp mapped_file.cpp zlib.cpp gzip.cpp
bzip2.cpp ;

lib boost_iostreams
: $(sources)
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
<define>BOOST_IOSTREAMS_USE_DEPRECATED
<library>/zlib//zlib
<library>/bzip2//bzip2
:
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
;

boost-install boost_iostreams : bzip2-requirements ;


However, if I replace the library definitions with my own, it does work:

$ cat Jamfile.v2
project /boost/iostreams : source-location ../src ;

local sources = file_descriptor.cpp mapped_file.cpp zlib.cpp gzip.cpp
bzip2.cpp ;

lib zlib
:
: <name>z <include>/home/fwyzard/src/boost/common/include
<search>/home/fwyzard/src/boost/common/lib
;

lib bzip2
:
: <name>bz2 <include>/home/fwyzard/src/boost/common/include
<search>/home/fwyzard/src/boost/common/lib
;

lib boost_iostreams
: $(sources)
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
<define>BOOST_IOSTREAMS_USE_DEPRECATED
<library>/zlib//zlib
<library>/bzip2//bzip2
:
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
;

boost-install boost_iostreams : bzip2-requirements ;


So it seems to be a problem with the way tools/build/src/tools/bzip2.jam ,
tools/build/src/tools/zlib.jam , etc. are implemented ?

Is there a way to see what
<library>/zlib//zlib
<library>/bzip2//bzip2
expand to ?

Thank you,
.Andrea
--
Strategy is a system of expedients.

Generalfeldmarschall Helmuth Karl Bernhard Graf von Moltke
Andrea Bocci
2017-01-05 18:15:34 UTC
Permalink
Sorry, silly copy and paste error, the working jam file is obviously

$ cat Jamfile.v2
project /boost/iostreams : source-location ../src ;

local sources = file_descriptor.cpp mapped_file.cpp zlib.cpp gzip.cpp
bzip2.cpp ;

lib zlib
:
: <name>z <include>/home/fwyzard/src/boost/common/include
<search>/home/fwyzard/src/boost/common/lib
;

lib bzip2
:
: <name>bz2 <include>/home/fwyzard/src/boost/common/include
<search>/home/fwyzard/src/boost/common/lib
;

lib boost_iostreams
: $(sources)
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
<define>BOOST_IOSTREAMS_USE_DEPRECATED
<library>zlib
<library>bzip2
:
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
;

boost-install boost_iostreams : bzip2-requirements ;


Thank you,
.Andrea
Post by Andrea Bocci
Post by Edward Diener
Try removing the -sBZIP2... and -sZLIB... lines and adding to your
using bzip2 : 1.0.6 : <include>full-path-to/bzip2-1.0.6
<search>full-path-to/bzip2-1.0.6 ;
using zlib : 1.2.10 : <include>full-path-to/zlib-1.2.10
<search>full-path-to/zlib-1.2.10 ;
That will have the same problem. The bug
is at a pretty low level. It will trigger
regardless of how you specify the paths.
Hi Edward, Steven,
indeed, replacing the -SBZIP2... and -sZLIB... lines with the suggested
entries in user-config.jam gives me the same problem.
In the meantime I've followed the problem down to
libs/iostreams/build/Jamfile.v2 - here is a simplified version of it that
$ cat ~/user-config.jam
# local installation of bzip2
using bzip2 : 1.0.6 : <include>/home/fwyzard/src/boost/bzip2-1.0.6
<search>/home/fwyzard/src/boost/bzip2-1.0.6 ;
# local installation of zlib
using zlib : 1.2.10 : <include>/home/fwyzard/src/boost/zlib-1.2.10
<search>/home/fwyzard/src/boost/zlib-1.2.10 ;
$ cat Jamfile.v2
project /boost/iostreams : source-location ../src ;
local sources = file_descriptor.cpp mapped_file.cpp zlib.cpp gzip.cpp
bzip2.cpp ;
lib boost_iostreams
: $(sources)
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
<define>BOOST_IOSTREAMS_USE_DEPRECATED
<library>/zlib//zlib
<library>/bzip2//bzip2
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
;
boost-install boost_iostreams : bzip2-requirements ;
$ cat Jamfile.v2
project /boost/iostreams : source-location ../src ;
local sources = file_descriptor.cpp mapped_file.cpp zlib.cpp gzip.cpp
bzip2.cpp ;
lib zlib
: <name>z <include>/home/fwyzard/src/boost/common/include
<search>/home/fwyzard/src/boost/common/lib
;
lib bzip2
: <name>bz2 <include>/home/fwyzard/src/boost/common/include
<search>/home/fwyzard/src/boost/common/lib
;
lib boost_iostreams
: $(sources)
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
<define>BOOST_IOSTREAMS_USE_DEPRECATED
<library>/zlib//zlib
<library>/bzip2//bzip2
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
;
boost-install boost_iostreams : bzip2-requirements ;
So it seems to be a problem with the way tools/build/src/tools/bzip2.jam
, tools/build/src/tools/zlib.jam , etc. are implemented ?
Is there a way to see what
<library>/zlib//zlib
<library>/bzip2//bzip2
expand to ?
Thank you,
.Andrea
--
Strategy is a system of expedients.
Generalfeldmarschall Helmuth Karl Bernhard Graf von Moltke
--
Strategy is a system of expedients.

Generalfeldmarschall Helmuth Karl Bernhard Graf von Moltke
Andrea Bocci
2017-01-05 18:18:21 UTC
Permalink
And here is the working jam file using two separate locations:

$ cat Jamfile.v2
project /boost/iostreams : source-location ../src ;

local sources = file_descriptor.cpp mapped_file.cpp zlib.cpp gzip.cpp
bzip2.cpp ;

lib zlib
:
: <name>z <include>/home/fwyzard/src/boost/zlib-1.2.10
<search>/home/fwyzard/src/boost/zlib-1.2.10
;

lib bzip2
:
: <name>bz2 <include>/home/fwyzard/src/boost/bzip2-1.0.6
<search>/home/fwyzard/src/boost/bzip2-1.0.6
;

lib boost_iostreams
: $(sources)
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
<define>BOOST_IOSTREAMS_USE_DEPRECATED
<library>zlib
<library>bzip2
:
: <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
;

boost-install boost_iostreams : bzip2-requirements ;


.Andrea
--
Strategy is a system of expedients.

Generalfeldmarschall Helmuth Karl Bernhard Graf von Moltke
Edward Diener
2017-01-05 19:42:36 UTC
Permalink
Post by Steven Watanabe
AMDG
Post by Edward Diener
Post by Andrea Bocci
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
<snip>
but it looks like the build system does not like having the zlib and
bzip2 libraries in different folders.
<snip>
Try removing the -sBZIP2... and -sZLIB... lines and adding to your
using bzip2 : 1.0.6 : <include>full-path-to/bzip2-1.0.6
<search>full-path-to/bzip2-1.0.6 ;
using zlib : 1.2.10 : <include>full-path-to/zlib-1.2.10
<search>full-path-to/zlib-1.2.10 ;
That will have the same problem. The bug
is at a pretty low level. It will trigger
regardless of how you specify the paths.
Does that mean that the bug is a Boost Build bug ?

In my own user-config.jam on Windows I can specify:

using zlib : 1.2.8 : <source>E:/Utilities/zlib/zlib-1.2.8 ;
using bzip2 : 1.0.6 : <source>E:/Utilities/bzip2/bzip2-1.0.6 ;

in order to build from source and this does work. Does that mean that
the bug only occurs when specifying the already built binary include and
library paths as opposed to building from source ?

The iostream build was changed in the past by you and "loonycyborg",
whoever that is, to use a different way of handling zlib and bzip2. So I
think that you may know how this problem should be fixed, whether in the
iostreams build jamfile or in Boost Build.
Steven Watanabe
2017-01-05 20:15:48 UTC
Permalink
AMDG
Post by Edward Diener
Post by Andrea Bocci
<snip>
That will have the same problem. The bug
is at a pretty low level. It will trigger
regardless of how you specify the paths.
Does that mean that the bug is a Boost Build bug ?
Yes.
Post by Edward Diener
using zlib : 1.2.8 : <source>E:/Utilities/zlib/zlib-1.2.8 ;
using bzip2 : 1.0.6 : <source>E:/Utilities/bzip2/bzip2-1.0.6 ;
in order to build from source and this does work. Does that mean that
the bug only occurs when specifying the already built binary include and
library paths as opposed to building from source ?
That is correct. The bug is in the code that detects
whether the library is linkable. When building from
source, this is irrelevant.
Post by Edward Diener
The iostream build was changed in the past by you and "loonycyborg",
whoever that is, to use a different way of handling zlib and bzip2. So I
think that you may know how this problem should be fixed, whether in the
iostreams build jamfile or in Boost Build.
The bug is in build/ac.jam. Basically, it
accidentally attempts to share incompatible
components between between the checks for
zlib and bzip2.

In Christ,
Steven Watanabe
Edward Diener
2017-01-05 21:05:27 UTC
Permalink
Post by Steven Watanabe
AMDG
Post by Edward Diener
Post by Andrea Bocci
<snip>
That will have the same problem. The bug
is at a pretty low level. It will trigger
regardless of how you specify the paths.
Does that mean that the bug is a Boost Build bug ?
Yes.
Post by Edward Diener
using zlib : 1.2.8 : <source>E:/Utilities/zlib/zlib-1.2.8 ;
using bzip2 : 1.0.6 : <source>E:/Utilities/bzip2/bzip2-1.0.6 ;
in order to build from source and this does work. Does that mean that
the bug only occurs when specifying the already built binary include and
library paths as opposed to building from source ?
That is correct. The bug is in the code that detects
whether the library is linkable. When building from
source, this is irrelevant.
Post by Edward Diener
The iostream build was changed in the past by you and "loonycyborg",
whoever that is, to use a different way of handling zlib and bzip2. So I
think that you may know how this problem should be fixed, whether in the
iostreams build jamfile or in Boost Build.
The bug is in build/ac.jam. Basically, it
accidentally attempts to share incompatible
components between between the checks for
zlib and bzip2.
Can this be fixed ?
Andrea Bocci
2017-01-14 11:19:23 UTC
Permalink
Post by Edward Diener
Post by Andrea Bocci
AMDG
Post by Edward Diener
Post by Andrea Bocci
<snip>
That will have the same problem. The bug
is at a pretty low level. It will trigger
regardless of how you specify the paths.
Does that mean that the bug is a Boost Build bug ?
Yes.
<snip>
The bug is in build/ac.jam. Basically, it accidentally attempts to
share incompatible
components between between the checks for zlib and bzip2.
Can this be fixed ?
I think so.

Please find my attempt at https://github.com/boostorg/build/pull/154 - with
it, I can successfully run my original build command.


Ciao,
.Andrea
--
Strategy is a system of expedients.

Generalfeldmarschall Helmuth Karl Bernhard Graf von Moltke
Nathan Ernst
2017-01-05 17:35:31 UTC
Permalink
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
Post by Andrea Bocci
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.
# 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: Tried to build the target twice, with property sets having
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: 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: Tried to build the target twice, with property sets having
error: - <dll-path>../common/lib <library-path>../common/lib
<xdll-path>../common/lib
error: - none
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
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Andrea Bocci
2017-01-05 17:53:47 UTC
Permalink
Post by Nathan Ernst
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
Hi Nate,
thanks for the link. I had a look at you post, but unfortunately my
problems appear much earlier - boost (or rather, the iostreams library)
never compiles, as it does not manage to put together a valida
configuration.

Ciao,
.Andrea
Loading...