From 55466cdc46190f4f8b7e54492d95e828625416e3 Mon Sep 17 00:00:00 2001 From: Kor de Jong Date: Mon, 18 Sep 2023 16:58:33 +0200 Subject: [PATCH 1/7] Update workflows --- .github/workflows/linux.yml | 8 +++++--- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1f00b897..86a09c07 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,8 +9,10 @@ jobs: matrix: os: ["ubuntu-22.04"] compiler: - - {version: 11, cc: gcc-11, cxx: g++-11} - - {version: 12, cc: clang-12, cxx: clang++-12} + - {version: 9, cc: gcc-9, cxx: g++-9} + - {version: 12, cc: gcc-12, cxx: g++-12} + - {version: 11, cc: clang-11, cxx: clang++-11} + - {version: 14, cc: clang-14, cxx: clang++-14} fail-fast: false runs-on: ${{ matrix.os }} @@ -20,7 +22,7 @@ jobs: steps: - name: checkout fern - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e61468f5..b860a1d5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,7 +17,7 @@ jobs: steps: - name: checkout fern - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 477b0d9f..bb7ec6d2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -17,7 +17,7 @@ jobs: steps: - name: checkout fern - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive From f2c967a7a82881d2808c32105ddd4ec9fdb1f8c7 Mon Sep 17 00:00:00 2001 From: Kor de Jong Date: Mon, 18 Sep 2023 16:58:33 +0200 Subject: [PATCH 2/7] Fix compiler warnings --- .../algebra/elementary/detail/factorial.h | 2 +- .../algorithm/convolution/detail/convolve.h | 60 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/source/fern/algorithm/algebra/elementary/detail/factorial.h b/source/fern/algorithm/algebra/elementary/detail/factorial.h index e3bd23e1..2753d150 100644 --- a/source/fern/algorithm/algebra/elementary/detail/factorial.h +++ b/source/fern/algorithm/algebra/elementary/detail/factorial.h @@ -87,7 +87,7 @@ struct within_range< inline static constexpr bool calculate( Value const& value, - Result const& result) + [[maybe_unused]] Result const& result) { // Calculate the result as if the argument was a floating point and // compare the results. diff --git a/source/fern/algorithm/convolution/detail/convolve.h b/source/fern/algorithm/convolution/detail/convolve.h index 5ae5933d..7e773d25 100644 --- a/source/fern/algorithm/convolution/detail/convolve.h +++ b/source/fern/algorithm/convolution/detail/convolve.h @@ -127,8 +127,8 @@ struct ConvolveNorthWestCorner size_t first_col_kernel; size_t nr_rows_kernel{radius_ + 1}; size_t nr_cols_kernel; - size_t nr_rows_outside_of_image{radius_}; - size_t nr_cols_outside_of_image; + // size_t nr_rows_outside_of_image{radius_}; + // size_t nr_cols_outside_of_image; using V = value_type; using SV = accumulate_type; @@ -155,7 +155,7 @@ struct ConvolveNorthWestCorner first_col_kernel = radius_; nr_cols_kernel = radius_ + 1; - nr_cols_outside_of_image = radius_; + // nr_cols_outside_of_image = radius_; index_ = index(source, row_source, 0); @@ -273,13 +273,13 @@ struct ConvolveNorthWestCorner --first_col_kernel; ++nr_cols_kernel; - --nr_cols_outside_of_image; + // --nr_cols_outside_of_image; ++index_; } --first_row_kernel; ++nr_rows_kernel; - --nr_rows_outside_of_image; + // --nr_rows_outside_of_image; } } @@ -315,8 +315,8 @@ struct ConvolveNorthEastCorner size_t const first_col_kernel{0}; size_t nr_rows_kernel{radius_ + 1}; size_t nr_cols_kernel; - size_t nr_rows_outside_of_image{radius_}; - size_t nr_cols_outside_of_image; + // size_t nr_rows_outside_of_image{radius_}; + // size_t nr_cols_outside_of_image; using V = value_type; using SV = accumulate_type; @@ -343,7 +343,7 @@ struct ConvolveNorthEastCorner first_col_source = nr_cols_source - radius_ - radius_; nr_cols_kernel = radius_ + radius_; - nr_cols_outside_of_image = 1; + // nr_cols_outside_of_image = 1; index_ = index(source, row_source, nr_cols_source - radius_); @@ -452,13 +452,13 @@ struct ConvolveNorthEastCorner ++first_col_source; --nr_cols_kernel; - ++nr_cols_outside_of_image; + // ++nr_cols_outside_of_image; ++index_; } --first_row_kernel; ++nr_rows_kernel; - --nr_rows_outside_of_image; + // --nr_rows_outside_of_image; } } @@ -494,8 +494,8 @@ struct ConvolveSouthWestCorner size_t first_col_kernel; size_t nr_rows_kernel = radius_ + radius_; size_t nr_cols_kernel; - size_t nr_rows_outside_of_image{0}; - size_t nr_cols_outside_of_image; + // size_t nr_rows_outside_of_image{0}; + // size_t nr_cols_outside_of_image; using V = value_type; using SV = accumulate_type; @@ -523,7 +523,7 @@ struct ConvolveSouthWestCorner first_col_kernel = radius_; nr_cols_kernel = radius_ + 1; - nr_cols_outside_of_image = radius_; + // nr_cols_outside_of_image = radius_; index_ = index(source, row_source, 0); @@ -632,13 +632,13 @@ struct ConvolveSouthWestCorner --first_col_kernel; ++nr_cols_kernel; - --nr_cols_outside_of_image; + // --nr_cols_outside_of_image; ++index_; } ++first_row_source; --nr_rows_kernel; - ++nr_rows_outside_of_image; + // ++nr_rows_outside_of_image; } } @@ -675,8 +675,8 @@ struct ConvolveSouthEastCorner size_t const first_col_kernel{0}; size_t nr_rows_kernel = radius_ + radius_; size_t nr_cols_kernel; - size_t nr_rows_outside_of_image{0}; - size_t nr_cols_outside_of_image; + // size_t nr_rows_outside_of_image{0}; + // size_t nr_cols_outside_of_image; using V = value_type; using SV = accumulate_type; @@ -704,7 +704,7 @@ struct ConvolveSouthEastCorner first_col_source = nr_cols_source - radius_ - radius_; nr_cols_kernel = radius_ + radius_; - nr_cols_outside_of_image = 1; + // nr_cols_outside_of_image = 1; index_ = index(source, row_source, nr_cols_source - radius_); @@ -814,13 +814,13 @@ struct ConvolveSouthEastCorner ++first_col_source; --nr_cols_kernel; - ++nr_cols_outside_of_image; + // ++nr_cols_outside_of_image; ++index_; } ++first_row_source; --nr_rows_kernel; - ++nr_rows_outside_of_image; + // ++nr_rows_outside_of_image; } } @@ -856,7 +856,7 @@ struct ConvolveNorthSide size_t const first_col_kernel{0}; size_t nr_rows_kernel{radius_ + 1}; size_t const nr_cols_kernel{width(kernel)}; - size_t nr_rows_outside_of_image{radius_}; + // size_t nr_rows_outside_of_image{radius_}; using V = value_type; using SV = accumulate_type; @@ -997,7 +997,7 @@ struct ConvolveNorthSide --first_row_kernel; ++nr_rows_kernel; - --nr_rows_outside_of_image; + // --nr_rows_outside_of_image; } } @@ -1033,7 +1033,7 @@ struct ConvolveWestSide size_t first_col_kernel; size_t const nr_rows_kernel{height(kernel)}; size_t nr_cols_kernel; - size_t nr_cols_outside_of_image; + // size_t nr_cols_outside_of_image; using V = value_type; using SV = accumulate_type; @@ -1061,7 +1061,7 @@ struct ConvolveWestSide first_col_kernel = radius_; nr_cols_kernel = radius_ + 1; - nr_cols_outside_of_image = radius_; + // nr_cols_outside_of_image = radius_; index_ = index(source, row_source, 0); @@ -1172,7 +1172,7 @@ struct ConvolveWestSide --first_col_kernel; ++nr_cols_kernel; - --nr_cols_outside_of_image; + // --nr_cols_outside_of_image; ++index_; } @@ -1213,7 +1213,7 @@ struct ConvolveEastSide size_t const first_col_kernel{0}; size_t const nr_rows_kernel{height(kernel)}; size_t nr_cols_kernel; - size_t nr_cols_outside_of_image; + // size_t nr_cols_outside_of_image; using V = value_type; using SV = accumulate_type; @@ -1241,7 +1241,7 @@ struct ConvolveEastSide first_col_source = nr_cols_source - radius_ - radius_; nr_cols_kernel = radius_ + radius_; - nr_cols_outside_of_image = 1; + // nr_cols_outside_of_image = 1; index_ = index(source, row_source, nr_cols_source - radius_); @@ -1354,7 +1354,7 @@ struct ConvolveEastSide ++first_col_source; --nr_cols_kernel; - ++nr_cols_outside_of_image; + // ++nr_cols_outside_of_image; ++index_; } @@ -1395,7 +1395,7 @@ struct ConvolveSouthSide size_t const first_col_kernel{0}; size_t nr_rows_kernel{radius_ + radius_}; size_t const nr_cols_kernel{width(kernel)}; - size_t nr_rows_outside_of_image{1}; + // size_t nr_rows_outside_of_image{1}; using V = value_type; using SV = accumulate_type; @@ -1538,7 +1538,7 @@ struct ConvolveSouthSide // --first_row_kernel; ++first_row_source; --nr_rows_kernel; - ++nr_rows_outside_of_image; + // ++nr_rows_outside_of_image; } } From 8ddca31226b505eebeea260b50bc18ac1ad3ed13 Mon Sep 17 00:00:00 2001 From: Kor de Jong Date: Mon, 18 Sep 2023 16:58:33 +0200 Subject: [PATCH 3/7] Specify template argument in specialization --- source/fern/core/data_customization_point/scalar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/fern/core/data_customization_point/scalar.h b/source/fern/core/data_customization_point/scalar.h index e2a3869a..f9581a00 100644 --- a/source/fern/core/data_customization_point/scalar.h +++ b/source/fern/core/data_customization_point/scalar.h @@ -17,7 +17,7 @@ namespace fern { #define CONSTANT_CUSTOMIZATION_POINT( \ T) \ template<> \ -inline typename DataTypeTraits::const_reference get( \ +inline typename DataTypeTraits::const_reference get( \ typename DataTypeTraits::value_type const& constant) \ { \ return constant; \ @@ -25,7 +25,7 @@ inline typename DataTypeTraits::const_reference get( \ \ \ template<> \ -inline typename DataTypeTraits::reference get( \ +inline typename DataTypeTraits::reference get( \ typename DataTypeTraits::value_type& constant) \ { \ return constant; \ From 4cd8c432d3ac05aac507e388a4b58b344336adc6 Mon Sep 17 00:00:00 2001 From: Kor de Jong Date: Mon, 18 Sep 2023 17:13:15 +0200 Subject: [PATCH 4/7] Improve workflow --- .github/workflows/linux.yml | 9 ++++++++- .github/workflows/macos.yml | 9 ++++++++- .github/workflows/windows.yml | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 86a09c07..9d1984c7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,6 +1,13 @@ name: Linux CI -on: [push] +on: + push: + branches-ignore: + - "ghxyz" + paths: + - ".github/workflows/linux.yml" + - "environment/cmake/**" + - "source/**" jobs: build: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b860a1d5..6465ede5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,13 @@ name: macOS CI -on: [push] +on: + push: + branches-ignore: + - "ghxyz" + paths: + - ".github/workflows/macos.yml" + - "environment/cmake/**" + - "source/**" jobs: build: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bb7ec6d2..0e244526 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,13 @@ name: Windows CI -on: [push] +on: + push: + branches-ignore: + - "ghxyz" + paths: + - ".github/workflows/windows.yml" + - "environment/cmake/**" + - "source/**" jobs: build: From d6f80015d958fda1e65eb91fd2630bf10c1d7e81 Mon Sep 17 00:00:00 2001 From: Kor de Jong Date: Mon, 18 Sep 2023 17:18:45 +0200 Subject: [PATCH 5/7] Fix C/I, take I --- .github/workflows/windows.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0e244526..81ba7631 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -28,10 +28,19 @@ jobs: with: submodules: recursive - # TODO Install Boost + - name: Install boost + uses: MarkusJx/install-boost@v2.4.4 + id: install-boost + with: + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json + boost_version: 1.83.0 + platform_version: 2022 + toolset: msvc - name: configure fern shell: bash -l {0} + env: + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} run: | mkdir build cmake \ From 59bf8c83985172db4a4d623a07e09be0c1ff681e Mon Sep 17 00:00:00 2001 From: Kor de Jong Date: Mon, 18 Sep 2023 17:31:42 +0200 Subject: [PATCH 6/7] Fix C/I, take II --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 81ba7631..2973e87c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,14 +33,14 @@ jobs: id: install-boost with: # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json - boost_version: 1.83.0 + boost_version: 1.78.0 platform_version: 2022 toolset: msvc - name: configure fern shell: bash -l {0} env: - BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} + Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} run: | mkdir build cmake \ From 77ea8dc0d69c62812180d856cf87273d0850c125 Mon Sep 17 00:00:00 2001 From: Kor de Jong Date: Mon, 18 Sep 2023 17:38:58 +0200 Subject: [PATCH 7/7] Fix C/I, take III --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2973e87c..cc34a801 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -36,6 +36,7 @@ jobs: boost_version: 1.78.0 platform_version: 2022 toolset: msvc + link: shared - name: configure fern shell: bash -l {0}