From 8443a782709ee93fe9009908a6556cc832988b8a Mon Sep 17 00:00:00 2001 From: Adam Getchell Date: Mon, 6 Nov 2023 17:06:40 -0800 Subject: [PATCH] Update clang-format version to 17 and update compiler versions in Travis CI configuration file. Add a new function `debug_print_cells` to print time values of each vertex in the cell and the resulting cell info. Modify the script `clang-tidy.sh` to create a blank `.clang-tidy` file in the build directory to ignore Qt files causing warnings. --- .github/workflows/clang-format-check.yml | 2 +- .travis.yml | 30 ++++++++++++------------ include/Foliated_triangulation.hpp | 22 +++++++++++++++++ scripts/clang-tidy.sh | 5 ++-- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index a6f548e33..0c54c186e 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -14,6 +14,6 @@ jobs: - name: Run clang-format style check for C/C++/Protobuf programs. uses: jidicula/clang-format-action@v4.11.0 with: - clang-format-version: '16' + clang-format-version: '17' check-path: ${{ matrix.path }} fallback-style: 'Google' # optional \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index da1954827..a6369d324 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ addons: - libtool-bin - texinfo - yasm - - gcc-12 - - g++-12 - - clang-15 + - gcc-13 + - g++-13 + - clang-16 - ninja-build - cppcheck - doxygen @@ -33,22 +33,22 @@ os: - linux compiler: - - g++-12 - - clang-15 + - g++-13 + - clang-16 jobs: fast_finish: true include: # CppCheck - os: linux - compiler: g++-12 + compiler: g++-13 env: CPPCHECK=true before_script: - export CMAKE_ARGS="-D ENABLE_CPPCHECK:BOOL=TRUE" after_success: skip # Valgrind - os: linux - compiler: g++-12 + compiler: g++-13 env: VALGRIND=true before_script: - export CMAKE_ARGS="-D ENABLE_IPO:BOOL=FALSE -D ENABLE_VALGRIND:BOOL=TRUE" @@ -61,7 +61,7 @@ jobs: - travis_wait 30 valgrind --leak-check=full --show-leak-kinds=all --verbose ./cdt --s -n64 -t3 -a0.6 -k1.1 -l0.1 -p10 # AddressSanitizer and UndefinedBehaviorSanitizer - os: linux - compiler: clang-15 + compiler: clang-16 env: ASAN=true before_script: - export CMAKE_ARGS="-D ENABLE_SANITIZER_ADDRESS:BOOL=TRUE -D ENABLE_SANITIZER_UNDEFINED_BEHAVIOR:BOOL=TRUE" @@ -72,7 +72,7 @@ jobs: - ./initialize --s -n32000 -t11 -o # LeakSanitizer - os: linux - compiler: clang-15 + compiler: clang-16 env: LSAN=true before_script: - export CMAKE_ARGS="-D ENABLE_SANITIZER_LEAK:BOOL=TRUE" @@ -83,7 +83,7 @@ jobs: - ./initialize --s -n32000 -t11 -o # MemorySanitizer - os: linux - compiler: clang-15 + compiler: clang-16 env: MSAN=true before_script: - export CMAKE_ARGS="-D ENABLE_SANITIZER_MEMORY:BOOL=TRUE" @@ -94,7 +94,7 @@ jobs: - ./initialize --s -n32000 -t11 -o # ThreadSanitizer - os: linux - compiler: clang-15 + compiler: clang-16 env: TSAN=true before_script: - export CMAKE_ARGS="-D ENABLE_SANITIZER_THREAD:BOOL=TRUE" @@ -105,7 +105,7 @@ jobs: - ./initialize --s -n32000 -t11 -o # Doxygen - os: linux - compiler: g++-12 + compiler: g++-13 env: DOXYGEN=true install: skip script: @@ -128,12 +128,12 @@ jobs: condition: $TRAVIS_BRANCH =~ ^(master|develop)$ allow_failures: - os: linux - compiler: g++-12 + compiler: g++-13 env: DOXYGEN=true before_install: - - if [[ "$CXX" == "g++" ]]; then export CXX="g++-12" CC="gcc-12"; fi - - if [[ "$CXX" == "clang++" ]]; then export CXX="clang++-15" CC="clang-15"; fi + - if [[ "$CXX" == "g++" ]]; then export CXX="g++-13" CC="gcc-13"; fi + - if [[ "$CXX" == "clang++" ]]; then export CXX="clang++-16" CC="clang-16"; fi install: # vcpkg should be cached, but clone it if not diff --git a/include/Foliated_triangulation.hpp b/include/Foliated_triangulation.hpp index 9e04c4313..0c22d8a97 100644 --- a/include/Foliated_triangulation.hpp +++ b/include/Foliated_triangulation.hpp @@ -661,6 +661,28 @@ namespace foliated_triangulations } } // print_cells + /// @brief Write to debug log timevalues of each vertex in the cell and the + /// resulting cell->info + /// @tparam dimension The dimensionality of the simplices + /// @tparam Container The type of container + /// @param t_cells The cells to write to debug log + template + void debug_print_cells(Container&& t_cells) + { + for (auto cells = std::forward(t_cells); + auto const& cell : cells) + { + spdlog::debug("Cell info => {}\n", cell->info()); + for (int j = 0; j < dimension + 1; ++j) + { + spdlog::debug("Vertex({}) Point: ({}) Timevalue: {}\n", j, + utilities::point_to_str(cell->vertex(j)->point()), + cell->vertex(j)->info()); + } + spdlog::debug("---\n"); + } + } // debug_print_cells + /// @brief Print neighboring cells /// @tparam dimension The dimensionality of the simplices /// @param cell The cell to print neighbors of diff --git a/scripts/clang-tidy.sh b/scripts/clang-tidy.sh index 3fc7e76a1..bb1c7ce85 100755 --- a/scripts/clang-tidy.sh +++ b/scripts/clang-tidy.sh @@ -6,6 +6,7 @@ cd .. rm -rf build/ cmake -S . -B build -G Ninja -D ENABLE_CLANG_TIDY=ON -# Copy blank .clang-tidy into build directory to tell clang-tidy to ignore the Qt files which cause a lot of warnings -cmake -E copy cmake/.clang-tidy build/ +# Make blank .clang-tidy into build directory to tell clang-tidy to ignore the Qt files which cause a lot of warnings +touch build/.clang-tidy +#echo "Checks: '-*'" >> build/.clang-tidy cmake --build build