diff --git a/0001-Fix-const-correctness-invalid-used-of-non-const-fort.patch b/0001-Fix-const-correctness-invalid-used-of-non-const-fort.patch new file mode 100644 index 0000000..7ea3220 --- /dev/null +++ b/0001-Fix-const-correctness-invalid-used-of-non-const-fort.patch @@ -0,0 +1,124 @@ +From 1c672392dffcc5a9a124241ac966d9a81102dccf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Wed, 1 Jan 2025 20:24:11 +0100 +Subject: [PATCH] Fix const-correctness, invalid used of non-const fortran_vec + +fortran_vec() is a non-const method, replace with the const data() method. +--- + src/__lzo_gm__.cc | 4 ++-- + src/__lzo_run__.cc | 2 +- + src/__lzo_test__.cc | 8 ++++---- + src/routines_c/find_multi_neighbors.cc | 2 +- + src/routines_c/tsa.h | 2 +- + 5 files changed, 9 insertions(+), 9 deletions(-) + mode change 100755 => 100644 src/__lzo_gm__.cc + mode change 100755 => 100644 src/__lzo_run__.cc + +diff --git a/src/__lzo_gm__.cc b/src/__lzo_gm__.cc +old mode 100755 +new mode 100644 +index 40b5065..c8b6476 +--- a/src/__lzo_gm__.cc ++++ b/src/__lzo_gm__.cc +@@ -42,7 +42,7 @@ void make_fit(const Matrix& series, octave_idx_type dim, + octave_idx_type LENGTH = series.rows (); + for (octave_idx_type i=0;i box (dim_vector(NMAX,NMAX)); + +diff --git a/src/__lzo_run__.cc b/src/__lzo_run__.cc +old mode 100755 +new mode 100644 +index 03ff253..14bca5c +--- a/src/__lzo_run__.cc ++++ b/src/__lzo_run__.cc +@@ -136,7 +136,7 @@ void make_zeroth(const Matrix &series, TISEAN_rand &generator, + for (octave_idx_type d=0;d &box, +- long *list,double **x, ++ long *list,const double **x, + octave_idx_type bs,octave_idx_type dim, + octave_idx_type emb,octave_idx_type del, + double eps, unsigned long *flist) +diff --git a/src/routines_c/tsa.h b/src/routines_c/tsa.h +index b044728..33d51b5 100644 +--- a/src/routines_c/tsa.h ++++ b/src/routines_c/tsa.h +@@ -66,7 +66,7 @@ extern octave_idx_type exclude_interval(octave_idx_type,long,long, + + extern octave_idx_type find_multi_neighbors(const Matrix &, + const MArray &, +- long *,double **, ++ long *,const double **, + octave_idx_type, octave_idx_type, + octave_idx_type, octave_idx_type, + double,unsigned long *); +-- +2.47.1 + diff --git a/0001-Fix-element-wise-plus-operator.patch b/0001-Fix-element-wise-plus-operator.patch new file mode 100644 index 0000000..49d610a --- /dev/null +++ b/0001-Fix-element-wise-plus-operator.patch @@ -0,0 +1,115 @@ +From 91eb92651920d306d7281b718d6c903e03e62691 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Wed, 1 Jan 2025 22:14:59 +0100 +Subject: [PATCH] Fix element-wise plus operator + +The ".+" notation was deprecated in 7.x and removed with 9.x, it was +equivalent with the regular "+" operator. + +The operation broadcasts both index ranges, and then sums them +elementwise to create indices representing a sliding window. +--- + inst/av_d2.m | 2 +- + inst/c2g.m | 6 +++--- + inst/c2t.m | 4 ++-- + inst/endtoend.m | 2 +- + inst/upo.m | 2 +- + inst/upoembed.m | 4 ++-- + 6 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/inst/av_d2.m b/inst/av_d2.m +index 3c897cd..e44f021 100644 +--- a/inst/av_d2.m ++++ b/inst/av_d2.m +@@ -149,7 +149,7 @@ function output = av_d2 (d2_c2d_c1_out, varargin) + # Create smoothing functions + # Smoothes single column + smooth_column = @(col) sum (col((-aver:aver) ... +- .+(aver+1:(length(col)-aver)).'),2) ... ++ +(aver+1:(length(col)-aver)).'),2) ... + ./(2*aver + 1); + # Smoothes one cell + smooth_cell = @(cell_mat) [smooth_column(cell_mat{1}(:,1)), ... +diff --git a/inst/c2g.m b/inst/c2g.m +index c0dc02e..964a34d 100644 +--- a/inst/c2g.m ++++ b/inst/c2g.m +@@ -123,9 +123,9 @@ function output = c2g (d2_out) + + # Create column vectors instead of using loop + k_id = 1:length(tmp.c2)-1; +- f = exp((emat(k_id+1).*cmat(k_id).-emat(k_id).*cmat(k_id+1)) +- ./(emat(k_id+1).-emat(k_id))); +- d = (cmat(k_id+1).-cmat(k_id))./(emat(k_id+1).-emat(k_id)); ++ f = exp((emat(k_id+1).*cmat(k_id)-emat(k_id).*cmat(k_id+1)) ++ ./(emat(k_id+1)-emat(k_id))); ++ d = (cmat(k_id+1)-cmat(k_id))./(emat(k_id+1)-emat(k_id)); + a = emat(k_id); + b = emat(k_id+1); + +diff --git a/inst/c2t.m b/inst/c2t.m +index 4cb0d43..6f0b55d 100644 +--- a/inst/c2t.m ++++ b/inst/c2t.m +@@ -109,8 +109,8 @@ function output = c2t (d2_c1_out) + emat = log (corr_sums(idx,1)); + cmat = log (corr_sums(idx,2)); + +- b = (emat(2:end) .* cmat(1:end-1) .- emat(1:end-1) .* cmat(2:end)) ... +- ./ (emat(2:end) .- emat(1:end-1)); ++ b = (emat(2:end) .* cmat(1:end-1) - emat(1:end-1) .* cmat(2:end)) ... ++ ./ (emat(2:end) - emat(1:end-1)); + a = (cmat(2:end) - cmat(1:end-1)) ./ (emat(2:end) - emat(1:end-1)); + + cint = (exp (b) ./ a) ... +diff --git a/inst/endtoend.m b/inst/endtoend.m +index 2a9154d..e05a2ef 100644 +--- a/inst/endtoend.m ++++ b/inst/endtoend.m +@@ -209,7 +209,7 @@ S= reshape (S, [rows(S),1,columns(S)]); + endwhile + etot = original_col_S; + for nj = 0:(rows (S) - nmaxp) +- [x,s] = mismatch (S((1:nmaxp).+nj,1,:)); ++ [x,s] = mismatch (S((1:nmaxp)+nj,1,:)); + xj(1+nj) = x; + sj(1+nj) = s; + endfor +diff --git a/inst/upo.m b/inst/upo.m +index 4c17bf0..898fc46 100644 +--- a/inst/upo.m ++++ b/inst/upo.m +@@ -80,7 +80,7 @@ + ## n-the orbit you need to: + ## @example + ## +-## nth_orbit_data = orbit_data(sum(olens(1:n-1)).+(1:olens(n))); ++## nth_orbit_data = orbit_data(sum(olens(1:n-1))+(1:olens(n))); + ## + ## @end example + ## @item acc +diff --git a/inst/upoembed.m b/inst/upoembed.m +index c14b160..3143629 100644 +--- a/inst/upoembed.m ++++ b/inst/upoembed.m +@@ -126,7 +126,7 @@ values of olens"); + ## Create delay vectors + j = (m:-1:1); + delay_vec = @(x) orbit_data(sum(olens(1:idx(x)-1))+ ... +- mod(((1:olens(idx(x))+1).').-... ++ mod(((1:olens(idx(x))+1).')-... + (j-1).*delay -1 +m.*olens(idx(x)),... + olens(idx(x)))+1); + output = arrayfun (delay_vec,(1:length(idx)).','UniformOutput', false); +@@ -138,7 +138,7 @@ values of olens"); + # for k=1:olens(i)+1; + # for j=m:-1:1; + # output(sum(olens(1:i-1)+1)+k,m+1-j) = ... +- # orbit_data(sum(olens(1:i-1))+mod(k.-(j-1).*delay-1+m*olens(i),olens(i))+1); ++ # orbit_data(sum(olens(1:i-1))+mod(k-(j-1).*delay-1+m*olens(i),olens(i))+1); + # endfor + # endfor + # endfor +-- +2.47.1 + diff --git a/octave-forge-tisean.changes b/octave-forge-tisean.changes index 50e5275..ca44fd2 100644 --- a/octave-forge-tisean.changes +++ b/octave-forge-tisean.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 1 19:25:41 UTC 2025 - Stefan BrĂ¼ns + +- Fix some build issues with Octave 9.x, add + * 0001-Fix-const-correctness-invalid-used-of-non-const-fort.patch + * 0001-Fix-element-wise-plus-operator.patch + ------------------------------------------------------------------- Wed Apr 19 08:51:06 UTC 2023 - Atri Bhattacharya diff --git a/octave-forge-tisean.spec b/octave-forge-tisean.spec index 46cdf4f..e2a6247 100644 --- a/octave-forge-tisean.spec +++ b/octave-forge-tisean.spec @@ -1,7 +1,7 @@ # # spec file for package octave-forge-tisean # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,10 +23,12 @@ Release: 0 Summary: Nonlinear Time Series Analysis License: GPL-3.0-or-later Group: Productivity/Scientific/Math -URL: http://octave.sourceforge.net -Source0: http://downloads.sourceforge.net/octave/%{octpkg}-%{version}.tar.gz +URL: https://gnu-octave.github.io/packages/tisean/ +Source0: https://downloads.sourceforge.net/project/octave/Octave%20Forge%20Packages/Individual%20Package%20Releases/%{octpkg}-%{version}.tar.gz # PATCH-FIX-UPSTREAM tisean-drop-error_state-use.patch badshah400@gmail.com -- Drop the use of error_state to support octave >= 8 (https://savannah.gnu.org/bugs/index.php?61583) Patch0: tisean-drop-error_state-use.patch +Patch1: 0001-Fix-const-correctness-invalid-used-of-non-const-fort.patch +Patch2: 0001-Fix-element-wise-plus-operator.patch BuildRequires: gcc-c++ BuildRequires: gcc-fortran BuildRequires: octave-devel @@ -41,6 +43,8 @@ This is part of Octave-Forge project. %setup -q -c %{name}-%{version} pushd %{octpkg}-%{version} %autopatch -p1 +# Fix missing namespace +find src/ -iname \*.cc -exec sed -i -e 's@set_warning_state\s*(@octave::\0@g' '{}' \; popd %octave_pkg_src