Skip to content

Conversation

@ayoopierre
Copy link

Adding libmcs library, and tools for phoenix build system to select math library to build on (either libmcs or libphoenix implementation).

Description

Adding files from libmcs, move math files from libphoenix to core-libs, create new Makefile

Motivation and Context

Add math library for critical applications.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

All projects, that depend on math library should add appropriate flag for linking against new library

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (all targets except for ia32 - new library causes compilation error due to patches on micropython).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

@gemini-code-assist
Copy link

Summary of Changes

Hello @ayoopierre, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's mathematical capabilities by integrating a new, highly configurable standard math library. It provides the flexibility to choose between two distinct implementations, libmcs for critical applications and the existing libphoenix math, directly within the build system. This change is foundational, impacting how dependent projects link against the math library.

Highlights

  • New Math Library Integration: Introduced libm as a new component in the build system, allowing selection between libmcs and libphoenix math implementations.
  • libmcs Library Addition: Incorporated the libmcs (Mathematical Library for Critical Systems) with its full source code, build scripts, and comprehensive documentation.
  • Build System Flexibility: The build system now supports conditional compilation, enabling users to choose their preferred math library implementation via a USE_LIBMCS flag.
  • Breaking Change: Projects dependent on the math library will need to update their linking flags to accommodate the new library selection mechanism.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the libmcs math library and integrates it into the build system. The changes are extensive, including the library's source code, build scripts, and documentation. While the overall structure is good, there are several issues in the Makefiles and CI configuration that need attention. Specifically, the libm/Makefile has issues with installing source files as headers, inconsistent indentation, and a typo. The .gitlab-ci.yml file has a potential race condition due to incorrect job dependencies. Additionally, there's a code style improvement suggested for a header file to avoid code bloat.

Copy link
Member

@agkaminski agkaminski left a comment

Choose a reason for hiding this comment

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

  • pls add JIRA ID to commit msg
  • add library in a separate commit from additional changes

@github-actions
Copy link

github-actions bot commented Sep 23, 2025

Unit Test Results

9 277 tests  +63   8 687 ✅ +62   55m 5s ⏱️ +38s
  545 suites + 9     589 💤 ± 0 
    1 files   ± 0       1 ❌ + 1 

For more details on these failures, see this check.

Results for commit ac6284d. ± Comparison against base commit 82ac411.

♻️ This comment has been updated with latest results.

Mikolaj Matalowski added 2 commits September 24, 2025 15:10
@nalajcie
Copy link
Member

  • .clang-format should be added to the dir with external code (either ignore all formatting rules or provide other coding style if available in upstream project )
  • you can disable shellcheck for full files by adding a directive in a header (probably #shellcheck disable=all) - you may add them in a separate commit
  • sooo, we need to have separate header files for different libc implementations? (shame)
  • does this change break toolchain multilib building (libm needs to be installed in toolchain, probably libm headers need to be available also for building libstdc++)?

@ayoopierre ayoopierre closed this Sep 29, 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.

4 participants