Skip to content

Conversation

@LegalizeAdulthood
Copy link
Contributor

@LegalizeAdulthood LegalizeAdulthood commented Sep 30, 2025

This adds CMake build script support for building the examples that are currently built with bjam.

This should help in preventing build-rot from creeping into the example programs.

I ran all the examples manually to verify that they didn't assert or crash.

I'm open to discussion on the changes made to the top-level CMakeLists.txt to find Boost dependencies;
this was necessary for me to build the examples by checking out this repository alone.

Please let me know if you prefer to have everything squished to a single commit; that's not a problem for me.

This makes the option visible in the cmake user front-end.
BOOST_NUMERIC_ODEINT_ADAPTORS only turns off two dependencies at this
time: boost::compute and boost::mpi.  Factor out the unconditional
dependencies to make this clearer in the CMake script.
This prevents us from accidentally using the wrong indent level in the
editor, etc.
Implementation follows the existing jam files, so the following
subdirectories in examples are skipped:

- mtl
- ublas
- gmpxx
- openmp
- mpi
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.40%. Comparing base (91a4a91) to head (54108fb).
⚠️ Report is 17 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #103      +/-   ##
===========================================
- Coverage    99.43%   99.40%   -0.03%     
===========================================
  Files          168      168              
  Lines         7556     7556              
===========================================
- Hits          7513     7511       -2     
- Misses          43       45       +2     

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91a4a91...54108fb. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mborland
Copy link
Member

mborland commented Dec 1, 2025

I think this can be made much simpler. We already have boost_test_jamfile which allows us to run all the tests in a jam file via cmake with a trivial amount of code. See example here: https://github.com/boostorg/charconv/blob/develop/test/CMakeLists.txt.

The examples could be added to run in the test/ Jamfile (as they are in many libraries) and then boost_test_jamfile runs on everything in test/ so we can do both tests and examples via CMake.

@LegalizeAdulthood
Copy link
Contributor Author

That sounds fine to me, feel free to discard this if there is some other magical way of making it happen in bjam and CMake. Boost.build is nebulous to me, although I understand CMake pretty well.

@LegalizeAdulthood
Copy link
Contributor Author

Should we close this PR then?

@mborland mborland closed this Dec 12, 2025
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.

2 participants