Skip to content

Add support for modular build structure. #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

grafikrobot
Copy link
Member

@grafikrobot grafikrobot commented Jul 20, 2024

This is part of the effort to make the Boost libraries "modular" for build and consumption. See https://lists.boost.org/Archives/boost/2024/01/255704.php and https://github.com/grafikrobot/boost-b2-modular/blob/b2-modular/README.adoc for more information.

This PR depends on the following other PRs being merged to both develop and master branches of the respective repos:

This PR will be changed to ready for review, i.e. not draft, when the above are merged. Do not merge this one until that time.

@grafikrobot grafikrobot marked this pull request as ready for review August 18, 2024 15:27
@grafikrobot
Copy link
Member Author

Please review and merge this PR at your earliest convenience.

@grafikrobot grafikrobot closed this Apr 6, 2025
@grafikrobot grafikrobot reopened this Apr 6, 2025
@HDembinski
Copy link
Collaborator

HDembinski commented Apr 18, 2025

I didn't see this, because I am not getting notifications when a PR is opened unless someone mentions me with @HDembinski. I changed something in the options of this repo, putting my email address in explicitly under email notifications. Perhaps that is what was missing.

@grafikrobot Thank you for the changes to the build. There seems to be an issue with boost.random in the slow tests, a linker error. Do you have an idea how to fix this? You also remove some extra warning flags cxxflags=-Wno-unused-parameter cxxflags=-Wno-uninitialized, why?

@grafikrobot
Copy link
Member Author

You also remove some extra warning flags cxxflags=-Wno-unused-parameter cxxflags=-Wno-uninitialized, why?

Those are for avoiding warnings in Math (IIRC) that cause errors because of the warnings-as-errors option.

@grafikrobot grafikrobot marked this pull request as draft April 29, 2025 14:03
@grafikrobot
Copy link
Member Author

@HDembinski

There seems to be an issue with boost.random in the slow tests, a linker error. Do you have an idea how to fix this?

Have those slow tests ever passed? Asking as I don't see them in previous commits.

@grafikrobot grafikrobot reopened this Apr 30, 2025
@HDembinski
Copy link
Collaborator

@HDembinski

There seems to be an issue with boost.random in the slow tests, a linker error. Do you have an idea how to fix this?

Have those slow tests ever passed? Asking as I don't see them in previous commits.

Yes, they used to pass. I only run them on PRs, but not on pushes, that's why they don't show up in the list of commits.

@grafikrobot
Copy link
Member Author

grafikrobot commented May 9, 2025

@HDembinski FYI.. I've been trying to resolve the CI errors. But I can't make progress in most of them myself.
I'm still investigating the appleclang missing link symbol (made harder as I don't have a macos machine to test with). What do you want to do about these..?

  • The coverage fails after doing the building. I'm not familiar with the coverage it's doing to decipher why the lcov file is missing.
  • The slow clang build detects ODR violations.
  • The slow gcc test detects dangling temp reference error/warning in the main test.

PS. I do notice that the coverage and slow tests have not been working for PRs for some time. Including for this one that I made to investigate the build differences between unchanged develop and my changes: #409

@HDembinski
Copy link
Collaborator

@grafikrobot Thank you for the work, I will look into this on the weekend. The problem for me also is that I am not developing on a Mac anymore, I have a Windows machine now (urgh). I think I can fix all these three issues.

@HDembinski
Copy link
Collaborator

HDembinski commented May 17, 2025

So, I finally had a closer look.

* The coverage fails after doing the building. I'm not familiar with the coverage it's doing to decipher why the lcov file is missing.

It looks like ../../b2 $B2_OPTS toolset=gcc-${GCC_VERSION} cxxstd=latest coverage=on test//all doesn't compile anything. No tests are run and no coverage data is created. Any idea why? The alias test//all should run all tests.

If I remember correctly, lcov only works with a matching version of gcc. If you know a better way to measure coverage in C++, I'd love to switch to another tool. You upgraded from gcc-11 to gcc-15, I will probably need to upgrade lcov as well.

* The slow clang build detects ODR violations.

That's because of boost-serialization if you look closely, which you added as a constant dependency to this build. boost-serialization causes lots of issues, that's why I keep it as an optional dependency that is only compiled for some tests that are not as strict. I run harder tests on boost-histogram itself.

* The slow gcc test detects dangling temp reference error/warning in the main test.

That's a newly discovered bug - it seems.

@HDembinski
Copy link
Collaborator

@grafikrobot Progress.

The coverage test still fails, because it doesn't compile anything. test//all works in other circumstances. Weird.

The gcc slow test still fails because of that "possibly dangling pointer". As far as I understand, the pointer shouldn't be dangling because of NRVO. The issue is not detected by another other compiler and not caught by the UBSAN / ASAN tests, so perhaps a false positive. As a workaround, we could turn off that warning for gcc for that line.

@@ -16,10 +16,10 @@ target_link_libraries(boost_histogram
INTERFACE
Boost::config
Boost::core
Boost::math
Copy link
Member Author

Choose a reason for hiding this comment

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

Should you remove that to mirror the b2 side where math is optional?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe, but it does cause so many problems, because it is header only.

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