Skip to content

Feature/bump to boost v1.92.0 - #13

Open
ClausKlein wants to merge 36 commits into
developfrom
feature/bump-to-boost-v1.92.0
Open

ClausKlein wants to merge 36 commits into
developfrom
feature/bump-to-boost-v1.92.0

Conversation

@ClausKlein

@ClausKlein ClausKlein commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Based strictly on the CMake logic and the libraries marked with use BOOST_USE_MODULES:

Boost library Windows/MSVC Darwin/Clang Darwin/GNU Linux/Clang Linux/GNU
any Valid Valid Valid Valid Valid
conversion Valid Valid Valid Valid Valid
dll Disabled Disabled Disabled Disabled Disabled
lexical_cast Valid Valid Valid Valid Valid
pfr Valid Valid Valid Valid Valid
stacktrace Disabled Valid Disabled Valid Disabled
type_index Valid Valid Valid Valid Valid

TODOS:

  • g++-16 does not support module :private; used by stacktrace:
/Users/clausklein/.local/share/boost_stacktrace_dump.cppm:43:1: error: module already declared
   43 | module :private;
      | ^~~~~~
  • NOTE: Windows build only yet w/o import std;
  • Windows fails to build any module:
[162/288] Building CXX object _deps\boost-build\libs\any\CMakeFiles\boost_any.dir\modules\boost_any.cppm.obj
FAILED: [code=2] _deps/boost-build/libs/any/CMakeFiles/boost_any.dir/modules/boost_any.cppm.obj _deps/boost-build/libs/any/CMakeFiles/boost_any.dir/boost.any.ifc 
"C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Tools\MSVC\14.51.36231\bin\Hostx64\x64\cl.exe"  /nologo /TP -DBOOST_USE_MODULES -D_MBCS -ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\any\include -external:ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\config\include -external:ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\throw_exception\include -external:ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\assert\include -external:ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\type_index\include -external:ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\container_hash\include -external:ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\describe\include -external:ID:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\mp11\include -external:W0 /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++latest -MD /showIncludes @_deps\boost-build\libs\any\CMakeFiles\boost_any.dir\modules\boost_any.cppm.obj.modmap /Fo_deps\boost-build\libs\any\CMakeFiles\boost_any.dir\modules\boost_any.cppm.obj /Fdstage\lib\libboost_any-vc145-mt-x64-1_92.pdb /FS -c D:\a\boost-cmake\boost-cmake\build\Release\_deps\boost-src\libs\any\modules\boost_any.cppm
boost_any.cppm
C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Tools\MSVC\14.51.36231\include\atomic(403): error C2572: 'std::_Atomic_storage': redefinition of default argument: parameter 2
C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Tools\MSVC\14.51.36231\include\atomic(528): note: see declaration of 'std::_Atomic_storage'
if(MSVC)
    # FIXME: MSVC fails to find standard stream operators while instantiating
    # exported Boost.LexicalCast templates when the module uses import std.
    set(BOOST_LEXICAL_CAST_USE_STD_MODULE OFF)
endif()
  • g++-16 on Darwin with arm64 does not build with BOOST_USE_MODULES=1
if(
    APPLE
    AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
    AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16
    AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17
    AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$"
)
    # FIXME: GCC 16 on Darwin ARM64 loses boost::ulong_long_type from
    # Boost.Config when sources are compiled with -fmodules-ts.
    add_compile_definitions(BOOST_HAS_LONG_LONG)
endif()
  • g++-16 on Darwin with arm64 does not build with import std;
cmake --build --preset Release
[0/2] Re-checking globbed directories...
[1/332] Scanning /opt/homebrew/Cellar/gcc/16.1.0/include/c++/16/bits/std.cc for CXX dependencies
[2/332] Scanning /opt/homebrew/Cellar/gcc/16.1.0/include/c++/16/bits/std.compat.cc for CXX dependencies
[3/332] Generating CXX dyndep file '_deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/CXX.dd'
FAILED: [code=1] _deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/CXX.dd _deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/CXXModules.json _deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/opt/homebrew/Cellar/gcc/16.1.0/include/c++/16/bits/std.cc.o.modmap _deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/opt/homebrew/Cellar/gcc/16.1.0/include/c++/16/bits/std.compat.cc.o.modmap 
/Users/runner/work/_temp/-1240556199/cmake-4.4.2-macos-universal/CMake.app/Contents/bin/cmake -E cmake_ninja_dyndep --tdi=_deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/CXXDependInfo.json --lang=CXX --modmapfmt=gcc --dd='_deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/CXX.dd' @'_deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/CXX.dd'.rsp
CMake Error: Output _deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/opt/homebrew/Cellar/gcc/16.1.0/include/c++/16/bits/std.cc.o is of type `CXX_MODULES` but does not provide a module interface unit or partition
CMake Error: Output _deps/boost-build/libs/atomic/CMakeFiles/@cmake_cxx_std.dir/opt/homebrew/Cellar/gcc/16.1.0/include/c++/16/bits/std.compat.cc.o is of type `CXX_MODULES` but does not provide a module interface unit or partition
[4/332] Scanning /Users/runner/work/boost-cmake/boost-cmake/build/Release/_deps/boost-src/libs/conversion/modules/boost_conversion.cppm for CXX dependencies
[5/332] Scanning /Users/runner/work/boost-cmake/boost-cmake/build/Release/_deps/boost-src/libs/lexical_cast/modules/boost_lexical_cast.cppm for CXX dependencies
[6/332] Scanning /Users/runner/work/boost-cmake/boost-cmake/build/Release/_deps/boost-src/libs/atomic/src/lock_pool.cpp for CXX dependencies
[7/332] Scanning /Users/runner/work/boost-cmake/boost-cmake/build/Release/_deps/boost-src/libs/chrono/src/chrono.cpp for CXX dependencies
ninja: build stopped: subcommand failed.
make: *** [build] Error 1
Error: Process completed with exit code 2.

