问题
I am having issues while building the Boost Library on Ubuntu 16.04 LTS with gcc-8.
Currently I need to build both the Debug and Release built libraries.
Here are the commands I have used to build the library for debug build:
$ ./bootstrap.sh --with-libraries=all --with-python-version=3.5 --with-icu="/usr/include/x86_64-linux-gnu/"
###################
# For Debug build #
###################
$ ./b2 toolset=gcc-8 cxxflags="-std=c++17" variant=debug
#####################
# For Release build #
#####################
$ ./b2 toolset=gcc-8 cxxflags="-std=c++17" variant=release
The issue is that even with variant specified as debug
or release
, the build builds the libraries with the same names.
Each build step overwrites the libraries built by the previous command.
How can I get the Debug libraries with probable suffix -d
as per the documentation mentioned here?
I also tried to look into the boost-build
reference mentioned here.
But I am getting a Error 404 page is not found.
The old reference for Boost Build as found here also does not seems to have the necessary details of building the boost libraries in both debug and release modes.
Thanks in advance.
回答1:
As mentioned in the --help
information, on Unix type systems the default for --layout
is system
which doesn't add the tagging that allows for multiple build variations to coexist:
--layout=<layout> Determine whether to choose library names and header
locations such that multiple versions of Boost or
multiple compilers can be used on the same system.
-- versioned -- Names of boost binaries include
the Boost version number, name and version of
the compiler and encoded build properties. Boost
headers are installed in a subdirectory of
<HDRDIR> whose name contains the Boost version
number.
-- tagged -- Names of boost binaries include the
encoded build properties such as variant and
threading, but do not including compiler name
and version, or Boost version. This option is
useful if you build several variants of Boost,
using the same compiler.
-- system -- Binaries names do not include the
Boost version number or the name and version
number of the compiler. Boost headers are
installed directly into <HDRDIR>. This option is
intended for system integrators building
distribution packages.
The default value is 'versioned' on Windows, and
'system' on Unix.
You can use either the --layout=tagged
or --layout=versioned
options to allow the multiple variants when you build.
There is also a --buildid=ID
option, also listed in the --help
output, that will let you put a custom tag on the results. Useful in the cases where you want a shorter name or to keep things as simple as possible. But beware that since it's custom consumers, i.e. build systems, will not likely know how to deal with the names.
来源:https://stackoverflow.com/questions/54306896/boost-libraries-debug-and-release-build-on-linux