Re: [boost] Problem with building 1.85.0
Andrey Semashev wrote:
If you're building Boost from git, you should run `./b2 headers` before building Boost.
The output you posted is missing the actual compilation errors for these files. Check the earlier compiler messages for these files. Or run `./b2 -j8 --with-filesystem` to build specifically Boost.Filesystem and see the output.
Ok, I added `./b2 headers` before `./b2 -j8 install` which didn't change
anything that I could see. `./b2 -j8 --with-filesystem` then gave me this:
...patience...
...found 3209 targets...
...updating 46 targets...
boost-install.generate-cmake-config-
bin.v2/libs/headers/build/stage/boost_headers-config.cmake
boost-install.generate-cmake-config-
bin.v2/libs/filesystem/build/stage/boost_filesystem-config.cmake
boost-install.generate-cmake-config-version-
bin.v2/libs/headers/build/stage/boost_headers-config-version.cmake
common.copy /home/ted/git/boost/stage/lib/libboost_atomic.so.1.85.0
ln-UNIX /home/ted/git/boost/stage/lib/libboost_atomic.so
boost-install.generate-cmake-config-
bin.v2/libs/atomic/build/stage/boost_atomic-config.cmake
boost-install.generate-cmake-config-version-
bin.v2/libs/atomic/build/stage/boost_atomic-config-version.cmake
common.copy /home/ted/git/boost/stage/lib/libboost_atomic.a
common.copy
/home/ted/git/boost/stage/lib/cmake/BoostDetectToolset-1.85.0.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_filesystem-1.85.0/boost_filesystem-config.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/Boost-1.85.0/BoostConfig.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/Boost-1.85.0/BoostConfigVersion.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_headers-1.85.0/boost_headers-config.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_headers-1.85.0/boost_headers-config-version.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_atomic-1.85.0/boost_atomic-config-version.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_atomic-1.85.0/libboost_atomic-variant-shared.cmake
boost-install.generate-cmake-config-version-
bin.v2/libs/filesystem/build/stage/boost_filesystem-config-version.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_atomic-1.85.0/boost_atomic-config.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_atomic-1.85.0/libboost_atomic-variant-static.cmake
common.copy
/home/ted/git/boost/stage/lib/cmake/boost_filesystem-1.85.0/boost_filesystem-config-version.cmake
gcc.compile.c++
bin.v2/libs/filesystem/build/gcc-14/release/threading-multi/visibility-hidden/unique_path.o
libs/filesystem/src/unique_path.cpp:57:10: fatal error:
boost/scope/unique_fd.hpp: No such file or directory
57 | #include libboost_filesystem.so.1.85.0
for lack of
libboost_filesystem.so for
lack of libboost_filesystem.so.1.85.0...
...skipped
libboost_filesystem-variant-shared.cmake
for lack of
libboost_filesystem.a for
lack of
libboost_filesystem-variant-static.cmake
for lack of
libboost_filesystem-variant-shared.cmake
libboost_filesystem-variant-static.cmake
libboost_filesystem.a
libboost_filesystem.so
libboost_filesystem.so.1.85.0
This didn't look right: $ git submodule status libs/scope -8321450aca6fc6a075225ba225036e585ce1716b libs/scope I wasn't able to reset the repo and submodules to get the missing `libs/scope` module in 1.85 (but going back to 1.84 and building there worked). I ended up cloning the whole boost repo again with `git clone --recurse-submodules ...` and then building worked fine. I wonder what's wrong with my way of rebuilding boost? I've now added the `./b2 headers` step which I've never used before and I don't know what it's needed for. All headers are usually installed in my `--prefix=<path>`'s `include` directory even without it. Br, Ted
On 5/14/24 08:00, Ted Lyngmo via Boost wrote:
This didn't look right:
$ git submodule status libs/scope -8321450aca6fc6a075225ba225036e585ce1716b libs/scope
I wasn't able to reset the repo and submodules to get the missing `libs/scope` module in 1.85 (but going back to 1.84 and building there worked).
As others have mentioned, the `--init` argument to `git submodule update` should initialize the submodules that were introduced since your last `git submodule init` or `git submodule update --init`. https://git-scm.com/book/en/v2/Git-Tools-Submodules If you maintain the same git tree over the course of Boost development, you should definitely add `--init` to your `git submodule update` command to ensure any new submodules that are added to the Boost superproject are properly checked out in your tree.
I ended up cloning the whole boost repo again with `git clone --recurse-submodules ...` and then building worked fine.
The `--recurse-submodules` option automatically initializes submodules during cloning, similarly to how `--init` would do.
I've now added the `./b2 headers` step which I've never used before and I don't know what it's needed for.
`./b2 headers` recreates the unified `boost` directory with links to headers of every library. This unified tree is required for the building process. Boost.Build is able to detect header dependencies during the build process and create those links "on demand", but this doesn't work reliably, and as of now `./b2 headers` is required for building Boost with Boost.Build. Note that if you maintain the same git tree over time, you should do `./b2 headers` periodically (or before build) so that the links are updated if new headers in Boost libraries are added or old ones removed.
cpp:42:10: fatal error: boost/scope/unique_fd.hpp: No such file or directory 42 | #include
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
You're missing the --init flag in your `git submodule update` command. That's preventing git from initializing the Boost.Scope submodule, introduced in 1.85 IIRC.
Ted Lyngmo wrote:
Ok, I added `./b2 headers` before `./b2 -j8 install` which didn't change anything that I could see. `./b2 -j8 --with-filesystem` then gave me this:
...
gcc.compile.c++ bin.v2/libs/filesystem/build/gcc-14/release/threading-multi/visibility- hidden/unique_path.o libs/filesystem/src/unique_path.cpp:57:10: fatal error: boost/scope/unique_fd.hpp: No such file or directory 57 | #include
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
You need to add --init to your `git submodule update`, as without it the new submodules such as Scope aren't being checked out.
participants (4)
-
Andrey Semashev
-
Peter Dimov
-
Ruben Perez
-
Ted Lyngmo