-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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
📒 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 DebugThe build type for SAMRAI has been changed from RelWithDebInfo to Debug. This change might have the following implications:
- Slower performance due to reduced optimizations.
- Larger binary size.
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
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:
- Align Optimization Flags: Use a consistent optimization level across all CMake configurations, such as
RelWithDebInfo
, to balance performance and debuggability. - 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:
- SAMRAI is built with Debug configuration (typically -O0 or -Og).
- 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:
- If performance is critical, use RelWithDebInfo for both SAMRAI and the main project.
- If debugging is the priority, remove the -O3 flag and use Debug consistently.
- 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
Summary by CodeRabbit