-
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
Feature/c++23 #76
Feature/c++23 #76
Changes from all commits
074caa6
aa24f09
23d35ba
0b05e22
a05dbdc
8a49ea0
3721dea
bec7526
1fbb7fe
9a4c860
9228f3c
906833d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,11 @@ cache: | |
- $TRAVIS_BUILD_DIR/vcpkg | ||
- $HOME/.cache/vcpkg/archives | ||
|
||
# Don't double build branch PRs | ||
branches: | ||
except: | ||
- /^pr\..*/ | ||
|
||
addons: | ||
apt: | ||
update: true | ||
|
@@ -21,21 +26,21 @@ addons: | |
- yasm | ||
- gcc-12 | ||
- g++-12 | ||
- clang-15 | ||
- ninja-build | ||
- cppcheck | ||
- doxygen | ||
- graphviz | ||
- lcov | ||
- valgrind | ||
- ccache | ||
- wget | ||
|
||
os: | ||
- linux | ||
|
||
compiler: | ||
- g++-12 | ||
- clang-15 | ||
- clang-19 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Clang version updated, but g++ version requires updating. The update to Analysis chainClang version updated, but g++ version might need attention. The update to To check the g++ version references, run: Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
echo "g++ version references:"
rg 'g\+\+-\d+' .travis.yml
Length of output: 613 |
||
|
||
jobs: | ||
fast_finish: true | ||
|
@@ -141,9 +146,14 @@ before_install: | |
fi | ||
- | | ||
if [[ "$CXX" == "clang++" ]]; then | ||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 90 | ||
sudo update-alternatives --config clang | ||
export CXX="clang++-15" CC="clang-15" | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh 19 | ||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100 | ||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100 | ||
export CXX="clang++-19" CC="clang-19" | ||
clang --version | ||
clang++ --version | ||
fi | ||
|
||
install: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
"binaryDir": "${sourceDir}/build", | ||
"cacheVariables": { | ||
"CMAKE_CXX_EXTENSIONS": "OFF", | ||
"CMAKE_CXX_STANDARD": "20", | ||
"CMAKE_CXX_STANDARD": "23", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification CMake is not installed in the CI environment The CI environment lacks CMake, which is essential for building the project with the updated C++23 standard. This absence is causing all preset builds to fail.
Analysis chainApproved: C++ standard updated to C++23 The change from C++20 to C++23 aligns with the PR objective of updating the project to utilize C++23 features. This update in the "ci-std" preset will propagate to all configurations that inherit from it. To ensure compatibility across different build environments, please verify that all targeted compilers and platforms fully support C++23. You may want to run the following command in your CI pipeline to check compiler support: If any issues arise, consider adding conditional logic to fall back to C++20 for environments that don't yet fully support C++23. [/run_scripts] Scripts executedThe following scripts were executed for the analysis: Script: cmake --preset=ci-std && cmake --build build
Length of output: 3515 Script: #!/bin/bash
# Check if cmake is installed
if command -v cmake >/dev/null 2>&1; then
cmake --version
else
echo "CMake is not installed."
exit 1
fi
Length of output: 84 |
||
"CMAKE_CXX_STANDARD_REQUIRED": "ON" | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ endif() | |
set(BOOST_MIN_VERSION "1.75.0") | ||
|
||
# Use C++20 | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD 23) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Potential Compatibility Issues with The upgrade to C++23 introduces potential compatibility concerns:
Analysis chainUpgrade to C++23 standard The C++ standard has been updated from C++20 to C++23, which aligns with the PR objectives. This change brings access to the latest C++ features and improvements. However, there are a few considerations:
To verify compiler support and potential issues, run the following script: Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check C++23 support in the project
# Test: Check if CMake is configured to use C++23 in other files
echo "Checking for C++23 configuration in other CMake files:"
rg --type cmake "set\(CMAKE_CXX_STANDARD" -g "!StandardProjectSettings.cmake"
# Test: Look for compiler version checks that might need updating
echo "Checking for compiler version checks:"
rg --type cmake "CMAKE_CXX_COMPILER_VERSION|gcc.*version|clang.*version"
# Test: Check for any explicit C++20 flags that might need updating
echo "Checking for explicit C++20 flags:"
rg --type cmake "std=c\+\+20|-std=c\+\+20"
# Test: Look for potential compatibility issues in the code
echo "Checking for potential C++23 compatibility issues:"
rg --type cpp "std::expected|<expected>|std::generator|<generator>|std::mdspan|<mdspan>"
Length of output: 477 Script: #!/bin/bash
# Description: Check C++23 support in the project
# Test: Check if CMake is configured to use C++23 in other files
echo "Checking for C++23 configuration in other CMake files:"
rg --type cmake 'set\(CMAKE_CXX_STANDARD\s+23\)' --ignore-file StandardProjectSettings.cmake
# Test: Look for compiler version checks that might need updating
echo "Checking for compiler version checks:"
rg --type cmake 'CMAKE_CXX_COMPILER_VERSION|gcc\s+version|clang\s+version'
# Test: Check for any explicit C++20 flags that might need updating
echo "Checking for explicit C++20 flags:"
rg --type cmake 'std=c\+\+20|-std=c\+\+20'
# Test: Look for potential compatibility issues in the code
echo "Checking for potential C++23 compatibility issues:"
rg --type cpp 'std::expected|<expected>|std::generator|<generator>|std::mdspan|<mdspan>'
Length of output: 1310 Script: #!/bin/bash
# Description: Investigate sources and usages of specific C++ constructs
# Test: Identify files where 'std::expected' is defined or implemented
echo "Searching for definitions of 'std::expected':"
rg --type cpp 'std::expected' --search-zip
# Test: Identify if 'std::generator' and 'std::mdspan' are used from external libraries
echo "Searching for 'std::generator' and 'std::mdspan' usages from external sources:"
rg --type cpp 'std::generator|std::mdspan' | rg -v 'std::'
# Test: Check for external library dependencies that might provide these features
echo "Searching for Boost or other libraries that provide 'expected', 'generator', or 'mdspan':"
rg --files-with-matches 'Boost' --type cmake
rg --files-with-matches 'find_package\(Boost' --type cmake
Length of output: 1121 |
||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,29 +11,29 @@ | |
#ifndef CDT_PLUSPLUS_APPLY_MOVE_HPP | ||
#define CDT_PLUSPLUS_APPLY_MOVE_HPP | ||
|
||
#include <spdlog/spdlog.h> | ||
|
||
#include <expected> | ||
#include <string> | ||
#include <tl/expected.hpp> | ||
#include <tl/function_ref.hpp> | ||
|
||
/// @brief An applicative function similar to std::apply, but on manifolds | ||
/// @tparam ManifoldType The type (topology, dimensionality) of manifold | ||
/// @tparam ExpectedType The result of the move on the manifold | ||
/// @tparam FunctionType The type of move applied to the manifold | ||
/// @param t_manifold The manifold on which to make the Pachner move | ||
/// @param t_move The Pachner move | ||
/// @returns The expected or unexpected result in a tl::expected<T,E> | ||
/// @see https://tl.tartanllama.xyz/en/latest/api/function_ref.html | ||
/// @see https://tl.tartanllama.xyz/en/latest/api/expected.html | ||
/** | ||
* \brief An applicative function similar to std::apply on a manifold | ||
* \tparam ManifoldType The type (topology, dimensionality) of manifold | ||
* \tparam ExpectedType The result type of the move on the manifold | ||
* \tparam FunctionType The type of move applied to the manifold | ||
* \param t_manifold The manifold on which to make the Pachner move | ||
* \param t_move The Pachner move | ||
* \return The expected or unexpected result in a std::expected<T,E> | ||
*/ | ||
template <typename ManifoldType, | ||
typename ExpectedType = tl::expected<ManifoldType, std::string>, | ||
typename ExpectedType = std::expected<ManifoldType, std::string>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Missing C++23 Compiler in Build Environment The build configuration correctly sets Actions to Resolve:
Analysis chainUpdate to The change from To resolve this:
Let's verify the current compiler and C++ standard setting: If the compiler version is insufficient or the C++ standard is not set to 23, please update accordingly. Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check compiler version and C++ standard setting
if command -v g++ &> /dev/null; then
echo "GCC version:"
g++ --version | head -n 1
elif command -v clang++ &> /dev/null; then
echo "Clang version:"
clang++ --version | head -n 1
fi
echo "Checking C++ standard setting in CMakeLists.txt:"
grep -n "set(CMAKE_CXX_STANDARD" CMakeLists.txt
Length of output: 194 Script: #!/bin/bash
# Search for CMAKE_CXX_STANDARD in all CMakeLists.txt files
echo "Searching for CMAKE_CXX_STANDARD settings in all CMakeLists.txt files:"
rg "set\s*\(\s*CMAKE_CXX_STANDARD" --type cmake
# Search for compiler flags that set the C++ standard
echo "Searching for compiler flags that set the C++ standard (e.g., -std=c++23):"
rg "-std=c\+\+23" --type cmake
Length of output: 924 Script: #!/bin/bash
# Search for CMAKE_CXX_STANDARD in all CMakeLists.txt files
echo "Searching for CMAKE_CXX_STANDARD settings in all CMakeLists.txt files:"
rg "set\s*\(\s*CMAKE_CXX_STANDARD\s+23\s*\)" --type cmake
# Search for compiler flags that set the C++ standard
echo "Searching for compiler flags that set the C++ standard (e.g., -std=c++23):"
rg "-std=c\+\+23" --type cmake
Length of output: 862 Script: #!/bin/bash
# Search for CMAKE_CXX_STANDARD in all CMakeLists.txt files
echo "Searching for CMAKE_CXX_STANDARD settings in all CMakeLists.txt files:"
rg "set\s*\(\s*CMAKE_CXX_STANDARD\s+23\s*\)" --type cmake
# Correctly search for compiler flags that set the C++ standard
echo "Searching for compiler flags that set the C++ standard (e.g., -std=c++23):"
rg '-std=c\+\+23' --type cmake
# Additionally, search for CMAKE_CXX_FLAGS that might include the C++23 standard
echo "Searching for CMAKE_CXX_FLAGS that include the C++23 standard:"
rg "CMAKE_CXX_FLAGS.*-std=c\+\+23" --type cmake
Length of output: 1047 Script: #!/bin/bash
# Search for the C++ compiler set in CMake files
echo "Searching for CMAKE_CXX_COMPILER settings in all CMakeLists.txt files:"
rg "set\s*\(\s*CMAKE_CXX_COMPILER\s+" --type cmake
# If a compiler is found, display its version
echo "Checking the version of the specified C++ compiler:"
COMPILER=$(rg "set\s*\(\s*CMAKE_CXX_COMPILER\s+" --type cmake | awk -F'"' '{print $2}' | head -n 1)
if [ -n "$COMPILER" ]; then
if [ -x "$COMPILER" ]; then
$COMPILER --version | head -n 1
else
echo "Compiler path '$COMPILER' is not executable or does not exist."
fi
else
# If no compiler is explicitly set, check the default compiler
echo "No explicit C++ compiler set in CMake files. Checking default compiler:"
if command -v g++ &> /dev/null; then
echo "GCC version:"
g++ --version | head -n 1
elif command -v clang++ &> /dev/null; then
echo "Clang version:"
clang++ --version | head -n 1
else
echo "No default C++ compiler (g++ or clang++) found in the environment."
fi
fi
# Verify the C++ standard setting in CMake
echo "Verifying CMAKE_CXX_STANDARD is set to 23:"
rg "set\s*\(\s*CMAKE_CXX_STANDARD\s+23\s*\)" --type cmake
Length of output: 989 ToolsGitHub Check: build
|
||
typename FunctionType = tl::function_ref<ExpectedType(ManifoldType&)>> | ||
auto constexpr apply_move(ManifoldType&& t_manifold, | ||
FunctionType t_move) noexcept -> decltype(auto) | ||
{ | ||
if (auto result = std::invoke(t_move, std::forward<ManifoldType>(t_manifold)); | ||
Check failure on line 35 in include/Apply_move.hpp GitHub Actions / build
Check failure on line 35 in include/Apply_move.hpp GitHub Actions / build
Check failure on line 35 in include/Apply_move.hpp GitHub Actions / build
|
||
result) | ||
result.has_value()) | ||
{ | ||
return result; | ||
} | ||
|
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.
Tip
Codebase Verification
Adjust Workflow Triggers to 'develop' Branch Only
It has been verified that the
main
branch does not exist in the repository. Please update the workflow triggers to exclusively include thedevelop
branch:develop
branch.develop
branch.This alignment ensures that clang-format checks are executed on the correct and existing branch, optimizing your CI/CD processes.
Analysis chain
Workflow trigger optimization looks good, but verify branch strategy.
The changes to the workflow triggers are well-structured and more targeted:
This approach is generally beneficial as it:
To ensure this aligns with your project's branching strategy, please run the following script:
This script will help verify if the 'main' and 'develop' branches are indeed the primary branches used in your repository, and if there are any other frequently used branches that might need to be included in the workflow triggers.
Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 795