-
Notifications
You must be signed in to change notification settings - Fork 25
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
latest gcc path #855
latest gcc path #855
Conversation
WalkthroughThis update focuses on refining build and test workflows for both macOS and Ubuntu environments, consolidating file reading strategies in several test files, and streamlining parameter handling. Key modifications include changing library paths, updating build commands, enhancing debugging and memory checks, and rewriting loop structures to improve file reading efficiency. Changes
Sequence Diagram(s)There is no significant change in features or control flow, so sequence diagrams are not applicable for this update. 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/cmake_macos.yml (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/cmake_macos.yml
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/cmake_ubuntu.yml
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/cmake_macos.yml
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/cmake_ubuntu.yml
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- .github/workflows/cmake_macos.yml
- .github/workflows/cmake_ubuntu.yml
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- .github/workflows/cmake_macos.yml
- .github/workflows/cmake_ubuntu.yml
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- .github/workflows/cmake_macos.yml
- .github/workflows/cmake_ubuntu.yml
1acc25a
to
9773b86
Compare
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Additional comments not posted (7)
.github/workflows/cmake_macos.yml (4)
78-94
: Refined Build and Test Steps.The build and test steps have been specialized:
- The
LIBRARY_PATH
is explicitly set, which is crucial for resolving libraries during the build.- Use of
CTEST_OUTPUT_ON_FAILURE
ensures that any test failures are clearly logged, aiding in debugging.- The
cmake
command now specifiesRelWithDebInfo
for the build type, which includes both debugging symbols and optimizations, suitable for a release candidate.make test-GridLayout
and subsequent debugging withlldb
are specific to testing theGridLayout
component, which seems to be a focused testing strategy.These changes suggest a more detailed and tailored build process, likely improving build reliability and debuggability.
91-93
: Inclusion of Detailed Debugging Steps.The use of
lldb
with batch commands for debugging thetest-GridLayout
is a robust approach to diagnosing issues immediately after test execution. This will be particularly useful for catching and diagnosing failures on the fly.
24-24
: Updated dynamic library path for GCC.The path to the dynamic library for GCC on
macos-latest
has been updated to reflect the new version14.1.0_1
. Ensure that this path is correct and that the library exists at this location on the MacOS runners used by GitHub Actions.#!/bin/bash # Verify that the new GCC library path exists on MacOS runners. echo "Checking if the path /opt/homebrew/Cellar/gcc/14.1.0_1/lib/gcc/current exists:" if [ -d "/opt/homebrew/Cellar/gcc/14.1.0_1/lib/gcc/current" ]; then echo "Path exists." else echo "Path does not exist." fi
85-88
: Updated CMake Configuration Flags.The CMake flags have been adjusted to better suit the project's needs:
- The removal of optimization flags in
CMAKE_CXX_FLAGS
and focusing on diagnostic doubles indicates a shift towards more detailed debugging or diagnostics in the build.- The inclusion of
lowResourceTests=ON
suggests an adaptation for environments or scenarios where resources are constrained.These changes should be tested to ensure they do not adversely affect the build process or performance.
#!/bin/bash # Verify that the new CMake configuration does not introduce build errors. echo "Running a test build with the new CMake flags." cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DENABLE_SAMRAI_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DlowResourceTests=ON \ -DCMAKE_CXX_FLAGS="-DPHARE_DIAG_DOUBLES=1 " make.github/workflows/cmake_ubuntu.yml (3)
54-54
: Added GDB to the package installation list.Including
gdb
in the system dependencies is essential for enabling debugging capabilities in the build environment. This addition will help in diagnosing issues during development and testing.
77-85
: Refined CMake Configuration.The CMake configuration has been updated to include:
RelWithDebInfo
as the build type, which is appropriate for release candidates that require debugging.- The addition of
-Dasan=OFF
suggests that AddressSanitizer is explicitly disabled, possibly due to compatibility issues or to optimize build time and resource usage.- The inclusion of development and benchmarking flags (
-DdevMode=ON -Dbench=ON
) indicates a focus on development and performance testing.These changes seem well thought out to balance development needs with performance and debugging capabilities.
91-97
: Inclusion of Detailed Debugging Steps.The use of
gdb
with batch commands for debugging thetest-GridLayout
mirrors the approach taken withlldb
in the MacOS workflow. This consistency in debugging approach across platforms is commendable and aids in maintaining uniformity in debugging practices.
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Additional comments not posted (5)
.github/workflows/cmake_macos.yml (3)
24-24
: Updated library path for MacOS appears correct.The change to the
dylib_path
reflects the updated GCC version path. This is consistent with the PR's goal to update paths for the latest GCC.
78-78
: Configuration updates in the build/test step are appropriate.The use of
LIBRARY_PATH
to include the updateddylib_path
ensures that the correct library versions are used during the build and test processes. Additionally, settingCTEST_OUTPUT_ON_FAILURE
to 1 is a good practice as it will provide more detailed logs if tests fail.Also applies to: 82-82
86-89
: Refined CMake configuration and enhanced debugging in test commands.Switching to
RelWithDebInfo
for the build type provides a balance between release optimizations and debug information, which is suitable for a development build. Usinglldb
for debugging thetest-GridLayout
enhances the troubleshooting capabilities during testing.Also applies to: 96-97
.github/workflows/cmake_ubuntu.yml (2)
54-54
: Addition of gdb installation is appropriate for debugging purposes.Installing
gdb
along with other system dependencies ensures that debugging tools are available if needed, aligning with the PR's focus on enhancing development and debugging capabilities.
77-77
: Updated CMake configurations and build/test steps enhance flexibility and debugging.The shift to
RelWithDebInfo
is a strategic choice for development builds as it includes both optimizations and debug information. The addition ofasan=OFF
and other flags tailored to development needs (likedevMode
andbench
) are thoughtful inclusions for a more robust build environment. Usinggdb
for debugging in the test commands is consistent with the added installation ofgdb
and enhances the ability to diagnose issues during testing.Also applies to: 82-86, 100-100
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- .github/workflows/cmake_macos.yml
- .github/workflows/cmake_ubuntu.yml
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- .github/workflows/cmake_macos.yml
- .github/workflows/cmake_ubuntu.yml
5de3b61
to
069300a
Compare
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: 2
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
Additional comments not posted (4)
.github/workflows/cmake_macos.yml (2)
78-95
: Enhancements to the CMake configuration for MacOS.The CMake command now includes several additional flags aimed at improving the build process, such as
RelWithDebInfo
for more detailed debugging information and specific compiler flags. These changes are well-suited for a development environment focusing on detailed logs and performance.
95-95
: Updatedctest
configuration.The
ctest
command now runs with fewer parallel jobs and provides verbose output, which is beneficial for identifying issues during testing. This change enhances the visibility into test failures..github/workflows/cmake_ubuntu.yml (2)
115-115
: Updatedctest
configuration.The
ctest
command now runs with fewer parallel jobs and provides verbose output, which is beneficial for identifying issues during testing. This change enhances the visibility into test failures.
54-54
: Addition ofgdb
to system dependencies.The inclusion of
gdb
in the system dependencies is a sensible addition for debugging purposes. This change should enhance the ability to diagnose issues during development.
6732deb
to
b71912f
Compare
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 (4)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
- tests/core/data/gridlayout/gridlayout_cell_centered_coord.hpp (1 hunks)
- tests/core/data/gridlayout/gridlayout_params.hpp (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/cmake_macos.yml
Additional context used
Path-based instructions (2)
tests/core/data/gridlayout/gridlayout_params.hpp (1)
Pattern
**/*.hpp
: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.tests/core/data/gridlayout/gridlayout_cell_centered_coord.hpp (1)
Pattern
**/*.hpp
: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.
Additional comments not posted (3)
tests/core/data/gridlayout/gridlayout_params.hpp (1)
68-74
: Refactor thewriteToArray
function to improve robustness and error handling.The change from a void return type to a boolean is a significant improvement as it allows the function to signal failure to read from the stream, enhancing error handling in the calling code. However, ensure that all callers of this function properly handle the returned boolean to avoid ignoring potential errors.
.github/workflows/cmake_ubuntu.yml (1)
54-54
: Addition of GDB to system dependencies.The inclusion of GDB in the system dependencies is a good practice for enabling debugging capabilities, especially in a CI environment where diagnosing issues might be more challenging. Ensure that this addition aligns with the project's needs and doesn't introduce unnecessary overhead.
tests/core/data/gridlayout/gridlayout_cell_centered_coord.hpp (1)
117-120
: Refactor thecreateCellCenteringParam
function to enhance readability and maintainability.The refactoring to use a while loop with the
writeToArray
function is a good practice as it ensures that the function continues to process data as long as there are valid entries to read. This change likely improves the robustness of data handling. However, ensure that the loop's exit condition is well-tested to prevent potential infinite loops or missed data entries.
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: 2
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (7)
- .github/workflows/cmake_macos.yml (2 hunks)
- .github/workflows/cmake_ubuntu.yml (3 hunks)
- tests/core/data/gridlayout/gridlayout_allocsize.hpp (1 hunks)
- tests/core/data/gridlayout/gridlayout_cell_centered_coord.hpp (1 hunks)
- tests/core/data/gridlayout/gridlayout_field_centered_coord.hpp (2 hunks)
- tests/core/data/gridlayout/gridlayout_indexing.hpp (1 hunks)
- tests/core/data/gridlayout/gridlayout_params.hpp (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- .github/workflows/cmake_macos.yml
- .github/workflows/cmake_ubuntu.yml
- tests/core/data/gridlayout/gridlayout_cell_centered_coord.hpp
- tests/core/data/gridlayout/gridlayout_params.hpp
Additional context used
Path-based instructions (3)
tests/core/data/gridlayout/gridlayout_allocsize.hpp (1)
Pattern
**/*.hpp
: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.tests/core/data/gridlayout/gridlayout_indexing.hpp (1)
Pattern
**/*.hpp
: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.tests/core/data/gridlayout/gridlayout_field_centered_coord.hpp (1)
Pattern
**/*.hpp
: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.
Additional comments not posted (1)
tests/core/data/gridlayout/gridlayout_allocsize.hpp (1)
75-76
: Refactor suggestion for reading loop increateAllocSizeParam
.The loop correctly reads
iQuantity
from the input file, which is a good practice as it handles the EOF correctly. However, there's potential to improve the error handling and robustness of the loop.
[REFACTOR_SUGGESTion]
Consider checking the result ofwriteToArray
to ensure that data is correctly read before using it. This can prevent issues when the input file is not in the expected format.- writeToArray(inputFile, numberCells); - writeToArray(inputFile, dl); + if (!writeToArray(inputFile, numberCells) || !writeToArray(inputFile, dl)) { + throw std::runtime_error("Failed to read numberCells or dl from the input file."); + }
std::uint32_t iQuantity; | ||
while (inputFile >> iQuantity) |
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.
Refactor suggestion for reading loop in createIndexingParam
.
The loop structure is improved to handle EOF correctly. However, similar to the previous file, adding error checks after writeToArray
calls can significantly improve the robustness.
- writeToArray(inputFile, numberCells);
- writeToArray(inputFile, dl);
+ if (!writeToArray(inputFile, numberCells) || !writeToArray(inputFile, dl)) {
+ throw std::runtime_error("Failed to read numberCells or dl from the input file.");
+ }
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
std::uint32_t iQuantity; | |
while (inputFile >> iQuantity) | |
std::uint32_t iQuantity; | |
while (inputFile >> iQuantity) { | |
if (!writeToArray(inputFile, numberCells) || !writeToArray(inputFile, dl)) { | |
throw std::runtime_error("Failed to read numberCells or dl from the input file."); | |
} | |
} |
std::string quantity; | ||
while (summary >> quantity) |
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.
Optimize data reading and error handling in createFieldCenteringParam
.
The loop structures in this file are well-designed to handle EOF and read data efficiently. However, there's a lack of error handling after data reading, which is critical for robust applications.
- writeToArray(summary, nbCell);
- writeToArray(summary, dl);
- writeToArray(summary, iStart);
- writeToArray(summary, iEnd);
- writeToArray(summary, origin);
+ if (!writeToArray(summary, nbCell) || !writeToArray(summary, dl) || !writeToArray(summary, iStart) || !writeToArray(summary, iEnd) || !writeToArray(summary, origin)) {
+ throw std::runtime_error("Failed to read parameters from summary file.");
+ }
- writeToArray(value, icell);
- writeToArray(value, realPosition);
+ if (!writeToArray(value, icell) || !writeToArray(value, realPosition)) {
+ throw std::runtime_error("Failed to read icell or realPosition from value file.");
+ }
This ensures that your function does not proceed with potentially corrupted or incomplete data, increasing the reliability of your application.
Also applies to: 125-128
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (7)
- .github/workflows/cmake_macos.yml (3 hunks)
- .github/workflows/cmake_ubuntu.yml (2 hunks)
- tests/core/data/gridlayout/gridlayout_allocsize.hpp (1 hunks)
- tests/core/data/gridlayout/gridlayout_cell_centered_coord.hpp (1 hunks)
- tests/core/data/gridlayout/gridlayout_field_centered_coord.hpp (2 hunks)
- tests/core/data/gridlayout/gridlayout_indexing.hpp (1 hunks)
- tests/core/data/gridlayout/gridlayout_params.hpp (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- .github/workflows/cmake_macos.yml
- .github/workflows/cmake_ubuntu.yml
- tests/core/data/gridlayout/gridlayout_allocsize.hpp
- tests/core/data/gridlayout/gridlayout_cell_centered_coord.hpp
- tests/core/data/gridlayout/gridlayout_field_centered_coord.hpp
- tests/core/data/gridlayout/gridlayout_indexing.hpp
- tests/core/data/gridlayout/gridlayout_params.hpp
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/cmake_macos.yml (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/cmake_macos.yml
see #854
Summary by CodeRabbit