From af3a9fdcf07e68288996ffbf2137f53f00db5399 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 15:40:11 +0200 Subject: [PATCH 1/9] [INFRA] Update CI --- .github/workflows/ci_asan.yml | 79 +++++++++++++ .github/workflows/ci_header.yml | 93 +++++++++++++++ .github/workflows/ci_linux.yml | 193 +++++++------------------------- .github/workflows/ci_macos.yml | 136 ++++++---------------- .github/workflows/lint.yml | 9 +- 5 files changed, 247 insertions(+), 263 deletions(-) create mode 100644 .github/workflows/ci_asan.yml create mode 100644 .github/workflows/ci_header.yml diff --git a/.github/workflows/ci_asan.yml b/.github/workflows/ci_asan.yml new file mode 100644 index 00000000..2feae8b2 --- /dev/null +++ b/.github/workflows/ci_asan.yml @@ -0,0 +1,79 @@ +name: ASAN + +on: + push: + branches: + # Push events to branches matching refs/heads/master + - 'master' + pull_request: + # Enables a manual trigger, may run on any branch + workflow_dispatch: + +concurrency: + group: asan-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + TZ: Europe/Berlin + +defaults: + run: + shell: bash -Eexuo pipefail {0} + +jobs: + build: + name: ${{ matrix.name }} + runs-on: ubuntu-22.04 + timeout-minutes: 120 + if: github.repository_owner == 'xxsds' || github.event_name == 'workflow_dispatch' + strategy: + fail-fast: false + matrix: + include: + - name: "gcc13" + compiler: "gcc-13" + cxx_flags: "-std=c++23" + + - name: "clang16" + compiler: "clang-16" + cxx_flags: "-std=c++2b" + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + submodules: true + + - name: Setup toolchain + uses: seqan/actions/setup-toolchain@main + with: + compiler: ${{ matrix.compiler }} + ccache_size: 125M + + - name: Install CMake + uses: seqan/actions/setup-cmake@main + with: + cmake: 3.12.4 + + - name: Configure tests + run: | + mkdir ci-build + cd ci-build + cmake .. -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_FLAGS="-pedantic -Wall -Wextra -Werror -fsanitize=address ${{ matrix.cxx_flags }}" + make -j2 gtest_build + + - name: Build tests + run: | + ccache -p + cd ci-build + make sdsl_test_targets sdsl_examples sdsl_tutorials -k -j2 + ccache -s + + - name: Run tests + run: | + cd ci-build + ctest . -j2 -E 'faust|moby' -R '-im' diff --git a/.github/workflows/ci_header.yml b/.github/workflows/ci_header.yml new file mode 100644 index 00000000..bfe7d992 --- /dev/null +++ b/.github/workflows/ci_header.yml @@ -0,0 +1,93 @@ +name: Header + +on: + push: + branches: + # Push events to branches matching refs/heads/master + - 'master' + pull_request: + # Enables a manual trigger, may run on any branch + workflow_dispatch: + +concurrency: + group: header-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + TZ: Europe/Berlin + +defaults: + run: + shell: bash -Eexuo pipefail {0} + +jobs: + build: + name: ${{ matrix.name }} + runs-on: ubuntu-22.04 + timeout-minutes: 120 + if: github.repository_owner == 'xxsds' || github.event_name == 'workflow_dispatch' + strategy: + fail-fast: false + matrix: + include: + - name: "gcc13" + compiler: "gcc-13" + build_type: Release + cxx_flags: "-std=c++23" + + - name: "gcc11" + compiler: "gcc-13" + build_type: Debug + cxx_flags: "-std=c++23" + + - name: "clang16" + compiler: "clang-16" + build_type: Release + cxx_flags: "-std=c++2b" + + - name: "clang14" + compiler: "clang-14" + build_type: Debug + cxx_flags: "-std=c++20" + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + submodules: true + + - name: Setup toolchain + uses: seqan/actions/setup-toolchain@main + with: + compiler: ${{ matrix.compiler }} + ccache_size: 75M + + - name: Install CMake + uses: seqan/actions/setup-cmake@main + with: + cmake: 3.12.4 + + - name: Configure tests + run: | + mkdir ci-build + cd ci-build + cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_FLAGS="-pedantic -Wall -Wextra -Werror ${{ matrix.cxx_flags }}" \ + -DSDSL_CEREAL=1 \ + -DSDSL_HEADER_TEST=ON + make -j2 gtest_build + + - name: Build tests + run: | + ccache -p + cd ci-build + make sdsl_header_test -k -j2 + ccache -s + + - name: Run tests + run: | + cd ci-build + ctest . -j2 diff --git a/.github/workflows/ci_linux.yml b/.github/workflows/ci_linux.yml index 5c10fa45..f34f286c 100644 --- a/.github/workflows/ci_linux.yml +++ b/.github/workflows/ci_linux.yml @@ -1,4 +1,4 @@ -name: CI on Linux +name: Linux on: push: @@ -14,12 +14,11 @@ concurrency: cancel-in-progress: true env: - CMAKE_VERSION: 3.12.4 TZ: Europe/Berlin defaults: run: - shell: bash -ex {0} + shell: bash -Eexuo pipefail {0} jobs: build: @@ -31,195 +30,85 @@ jobs: fail-fast: false matrix: include: - - name: "gcc12" - cxx: "g++-12" - cc: "gcc-12" + - name: "gcc13" + compiler: "gcc-13" build_type: Release - build_threads: 2 - test_threads: 2 cxx_flags: "-std=c++23" - - name: "Header gcc12" - cxx: "g++-12" - cc: "gcc-12" - build_type: Release - build_threads: 2 - test_threads: 2 - cxx_flags: "-std=c++23" - header_test: "ON" - - - name: "ASAN gcc12" - cxx: "g++-12" - cc: "gcc-12" - build_type: Debug - build_threads: 2 - test_threads: 2 - cxx_flags: "-std=c++23 -fsanitize=address" - ctest_exclude: "-E 'faust|moby'" - ctest_include: "-R '-im'" - - - name: "cereal gcc12" - cxx: "g++-12" - cc: "gcc-12" + - name: "cereal gcc13" + compiler: "gcc-13" build_type: Release - build_threads: 2 - test_threads: 2 cxx_flags: "-std=c++23" has_cereal: "1" - - name: "gcc11" - cxx: "g++-11" - cc: "gcc-11" + - name: "gcc12" + compiler: "gcc-12" build_type: Release - build_threads: 2 - test_threads: 2 cxx_flags: "-std=c++23" - - name: "gcc10" - cxx: "g++-10" - cc: "gcc-10" + - name: "gcc11" + compiler: "gcc-11" build_type: Release - build_threads: 2 - test_threads: 2 - cxx_flags: "-std=c++20" + cxx_flags: "-std=c++23" - - name: "clang14" - cxx: "clang++-14" - cc: "clang-14" + - name: "clang16" + compiler: "clang-16" build_type: Release - build_threads: 2 - test_threads: 2 cxx_flags: "-std=c++2b" - - name: "Header clang14" - cxx: "clang++-14" - cc: "clang-14" - build_type: Release - build_threads: 2 - test_threads: 2 - cxx_flags: "-std=c++2b" - header_test: "ON" - - - name: "ASAN clang14" - cxx: "clang++-14" - cc: "clang-14" - build_type: Debug - build_threads: 2 - test_threads: 2 - cxx_flags: "-std=c++2b -fsanitize=address" - ctest_exclude: "-E 'faust|moby'" - ctest_include: "-R '-im'" - - - name: "cereal clang14" - cxx: "clang++-14" - cc: "clang-14" + - name: "cereal clang16" + compiler: "clang-16" build_type: Release - build_threads: 2 - test_threads: 2 cxx_flags: "-std=c++2b" has_cereal: "1" - - name: "clang13" - cxx: "clang++-13" - cc: "clang-13" + - name: "clang15" + compiler: "clang-15" build_type: Release - build_threads: 2 - test_threads: 2 cxx_flags: "-std=c++2b" - - name: "clang12" - cxx: "clang++-12" - cc: "clang-12" + - name: "clang14" + compiler: "clang-14" build_type: Release - build_threads: 2 - test_threads: 2 cxx_flags: "-std=c++20" steps: - - name: Checkout SDSL + - name: Checkout uses: actions/checkout@v3 with: - path: sdsl - fetch-depth: 2 + fetch-depth: 1 submodules: true - - name: Checkout SeqAn3 - uses: actions/checkout@v3 + - name: Setup toolchain + uses: seqan/actions/setup-toolchain@main with: - repository: seqan/seqan3 - ref: 39e696830bbdcde0e520c87811db3eb5e083d7c0 - path: seqan3 - fetch-depth: 1 - submodules: false - - - name: Configure APT - continue-on-error: true - run: bash ./seqan3/.github/workflows/scripts/configure_apt.sh + compiler: ${{ matrix.compiler }} + ccache_size: 75M - name: Install CMake - run: bash ./seqan3/.github/workflows/scripts/install_cmake.sh - - - name: Install ccache - run: sudo apt-get install --yes ccache - - - name: Install compiler ${{ matrix.cxx }} - run: sudo apt-get install --yes ${{ matrix.cxx }} - - - name: Load ccache - uses: actions/cache@v3 + uses: seqan/actions/setup-cmake@main with: - path: .ccache - key: ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.ref }}-${{ github.run_number }} - # Restoring: From current branch, otherwise from base branch, otherwise from any branch. - restore-keys: | - ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.ref }} - ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.base_ref }} - ${{ runner.os }}-${{ matrix.name }}-ccache- - - - name: Tool versions - run: | - env cmake --version - env ${{ matrix.cxx }} --version + cmake: 3.12.4 - name: Configure tests - env: - CXX: ${{ matrix.cxx }} - CC: ${{ matrix.cc }} run: | - mkdir sdsl-build - cd sdsl-build - cmake ../sdsl -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_FLAGS="-pedantic -Wall -Wextra -Werror ${{ matrix.cxx_flags }}" \ - -DSDSL_CEREAL=${{ matrix.has_cereal }} \ - -DSDSL_HEADER_TEST=${{ matrix.header_test }} - make -j${{ matrix.build_threads }} gtest_build + mkdir ci-build + cd ci-build + cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_FLAGS="-pedantic -Wall -Wextra -Werror ${{ matrix.cxx_flags }}" \ + -DSDSL_CEREAL=${{ matrix.has_cereal }} + make -j2 gtest_build - name: Build tests - env: - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: ${{ github.workspace }}/.ccache - CCACHE_COMPRESS: true - CCACHE_COMPRESSLEVEL: 6 - CCACHE_MAXSIZE: 100M - CCACHE_IGNOREHEADERS: ${{ github.workspace }}/sdsl/include/sdsl/structure_tree.hpp run: | - ccache -p || true - cd sdsl-build - if [[ "${{ matrix.header_test }}" == "ON" ]]; then - make sdsl_header_test -k -j${{ matrix.build_threads }} - else - make sdsl_test_targets sdsl_examples sdsl_tutorials -k -j${{ matrix.build_threads }} - fi - ccache -s || true + ccache -p + cd ci-build + make sdsl_test_targets sdsl_examples sdsl_tutorials -k -j2 + ccache -s - name: Run tests run: | - cd sdsl-build - ctest . -j${{ matrix.test_threads }} \ - ${{ matrix.ctest_exclude }} \ - ${{ matrix.ctest_include }} \ - || ctest . -j${{ matrix.test_threads }} \ - --output-on-failure \ - --rerun-failed + cd ci-build + ctest . -j2 diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index 8b526431..8d8dcf91 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -1,4 +1,4 @@ -name: CI on macOS +name: macOS on: push: @@ -14,12 +14,11 @@ concurrency: cancel-in-progress: true env: - CMAKE_VERSION: 3.12.4 TZ: Europe/Berlin defaults: run: - shell: bash -ex {0} + shell: bash -Eexuo pipefail {0} jobs: build: @@ -31,135 +30,64 @@ jobs: fail-fast: false matrix: include: - - name: "clang13" - cxx: "clang++-13" - cc: "clang-13" + - name: "clang16" + compiler: "clang-16" build_type: Release - build_threads: 3 - test_threads: 3 cxx_flags: "-std=c++2b" - - name: "ASAN clang13" - cxx: "clang++-13" - cc: "clang-13" - build_type: Debug - build_threads: 3 - test_threads: 3 - cxx_flags: "-std=c++20 -fsanitize=address" - ctest_exclude: "-E 'faust|moby'" - ctest_include: "-R '-im'" - - - name: "cereal clang13" - cxx: "clang++-13" - cc: "clang-13" + - name: "cereal clang16" + compiler: "clang-16" build_type: Release - build_threads: 3 - test_threads: 3 cxx_flags: "-std=c++2b" has_cereal: "1" - - name: "clang12" - cxx: "clang++-12" - cc: "clang-12" + - name: "clang15" + compiler: "clang-15" build_type: Release - build_threads: 3 - test_threads: 3 cxx_flags: "-std=c++2b" - - name: "clang11" - cxx: "clang++-11" - cc: "clang-11" + - name: "clang14" + compiler: "clang-14" build_type: Release - build_threads: 3 - test_threads: 3 cxx_flags: "-std=c++20" steps: - - name: Checkout SDSL + - name: Checkout uses: actions/checkout@v3 with: - path: sdsl - fetch-depth: 2 + fetch-depth: 1 submodules: true - - name: Checkout SeqAn3 - uses: actions/checkout@v3 + - name: Setup toolchain + uses: seqan/actions/setup-toolchain@main with: - repository: seqan/seqan3 - ref: 39e696830bbdcde0e520c87811db3eb5e083d7c0 - path: seqan3 - fetch-depth: 1 - submodules: false - - - name: Configure Homebrew - uses: Homebrew/actions/setup-homebrew@master + compiler: ${{ matrix.compiler }} + ccache_size: 75M - name: Install CMake - run: bash ./seqan3/.github/workflows/scripts/install_cmake.sh - - - name: Install ccache - run: bash ./seqan3/.github/workflows/scripts/install_via_brew.sh ccache - - - name: Install compiler ${{ matrix.cxx }} - env: - CC: ${{ matrix.cc }} - run: bash ./seqan3/.github/workflows/scripts/install_via_brew.sh $(echo ${CC/clang/llvm} | awk -F '-' '{print $1, $2}') - - - name: Load ccache - uses: actions/cache@v3 + uses: seqan/actions/setup-cmake@main with: - path: .ccache - key: ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.ref }}-${{ github.run_number }} - # Restoring: From current branch, otherwise from base branch, otherwise from any branch. - restore-keys: | - ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.ref }} - ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.base_ref }} - ${{ runner.os }}-${{ matrix.name }}-ccache- - - - name: Tool versions - run: | - env cmake --version - env ${{ matrix.cxx }} --version + cmake: 3.12.4 - name: Configure tests - env: - CXX: ${{ matrix.cxx }} - CC: ${{ matrix.cc }} run: | - mkdir sdsl-build - cd sdsl-build - cmake ../sdsl -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_FLAGS="-pedantic -Wall -Wextra -Werror ${{ matrix.cxx_flags }}" \ - -DSDSL_CEREAL=${{ matrix.has_cereal }} \ - -DSDSL_HEADER_TEST=${{ matrix.header_test }} - make -j${{ matrix.build_threads }} gtest_build + mkdir ci-build + cd ci-build + cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_FLAGS="-pedantic -Wall -Wextra -Werror ${{ matrix.cxx_flags }}" \ + -DSDSL_CEREAL=${{ matrix.has_cereal }} + make -j3 gtest_build - name: Build tests - env: - CCACHE_BASEDIR: ${{ github.workspace }} - CCACHE_DIR: ${{ github.workspace }}/.ccache - CCACHE_COMPRESS: true - CCACHE_COMPRESSLEVEL: 6 - CCACHE_MAXSIZE: 100M - CCACHE_IGNOREHEADERS: ${{ github.workspace }}/sdsl/include/sdsl/structure_tree.hpp run: | - ccache -p || true - cd sdsl-build - if [[ "${{ matrix.header_test }}" == "ON" ]]; then - make sdsl_header_test -k -j${{ matrix.build_threads }} - else - make sdsl_test_targets sdsl_examples sdsl_tutorials -k -j${{ matrix.build_threads }} - fi - ccache -s || true + ccache -p + cd ci-build + make sdsl_test_targets sdsl_examples sdsl_tutorials -k -j3 + ccache -s - name: Run tests run: | - cd sdsl-build - ctest . -j${{ matrix.test_threads }} \ - ${{ matrix.ctest_exclude }} \ - ${{ matrix.ctest_include }} \ - || ctest . -j${{ matrix.test_threads }} \ - --output-on-failure \ - --rerun-failed + cd ci-build + ctest . -j3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 73f5be82..62db6834 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,11 +1,6 @@ name: Linting on: - # push: - # branches: - # Push events to branches matching refs/heads/master - # - 'master' - # Enables a manual trigger, may run on any branch workflow_dispatch: concurrency: @@ -17,14 +12,13 @@ env: defaults: run: - shell: bash -ex {0} + shell: bash -Eexuo pipefail {0} jobs: lint: name: Linting runs-on: ubuntu-22.04 timeout-minutes: 30 - if: github.repository_owner == 'xxsds' || github.event_name == 'workflow_dispatch' steps: - uses: actions/checkout@v3 - name: Run clang-format @@ -35,6 +29,7 @@ jobs: extensions: 'h,hpp,hpp.cmake,cpp' clangFormatVersion: 15 inplace: True + - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: From 0e036942a0a0adc49b270b582a1824cb6ffebfe4 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 15:40:26 +0200 Subject: [PATCH 2/9] [INFRA] Update googletest --- external/googletest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/googletest b/external/googletest index 15460959..b796f7d4 160000 --- a/external/googletest +++ b/external/googletest @@ -1 +1 @@ -Subproject commit 15460959cbbfa20e66ef0b5ab497367e47fc0a04 +Subproject commit b796f7d44681514f58a683a3a71ff17c94edb0c1 From e59f5cecb1b49578c028219be48eed42881a6aad Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 15:45:34 +0200 Subject: [PATCH 3/9] [DOC] Update README --- README.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c0226183..bf1177eb 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,9 @@ # SDSL v3 - Succinct Data Structure Library -[![linux status][1]][2] -[![macos status][3]][4] +[![CI][1]][2] -[1]: https://img.shields.io/github/workflow/status/xxsds/sdsl-lite/CI%20on%20Linux/master?style=flat&logo=github&label=Linux%20CI "Open GitHub actions page" -[2]: https://github.com/xxsds/sdsl-lite/actions?query=branch%3Amaster -[3]: https://img.shields.io/github/workflow/status/xxsds/sdsl-lite/CI%20on%20macOS/master?style=flat&logo=github&label=macOS%20CI "Open GitHub actions page" -[4]: https://github.com/xxsds/sdsl-lite/actions?query=branch%3Amaster +[1]: https://img.shields.io/github/actions/workflow/status/xxsds/sdsl-lite/ci_linux.yml?branch=master&style=flat&logo=github&label=CI "Open GitHub actions page" +[2]: https://github.com/xxsds/sdsl-lite/actions?query=branch%3Amaster+event%3Apush ## Main differences to [v2](https://github.com/simongog/sdsl-lite) @@ -16,20 +13,20 @@ ## Supported compilers -Other compiler may work, but are not tested within the continuous integration. In general, the latest minor release of each -listed major compiler version is supported. +Other compiler may work, but are not tested within the continuous integration. In general, the latest minor release of +each listed major compiler version is supported. -* GCC 10, 11, 12, 13 -* clang 11, 12, 13, 14 +* GCC 11, 12, 13 +* clang 14, 15, 16 -Tests are run with both C++20 and C++23. +Tests are run with C++20 and C++23. ## Dependencies As SDSL v3 is header-only, dependencies marked as `required` only apply to building tests/examples. * required: [CMake >= 3.2](https://github.com/Kitware/CMake) -* required: [googletest 1.11.0](https://github.com/google/googletest/releases/tag/release-1.11.0) -* optional: [cereal 1.3.0](https://github.com/USCiLab/cereal) +* required: [googletest 1.13.0](https://github.com/google/googletest/releases/tag/release-1.13.0) +* optional: [cereal 1.3.2](https://github.com/USCiLab/cereal) cereal can be activated by passing `-DSDSL_CEREAL=1` to CMake. From b28e26522c5ec94e2936fc2a11f9fc3c0e2b476e Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 15:51:39 +0200 Subject: [PATCH 4/9] [INFRA] Add dependabot.yml --- .github/dependabot.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..dcbcb650 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From 3d1f533010bcb75a422b4a9031cb283360d753b4 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 16:06:49 +0200 Subject: [PATCH 5/9] [FIX] unused variables --- include/sdsl/bp_support_algorithm.hpp | 3 +-- include/sdsl/construct_lcp.hpp | 6 ------ include/sdsl/csa_sampling_strategy.hpp | 2 -- include/sdsl/lcp_support_tree2.hpp | 6 ------ include/sdsl/wt_hutu.hpp | 2 -- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/include/sdsl/bp_support_algorithm.hpp b/include/sdsl/bp_support_algorithm.hpp index b1c2a803..80299f6c 100644 --- a/include/sdsl/bp_support_algorithm.hpp +++ b/include/sdsl/bp_support_algorithm.hpp @@ -235,14 +235,13 @@ inline bit_vector calculate_pioneers_bitmap_succinct(bit_vector const & bp, uint bit_vector pioneer_bitmap(bp.size(), 0); sorted_stack_support opening_parenthesis(bp.size()); - uint64_t cur_pioneer_block = 0, last_start = 0, last_j = 0, cur_block = 0, first_index_in_block = 0; + uint64_t cur_pioneer_block = 0, last_start = 0, last_j = 0, first_index_in_block = 0; // calculate positions of findclose and findopen pioneers for (uint64_t j = 0, new_block = block_size; j < bp.size(); ++j, --new_block) { if (!(new_block)) { cur_pioneer_block = j / block_size; - ++cur_block; first_index_in_block = j; new_block = block_size; } diff --git a/include/sdsl/construct_lcp.hpp b/include/sdsl/construct_lcp.hpp index 9fe2c090..eda62c09 100644 --- a/include/sdsl/construct_lcp.hpp +++ b/include/sdsl/construct_lcp.hpp @@ -376,7 +376,6 @@ inline void construct_lcp_go(cache_config & config) int_vector<8> lcp_sml(n, 0); // initialize array for small values of first phase; note lcp[0]=0 - size_type done_cnt = 0; for (size_type i = 0; i < n; ++i) { // initialize cnt_c @@ -436,7 +435,6 @@ inline void construct_lcp_go(cache_config & config) #endif } lcp_sml[i] = l; - ++done_cnt; } else { // BWT[i] != BWT[i-1] or LF[i] > i @@ -482,7 +480,6 @@ inline void construct_lcp_go(cache_config & config) rmq_end = j; // update index of the value of the topmost element if (lf > i) { // if LF[i] > i, we can calculate LCP[LF[i]] in constant time with rmq - ++done_cnt; // rmq query for lcp-values in the interval I=[prev_occ_in_bwt[BWT[i]]+1..i] // rmq is linear in the stack size; can also be implemented with binary search on the stack size_type x_pos = prev_occ_in_bwt[bwti] + 2; @@ -763,7 +760,6 @@ inline void construct_lcp_goPHI(cache_config & config) int_vector<8> lcp_sml(n, 0); // initialize array for small values of first phase; note lcp[0]=0 - size_type done_cnt = 0; for (size_type i = 0; i < n; ++i) { // initialize cnt_c @@ -817,7 +813,6 @@ inline void construct_lcp_goPHI(cache_config & config) l += (text[sai_1 + m] == text[sai + m]); } lcp_sml[i] = l; - ++done_cnt; } else { // BWT[i] != BWT[i-1] or LF[i] > i @@ -845,7 +840,6 @@ inline void construct_lcp_goPHI(cache_config & config) rmq_end = j; // update index of the value of the topmost element if (lf > i) { // if LF[i] > i, we can calculate LCP[LF[i]] in constant time with rmq - ++done_cnt; // rmq query for lcp-values in the interval I=[prev_occ_in_bwt[BWT[i]]+1..i] // rmq is linear in the stack size; can also be implemented with binary search on the stack size_type x_pos = prev_occ_in_bwt[bwti] + 2; diff --git a/include/sdsl/csa_sampling_strategy.hpp b/include/sdsl/csa_sampling_strategy.hpp index 8153b4f1..7e1d28e1 100644 --- a/include/sdsl/csa_sampling_strategy.hpp +++ b/include/sdsl/csa_sampling_strategy.hpp @@ -345,7 +345,6 @@ class _fuzzy_sa_sampling bit_vector marked_sa(n, 0); // temporary bitvector for marked SA positions int_vector<> inv_perm((n + sample_dens - 1) / sample_dens, 0, bits::hi(n) + 1); size_type cnt = 0; - size_type runs = 1; uint64_t min_prev_val = 0; for (size_type i = 0; i < n; i += sample_dens) @@ -371,7 +370,6 @@ class _fuzzy_sa_sampling if (pos_cnd == n) { // increasing sequence can not be extended pos_cnd = pos_min; - ++runs; } min_prev_val = isa_buf[pos_cnd]; marked_isa[pos_cnd] = 1; diff --git a/include/sdsl/lcp_support_tree2.hpp b/include/sdsl/lcp_support_tree2.hpp index adc4f341..17b04a4f 100644 --- a/include/sdsl/lcp_support_tree2.hpp +++ b/include/sdsl/lcp_support_tree2.hpp @@ -253,9 +253,7 @@ void construct_first_child_and_lf_lcp(int_vector_buffer<> & lcp_buf, osfstream big_lcp_out(big_lcp_file, std::ios::out | std::ios::trunc | std::ios::binary); - size_type fc_cnt = 0; // number of lcp values at the first child r size_type fc_cnt_big = 0; // number of lcp values at the first child which are big and not reducible - size_type fc_cnt_big2 = 0; sorted_multi_stack_support vec_stack(n); // occupies 2n bits bit_vector is_big_and_not_reducable(n, 0); // initialized with 0s bool is_one_big_and_not_reducable = false; // all positions have to be reducible @@ -286,7 +284,6 @@ void construct_first_child_and_lf_lcp(int_vector_buffer<> & lcp_buf, else { val = M - 1; - ++fc_cnt_big2; } } else @@ -294,7 +291,6 @@ void construct_first_child_and_lf_lcp(int_vector_buffer<> & lcp_buf, val = y; } sml_lcp_out.push_back(val); - ++fc_cnt; is_one_big_and_not_reducable = false; } } @@ -328,7 +324,6 @@ void construct_first_child_and_lf_lcp(int_vector_buffer<> & lcp_buf, else { val = M - 1; - ++fc_cnt_big2; } } else @@ -336,7 +331,6 @@ void construct_first_child_and_lf_lcp(int_vector_buffer<> & lcp_buf, val = y; } sml_lcp_out.push_back(val); - ++fc_cnt; } } diff --git a/include/sdsl/wt_hutu.hpp b/include/sdsl/wt_hutu.hpp index a5ef04e8..2abaf909 100644 --- a/include/sdsl/wt_hutu.hpp +++ b/include/sdsl/wt_hutu.hpp @@ -648,13 +648,11 @@ struct _hutu_shape int64_t spointer = -1; uint64_t qpointer = 0; // use the Array T as a stack - int64_t max_nodes = sigma; while (qpointer < sigma or spointer >= 1LL) { if (spointer >= 1LL and (stack[spointer]->level == stack[spointer - 1]->level)) { ht_node * n_node = new ht_node(); - max_nodes++; n_node->t = false; n_node->left = stack[spointer - 1]; n_node->right = stack[spointer]; From efbeef745a56953dd67e5ba2f480091df5fc8974 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 16:07:06 +0200 Subject: [PATCH 6/9] [FIX] unqualified call --- test/wt_int_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/wt_int_test.cpp b/test/wt_int_test.cpp index cd6c7451..4ec08660 100644 --- a/test/wt_int_test.cpp +++ b/test/wt_int_test.cpp @@ -148,7 +148,7 @@ TYPED_TEST(wt_int_test, load_and_move_and_rank) load_from_file(iv, test_file); TypeParam wt_load; ASSERT_TRUE(load_from_file(wt_load, temp_file)); - TypeParam wt = move(wt_load); + TypeParam wt = std::move(wt_load); ASSERT_EQ(iv.size(), wt.size()); tMII check_rank; for (size_type j = 0; j < iv.size(); ++j) @@ -185,7 +185,7 @@ TYPED_TEST(wt_int_test, load_and_move_and_select) load_from_file(iv, test_file); TypeParam wt_load; ASSERT_TRUE(load_from_file(wt_load, temp_file)); - TypeParam wt = move(wt_load); + TypeParam wt = std::move(wt_load); ASSERT_EQ(iv.size(), wt.size()); tMII count; for (size_type j = 0; j < iv.size(); ++j) From 18d5e3aecf5abaf2ad71cde6af5d9fd771f220bb Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 16:15:32 +0200 Subject: [PATCH 7/9] [FIX] ambiguous call Clash with std::format --- tutorial/csx-printf.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tutorial/csx-printf.cpp b/tutorial/csx-printf.cpp index ac584229..22ecb2d4 100644 --- a/tutorial/csx-printf.cpp +++ b/tutorial/csx-printf.cpp @@ -6,7 +6,6 @@ #include using namespace sdsl; -using namespace std; std::string format("%3I%3S %3s %3P %3p %3L %3B %T"); std::string header(" i SA ISA PSI LF LCP BWT TEXT"); @@ -19,19 +18,19 @@ typedef cst_sct3 cst_int_t; void print_usage(char const * command) { - cout << "\ + std::cout << "\ A pretty printer for suffix array/tree members.\n\ Transforms each input line into a CST and outputs\n\ formatted suffix array/tree members.\n\ Usage: " << command - << " X \"[FORMAT]\" \"[HEADER]\" \"[SENTINEL]\"\n\ + << " X \"[FORMAT]\" \"[HEADER]\" \"[SENTINEL]\"\n\ X : Input is interpreted dependent on X.\n\ X=1: byte sequence.\n\ X=d: sequence of decimal numbers.\n\ FORMAT : Format string. Default=`" - << format << "`.\n\ + << format << "`.\n\ HEADER : Header string. Default=`" - << header << "`.\n\ + << header << "`.\n\ SENTINEL: Sentinel character. \n\ \n\ Each line of the output will be formatted according to the format string.\ @@ -68,24 +67,24 @@ int main(int argc, char * argv[]) { header = argv[3]; } - while (cin.getline(line, BUF_SIZE)) + while (std::cin.getline(line, BUF_SIZE)) { - cout << header << endl; + std::cout << header << std::endl; if ('1' == argv[1][0]) { cst_byte_t cst; construct_im(cst, (char const *)line, 1); - stringstream ss; + std::stringstream ss; csXprintf(ss, format, cst, ((argc > 4) ? argv[4][0] : '$')); std::string line(ss.str()); - cout << std::regex_replace(line, std::regex(R"(\$)"), "\\$") << endl; + std::cout << std::regex_replace(line, std::regex(R"(\$)"), "\\$") << std::endl; } else if ('d' == argv[1][0]) { cst_int_t cst; construct_im(cst, (char const *)line, 'd'); - csXprintf(cout, format, cst, ((argc > 4) ? argv[4][0] : '0')); + csXprintf(std::cout, format, cst, ((argc > 4) ? argv[4][0] : '0')); } - cout << endl; + std::cout << std::endl; } } From 74a2e2c4a79bedb0768046e940efa3047be10210 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 16:57:38 +0200 Subject: [PATCH 8/9] [FIX] ambiguous comparison operator --- include/sdsl/int_vector.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sdsl/int_vector.hpp b/include/sdsl/int_vector.hpp index 2248e3e4..9d8ac7a0 100644 --- a/include/sdsl/int_vector.hpp +++ b/include/sdsl/int_vector.hpp @@ -771,17 +771,17 @@ class int_vector return ((*data1) & bits::lo_set[l]) == ((*data2) & bits::lo_set[l]); } - //! Equality operator for an arbitrary container. + //! Equality operator for two int_vectors. /*! Note that this function is slow since it compares element by element * and cannot compare the bit representations of the containers. * Two containers are equal if * - sizes are equal and * - its elements are equal. */ - template - friend bool operator==(int_vector const & lhs, container const & rhs) noexcept + template + bool operator==(int_vector const & v) const noexcept { - return std::equal(lhs.begin(), lhs.end(), rhs.begin()); + return (this->size() == v.size()) && std::equal(this->begin(), this->end(), v.begin()); } //! Inequality operator for two int_vectors. From 26998957563b58998cd0327b3f5ba2bf4ba6211c Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 21 Jul 2023 17:10:26 +0200 Subject: [PATCH 9/9] [INFRA] Ignore warnings in gtest build --- external/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 8af48127..61590c7f 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -18,6 +18,7 @@ macro (add_gtest) set (gtest_project_args ${SDSL_EXTERNAL_PROJECT_CMAKE_ARGS}) + list (APPEND gtest_project_args "-DCMAKE_CXX_FLAGS=-w") list (APPEND gtest_project_args "-DBUILD_GMOCK=0") # force that libraries are installed to `lib/`, because GNUInstallDirs might install it into `lib64/`