I have a clean Boost Git clone with tag boost-1.87.0
checked out and all submodules recursively cloned. If I call bootstrap.sh
and then b2
according to various getting started guides and best practive documents, I have no problem bootstrapping and then building Boost. Everything works fine.
==BEGIN EDIT==
I have created a sample program for replicating the problem with minimum effort. The full explanation is still in this post, but you can clone and run the sample here: https://github.com/beamerblvd/unable-find-target-with-boost-bcp.
==END EDIT==
For whatever it's worth (but I don't believe it's my problem), I'm on macOS 15 with Clang 16, and these are my b2
arguments except where/as otherwise noted:
-sBOOST_ROOT={dir}/_src \
--boost-build=tools/build/src \
cxxstd=20 \
-d \
2 \
-j \
2 \
-q \
--prefix={dir} \
--build-dir={dir}/shobj \
--stagedir={dir}/stage \
--user-config={dir}/user-config.jam \
--layout=system \
toolset=clang-darwin \
threading=multi \
link=shared \
architecture=arm \
instruction-set=nocona \
address-model=64 \
--without-python \
--disable-icu \
variant=debug
But merely building stock Boost is not sufficient in my case, and for reasons over which I have no control and must abide by, I need to customize the Boost namespace using bcp
.
So here's what I'm doing:
{dir}/user-config.jam
:
constant BOOST_VERSION : mybranchname-1.87.0.a ;
constant MY_PLATFORM : macos15-clang16-arm-d ;
constant MY_LABEL : MYextralLabel ;
constant BOOST_USER_CONFIG : <my_boost/config/user.hpp> ;
using clang : 16 : clang++ : <cxxflags>-fvisibility=hidden <cxxflags>-fvisibility-inlines-hidden ;
The middle three lines are unique to my BCP attempt; the first and last lines I have successfully used when building non-BCP'd Boost.{dir}/_src/boostrap.sh
with a CWD of {dir}/_src
(SUCCESS).b2
with the above args, except variant=release
instead of variant=debug
, plus --prefix={dir}/bcp --build-dir={dir}/bcp --stagedir={dir}/bcp/stage tools/bcp
with a CWD of {dir}/_src
(SUCCESS).{dir}/shobj/bin/bcp --namespace=boost_MYextralLabel --namespace-alias Jamroot boost boost-build.jam boostcpp.jam bootstrap.bat bootstrap.sh build status tools [insert_name_of_every_dir_in_libs] {dir}/_dst
with a CWD of {dir}/_src
, which copies/transmogrifies the contents of {dir}/_src
into {dir}/_dst
(SUCCESS).{dir}/_dst/boostrap.sh
with a CWD of {dir}/_dst
(SUCCESS).b2
with the above args, except _src
replaced with _dst
, with a CWD of {dir}/_dst
to build the namespace-altered Boost (ERROR).And here's where I get an error:
Performing configuration checks
- default address-model : 64-bit [1]
- default architecture : arm [1]
Building the Boost C++ Libraries.
- symlinks supported : yes
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam.
note: to suppress this message, pass "--without-graph_parallel" to bjam.
- icu : no [2]
- iconv (libc) : no [2]
- iconv (separate) : yes [2]
- cxx11_auto_declarations : yes [2]
- cxx11_decltype : yes [2]
- cxx11_defaulted_functions : yes [2]
- cxx11_defaulted_moves : yes [2]
- cxx11_hdr_functional : yes [2]
- cxx11_hdr_type_traits : yes [2]
- cxx11_noexcept : yes [2]
- cxx11_nullptr : yes [2]
- cxx11_override : yes [2]
- cxx11_range_based_for : yes [2]
- cxx11_rvalue_references : yes [2]
- cxx11_scoped_enums : yes [2]
- cxx11_smart_ptr : yes [2]
- cxx11_static_assert : yes [2]
- cxx11_variadic_templates : yes [2]
- native atomic int32 supported : no [2]
- native syslog supported : yes [2]
- pthread supports robust mutexes : no [2]
- Boost.Regex is header-only : yes [2]
error: Unable to find file or target named
error: '/boost/align//boost_align'
error: referred to from project at
error: '{dir}/_dst/libs/atomic/build'
make: *** [build] Error 1
I've tried dozens of different things over the past two workdays and always get the exact same result. The only thing I've done that has caused any different (but still erroneous output) is, between steps 4 (running bcp
) and 5 (the second bootstrap, in the new directory), "cleaning" the generated files by deleting the directory {dir}/_dst/boost
. If I insert that step between 4 and 5, the erroneous output of step 6 is now (after getting a little further):
Performing configuration checks
- default address-model : 64-bit [1]
- default architecture : arm [1]
Building the Boost C++ Libraries.
- symlinks supported : yes
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam.
note: to suppress this message, pass "--without-graph_parallel" to bjam.
- icu : no [2]
- iconv (libc) : no [2]
- iconv (separate) : yes [2]
- cxx11_auto_declarations : no [2]
- icu : no [3]
- iconv (libc) : no [3]
- iconv (separate) : yes [3]
- cxx11_auto_declarations : no [3]
- native atomic int32 supported : no [2]
- native syslog supported : yes [2]
- pthread supports robust mutexes : no [2]
- Boost.Regex is header-only : no [2]
- cxx11_static_assert : no [2]
- cxx11_static_assert : no [3]
- has std::atomic_ref : no [2]
- has -Wl,--no-undefined : no [2]
- has -Wl,-undefined,error : yes [2]
- has statx : no [2]
- has statx syscall : no [2]
- cxx11_rvalue_references : no [2]
- has std::atomic_ref : no [3]
- has -Wl,--no-undefined : no [3]
- has -Wl,-undefined,error : yes [3]
- has statx : no [3]
- has statx syscall : no [3]
- cxx11_rvalue_references : no [3]
- has_icu builds : no [2]
- lockfree boost::atomic_flag : no [2]
- native atomic int32 supported : no [3]
- native syslog supported : yes [3]
- pthread supports robust mutexes : no [3]
- cxx11_lambdas : no [2]
- cxx11_lambdas : no [3]
- std_wstreambuf builds : no [2]
- std_wstreambuf : no [2]
- std_wstreambuf : no [3]
- BOOST_COMP_GNUC >= 4.3.0 : no [2]
- BOOST_COMP_GNUC >= 4.3.0 : no [4]
error: Unable to find file or target named
error: 'libs/thread/build//boost_MYextralLabel_thread'
error: referred to from project at
error: '.'
make: *** [build] Error 1
I'm sure I'm doing something wrong, but after more than 12 hours of working on this I've run out of ideas and started to suspect that bcp
is broken.
Any ideas?
Turns out I was not doing anything wrong (for this specific problem). This was a new bug in BCP, for which there is now a pull request. Applying this patch to my 1.87.0 checkout makes Boost build now after running BCP against it.