Skip to content

fix(build): inherit NumericalToolbox_ENABLE_OPTIMIZATIONS from numerical.math - #21

Merged
gabrielfrasantos merged 1 commit into
mainfrom
ccr-8377b087-s2s0v8-optimizations-define
Oct 1, 2026
Merged

gabrielfrasantos merged 1 commit into
mainfrom
ccr-8377b087-s2s0v8-optimizations-define

Conversation

@gabrielfrasantos

Copy link
Copy Markdown
Contributor

Mirrors embedded-pro/numerical-toolbox-cpp#346 (issue embedded-pro/numerical-toolbox-cpp#337).

Problem. add_definitions(-DNumericalToolbox_ENABLE_OPTIMIZATIONS=1) is directory-scoped. When this repo is consumed via FetchContent, the define never reaches the consumer's translation units, so OPTIMIZE_FOR_SPEED in the robotics headers silently expands to nothing.

Change

  • Bump the numerical-toolbox pin 1225b3c → 69ff13e (current main). There, numerical.math carries NumericalToolbox_ENABLE_OPTIMIZATIONS as a usage requirement, so every target linking numerical.* inherits it, including downstream consumers of this repo.
  • Forward ROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS to NUMERICAL_TOOLBOX_ENABLE_OPTIMIZATIONS before fetching numerical-toolbox. This keeps the existing option, and the coverage preset that turns it Off, working.
  • Drop the directory-scoped add_definitions.

What the bump also brings in from numerical-toolbox:

  • #347: the O3/fast-math pragma is scoped per header instead of leaking into including TUs.
  • New SGD/Adam step optimisers, mel/MFCC, and a gradient-check test helper. These are additive.

Validation (host, GCC 13, Debug, -Werror)

  • Builds; ctest passes 2/2.
  • compile_commands.json: 6/6 repo TUs get -DNumericalToolbox_ENABLE_OPTIMIZATIONS=1, and 0/6 with -DROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS=Off.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N4pngRiBqeb1xiseKXNLG6


Generated by Claude Code

…cal.math

The define was set with directory-scoped add_definitions, so it never reached
the translation units of projects consuming this library and OPTIMIZE_FOR_SPEED
silently expanded to nothing there. numerical-toolbox now attaches it as a
usage requirement of numerical.math (embedded-pro/numerical-toolbox-cpp#346):
bump the pin to include that change, forward ROBOTICS_TOOLBOX_ENABLE_OPTIMIZATIONS to
NUMERICAL_TOOLBOX_ENABLE_OPTIMIZATIONS, and drop the add_definitions.

Mirrors embedded-pro/numerical-toolbox-cpp#337.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4pngRiBqeb1xiseKXNLG6
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 0.48s
✅ CPP clang-format 35 0 0 0 0.65s
✅ CPP cppcheck 35 0 0 0.84s
✅ DOCKERFILE hadolint 1 0 0 0.31s
✅ JSON jsonlint 8 0 0 0.08s
✅ JSON prettier 8 2 0 0 0.3s
✅ MARKDOWN markdownlint 131 0 0 0 1.56s
✅ MARKDOWN markdown-table-formatter 131 0 0 0 0.16s
⚠️ SPELL lychee 165 2 0 1.25s
✅ YAML prettier 12 0 0 0 0.45s
✅ YAML yamllint 12 0 0 0.48s

Detailed Issues

⚠️ SPELL / lychee - 2 errors
[ERROR] failed to verify TLS certificate: invalid peer certificate: UnknownIssuer
📝 Summary
---------------------
🔍 Total..........104
🔗 Unique..........42
✅ Successful......92
⏳ Timeouts.........0
🔀 Redirected.......5
👻 Excluded.........9
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2

Errors in .github/workflows/static-analysis.yml
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ (at 37:21) | Rejected status code: 403 Forbidden

Errors in doc/kinematics/InverseKinematics.md
[ERROR] https://mathweb.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf (at 124:169) | SSL certificate not trusted. Use --insecure if site is trusted

Hint: Followed 5 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: REPOSITORY_GITLEAKS, REPOSITORY_KICS. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.1.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CPPCHECK,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@gabrielfrasantos
gabrielfrasantos merged commit b6a7848 into main Oct 1, 2026
9 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the ccr-8377b087-s2s0v8-optimizations-define branch October 1, 2026 06:45
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