@ClausKlein ClausKlein self-assigned this Aug 18, 2026
@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from c836d4b to 1145cc2 Compare August 18, 2026 19:36
Add more modules examples

Use missing patch

Fix build with modules and w/o import std;
@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from 3bea9f7 to 03d5298 Compare August 19, 2026 10:30
@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from 75a27b8 to 74022a2 Compare August 19, 2026 13:15
But only with one single moster patch to prevent git errors
about missing boost git repo!
@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from 87a9f7c to 7321215 Compare August 19, 2026 14:18
@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from 183ee8e to b657867 Compare August 20, 2026 19:00
@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from dcdea6b to 2035f1f Compare August 20, 2026 22:51
@ClausKlein

Copy link
Copy Markdown
Owner Author

The CXX_MODULES are installed like this:

root@06bf603b8cf4:/src# tree -L 2 /root/.local/share/boost-1.92.0/
/root/.local/share/boost-1.92.0/
|-- assert
|   `-- boost_assert.natvis
|-- bloom
|   |-- boost_bloom.natvis
|   `-- boost_bloom_printers.py
|-- boost_any
|   `-- boost_any.cppm
|-- boost_conversion
|   `-- boost_conversion.cppm
|-- boost_lexical_cast
|   `-- boost_lexical_cast.cppm
|-- boost_pfr
|   `-- boost_pfr.cppm
|-- boost_stacktrace
|   `-- boost_stacktrace.cppm
|-- boost_stacktrace_addr2line
|   `-- boost_stacktrace_addr2line.cppm
|-- boost_stacktrace_basic
|   `-- boost_stacktrace_basic.cppm
|-- boost_stacktrace_dump
|   `-- boost_stacktrace_dump.cppm
|-- boost_stacktrace_noop
|   `-- boost_stacktrace_noop.cppm
|-- boost_type_index
|   `-- boost_type_index.cppm
|-- container
|   |-- boost_hub.natvis
|   `-- boost_hub_printers.py
|-- core
|   `-- boost_core.natvis
|-- decimal
|   |-- decimal_printer_gdb.py
|   |-- decimal_printer_lldb.py
|   `-- detail
|-- interprocess
|   |-- boost_interprocess.natvis
|   `-- boost_interprocess_printers.py
|-- random
|   |-- Jamfile.v2
|   |-- haertel.hpp
|   `-- test_haertel.cpp
|-- system
|   `-- boost_system.natvis
|-- unordered
|   |-- boost_unordered.natvis
|   `-- boost_unordered_printers.py
|-- url
|   |-- gdb
|   `-- test_suite
`-- variant2
    `-- boost_variant2.natvis

25 directories, 27 files
root@06bf603b8cf4:/src# 

To fix problems with missing boost::ulong_long_type
Fix boost_any.cppm Unix

Start next try to fix it on Windows too :-(
@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from 46206e5 to d23f97e Compare August 22, 2026 20:20
Comment thread CMakeLists.txt
Comment on lines +223 to +236
#############################################################
if(
APPLE
AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17
AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$"
)
# FIXME: GCC 16 on Darwin ARM64 loses boost::ulong_long_type from
# Boost.Config when sources are compiled with -fmodules-ts.
add_compile_definitions(BOOST_HAS_LONG_LONG)
endif()
#############################################################

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this workaround is still needed!

Comment thread CMakeLists.txt
INTERFACE
$<$<CONFIG:Release>:BOOST_DISABLE_ASSERT>
BOOST_ASIO_NO_DEPRECATED
BOOST_HAS_LONG_LONG

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same workaround for use of installed packages!

@ClausKlein
ClausKlein force-pushed the feature/bump-to-boost-v1.92.0 branch from 3123415 to 6dd2b37 Compare August 25, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant