Skip to content
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

silent werror on ubuntu builds #906

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

nicolasaunai
Copy link
Member

@nicolasaunai nicolasaunai commented Oct 16, 2024

Summary by CodeRabbit

  • Chores
    • Updated the build configuration for improved performance and debugging settings.

Copy link

coderabbitai bot commented Oct 16, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes in this pull request focus on the .github/workflows/cmake_ubuntu.yml file, specifically modifying the CMake configuration for the SAMRAI project. The build type has been switched from RelWithDebInfo to Debug, and the CXX flags have been updated to include higher optimization settings. These adjustments are intended to refine the build process without altering the overall workflow structure or job definitions.

Changes

File Change Summary
.github/workflows/cmake_ubuntu.yml Changed build type from RelWithDebInfo to Debug and updated CXX flags to -O3 -DPHARE_DIAG_DOUBLES=1.

Possibly related PRs

  • samrai assertions if not in release #862: The changes in this PR involve modifying the CMake configuration to enable debugging assertions when not in a release build, which is related to the changes in build type and CMake settings in the main PR.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 151e29f and 3edcddc.

📒 Files selected for processing (1)
  • .github/workflows/cmake_ubuntu.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/cmake_ubuntu.yml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5f60609 and c994aa3.

📒 Files selected for processing (1)
  • .github/workflows/cmake_ubuntu.yml (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
.github/workflows/cmake_ubuntu.yml (1)

77-77: Verify the intention behind changing SAMRAI build type to Debug

The build type for SAMRAI has been changed from RelWithDebInfo to Debug. This change might have the following implications:

  1. Slower performance due to reduced optimizations.
  2. Larger binary size.
  3. More detailed debugging information, which might not be necessary for CI builds.

Could you please clarify the reasoning behind this change? If the goal is to catch more issues during CI, consider using RelWithDebInfo instead, as it provides a balance between performance and debugging capabilities.

✅ Verification successful

SAMRAI build type is consistently set to Debug across the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if Debug build type is used consistently across the project

# Test 1: Check if Debug build type is used in other CMake configurations
echo "Checking for Debug build type usage in CMake files:"
rg --type cmake -i 'cmake_build_type.*debug' -g '!.github/workflows/cmake_ubuntu.yml'

# Test 2: Check if there are any performance-critical tests that might be affected
echo "Checking for performance-critical tests:"
rg --type cpp --type python -i '(benchmark|performance|timing).*test'

Length of output: 529


Script:

#!/bin/bash
# Description: Check if Debug build type is used consistently across the project

# Test 1: Check if Debug build type is used in other CMake configurations
echo "Checking for Debug build type usage in CMake files:"
rg --type cmake -i 'cmake_build_type.*debug' -g '!.github/workflows/cmake_ubuntu.yml'

# Test 2: Check if there are any performance-critical tests that might be affected
echo "Checking for performance-critical tests:"
rg --type cpp --type py -i '(benchmark|performance|timing).*test'

Length of output: 581

make -j2 && sudo make install && cd ../.. && rm -rf samrai
cd ${{runner.workspace}}/build && rm -rf *
cmake $GITHUB_WORKSPACE -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON --fresh \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -Dasan=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DlowResourceTests=ON -DdevMode=ON -Dbench=ON \
-DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 " -Dphare_configurator=ON
-DCMAKE_CXX_FLAGS="-O3 -DPHARE_DIAG_DOUBLES=1 " -Dphare_configurator=ON
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

Inconsistent Optimization Levels Detected

The main project uses -O3 optimization, while res/cmake/coverage.cmake employs -O0. This mismatch can lead to:

  • Performance Discrepancies: Different optimization levels may cause inconsistent behavior and performance issues.
  • Debugging Challenges: Optimized code (-O3) can interfere with debugging processes compared to unoptimized builds (-O0).

Recommendations:

  1. Align Optimization Flags: Use a consistent optimization level across all CMake configurations, such as RelWithDebInfo, to balance performance and debuggability.
  2. Review CMake Files: Ensure all CMake files set compatible CMAKE_CXX_FLAGS to maintain uniform behavior.
🔗 Analysis chain

Resolve inconsistency between Debug build and -O3 optimization

There's an inconsistency in the optimization levels:

  1. SAMRAI is built with Debug configuration (typically -O0 or -Og).
  2. The main project uses -O3 optimization.

This mix of optimization levels could lead to:

  • Inconsistent performance characteristics.
  • Potential issues when debugging, as optimized code might not match source code exactly.

Consider the following options:

  1. If performance is critical, use RelWithDebInfo for both SAMRAI and the main project.
  2. If debugging is the priority, remove the -O3 flag and use Debug consistently.
  3. If you need both performance and debugging capabilities, consider using RelWithDebInfo with -g flag for both.

Please clarify the intended behavior and adjust the configuration accordingly.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent optimization levels across the project

# Test 1: Check if -O3 is used consistently in CMake files
echo "Checking for -O3 usage in CMake files:"
rg --type cmake -i 'cmake_cxx_flags.*-O3' -g '!.github/workflows/cmake_ubuntu.yml'

# Test 2: Check for other optimization flags that might conflict
echo "Checking for other optimization flags:"
rg --type cmake -i 'cmake_(c|cxx)_flags.*-O[0-2g]'

Length of output: 410

@PhilipDeegan PhilipDeegan merged commit dd5a82d into PHAREHUB:master Oct 16, 2024
12 checks passed
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