From e2087521e0adca5f11c6680fae507de1801795f9 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 20 Jul 2012 01:18:47 -0500 Subject: [PATCH 1/3] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- octave.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/octave.spec b/octave.spec index f6e8556..ff20acc 100644 --- a/octave.spec +++ b/octave.spec @@ -9,7 +9,7 @@ Name: octave Version: 3.6.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A high-level language for numerical computations Epoch: 6 Group: Applications/Engineering @@ -259,6 +259,9 @@ fi %changelog +* Fri Jul 20 2012 Fedora Release Engineering - 6:3.6.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Thu Jul 5 2012 Jussi Lehtola - 6:3.6.2-2 - Build against OpenGL libraries. From c7cdff71c3945134da555603ae3f7557c6474234 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 5 Sep 2012 16:53:55 -0600 Subject: [PATCH 2/3] Update to 3.6.3 - Drop gets patch fixed upstream --- .gitignore | 1 + octave-gets.patch | 86 ----------------------------------------------- octave.spec | 14 ++++---- sources | 2 +- 4 files changed, 9 insertions(+), 94 deletions(-) delete mode 100644 octave-gets.patch diff --git a/.gitignore b/.gitignore index 18f206a..2bef977 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ octave-3.2.4.tar.bz2 /octave-3.6.2-rc0.tar.bz2 /octave-3.6.2-rc2.tar.bz2 /octave-3.6.2.tar.bz2 +/octave-3.6.3.tar.bz2 diff --git a/octave-gets.patch b/octave-gets.patch deleted file mode 100644 index c7b8914..0000000 --- a/octave-gets.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff -up octave-3.6.2-rc2/libgnu/stdio.in.h.gets octave-3.6.2-rc2/libgnu/stdio.in.h ---- octave-3.6.2-rc2/libgnu/stdio.in.h.gets 2012-05-24 12:46:13.000000000 -0600 -+++ octave-3.6.2-rc2/libgnu/stdio.in.h 2012-05-24 16:29:54.813734894 -0600 -@@ -1,12 +1,10 @@ --/* -*- buffer-read-only: t -*- vi: set ro: */ --/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ - /* A GNU-like . - - Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -+ the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, -@@ -15,8 +13,7 @@ - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software Foundation, -- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -+ along with this program; if not, see . */ - - #if __GNUC__ >= 3 - @PRAGMA_SYSTEM_HEADER@ -@@ -55,7 +52,8 @@ - #include - - /* Get off_t and ssize_t. Needed on many systems, including glibc 2.8 -- and eglibc 2.11.2. */ -+ and eglibc 2.11.2. -+ May also define off_t to a 64-bit type on native Windows. */ - #include - - /* The __attribute__ feature is available in gcc versions 2.5 and later. -@@ -701,22 +699,11 @@ _GL_WARN_ON_USE (getline, "getline is un - # endif - #endif - --#if @GNULIB_GETS@ --# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ --# if !(defined __cplusplus && defined GNULIB_NAMESPACE) --# undef gets --# define gets rpl_gets --# endif --_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1))); --_GL_CXXALIAS_RPL (gets, char *, (char *s)); --# else --_GL_CXXALIAS_SYS (gets, char *, (char *s)); --# undef gets --# endif --_GL_CXXALIASWARN (gets); - /* It is very rare that the developer ever has full control of stdin, -- so any use of gets warrants an unconditional warning. Assume it is -- always declared, since it is required by C89. */ -+ so any use of gets warrants an unconditional warning; besides, C11 -+ removed it. */ -+#undef gets -+#if HAVE_RAW_DECL_GETS - _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); - #endif - -@@ -781,7 +768,7 @@ _GL_CXXALIASWARN (pclose); - #elif defined GNULIB_POSIXCHECK - # undef pclose - # if HAVE_RAW_DECL_PCLOSE --_GL_WARN_ON_USE (pclose, "popen is unportable - " -+_GL_WARN_ON_USE (pclose, "pclose is unportable - " - "use gnulib module pclose for more portability"); - # endif - #endif -@@ -1056,9 +1043,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is - # endif - #endif - --/* Some people would argue that sprintf should be handled like gets -- (for example, OpenBSD issues a link warning for both functions), -- since both can cause security holes due to buffer overruns. -+/* Some people would argue that all sprintf uses should be warned about -+ (for example, OpenBSD issues a link warning for it), -+ since it can cause security holes due to buffer overruns. - However, we believe that sprintf can be used safely, and is more - efficient than snprintf in those safe cases; and as proof of our - belief, we use sprintf in several gnulib modules. So this header diff --git a/octave.spec b/octave.spec index ff20acc..83b9c09 100644 --- a/octave.spec +++ b/octave.spec @@ -8,8 +8,8 @@ %endif Name: octave -Version: 3.6.2 -Release: 3%{?dist} +Version: 3.6.3 +Release: 1%{?dist} Summary: A high-level language for numerical computations Epoch: 6 Group: Applications/Engineering @@ -24,8 +24,6 @@ Source1: macros.octave # https://savannah.gnu.org/bugs/index.php?32839 # Fix building packages from directories Patch2: octave-3.4.0-pkgbuilddir.patch -# Update gnulib to handle gets deprecation -Patch3: octave-gets.patch URL: http://www.octave.org BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -86,7 +84,6 @@ This package contains documentation for Octave. %prep %setup -q -n %{name}-%{version}%{?rctag} %patch2 -p1 -b .pkgbuilddir -%patch3 -p1 -b .gets # Check permissions find -name *.cc -exec chmod 644 {} \; @@ -94,8 +91,7 @@ find -name *.cc -exec chmod 644 {} \; %build %global enable64 no export F77=gfortran -# TODO: arpack (and others?) appear to be bundled in libcruft.. -# --with-arpack is not an option anymore +# TODO: some items appear to be bundled in libcruft.. # gl2ps.c is bundled. Anything else? %configure --enable-shared --disable-static --enable-64=%enable64 \ --with-blas="-L%{_libdir}/atlas -lf77blas -latlas" --with-qrupdate \ @@ -259,6 +255,10 @@ fi %changelog +* Wed Sep 5 2012 Orion Poplawski - 6:3.6.3-1 +- Update to 3.6.3 +- Drop gets patch fixed upstream + * Fri Jul 20 2012 Fedora Release Engineering - 6:3.6.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild diff --git a/sources b/sources index a675f96..bfa783a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9a0ecca8e40749ef5c884b1a0265f038 octave-3.6.2.tar.bz2 +29ab7e502e5c963c058906f788670245 octave-3.6.3.tar.bz2 From a33f0eddc804829e3a8c8340bd6cffc8631bab8c Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 6 Sep 2012 11:46:59 -0600 Subject: [PATCH 3/3] Add upstream patch to fix sparse matrix test crash --- octave-sparse.patch | 171 ++++++++++++++++++++++++++++++++++++++++++++ octave.spec | 8 ++- 2 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 octave-sparse.patch diff --git a/octave-sparse.patch b/octave-sparse.patch new file mode 100644 index 0000000..a12038d --- /dev/null +++ b/octave-sparse.patch @@ -0,0 +1,171 @@ + +# HG changeset patch +# User David Bateman +# Date 1337385561 -7200 +# Node ID f2e72944847b9ec7cec586faa4c72ea91eb53881 +# Parent 997e05334f71269f16017ceb06a52cf33feced18 +Ensure sparse constructors have valid ridx and data indices even if they are zero matrices (bug #36104) + +diff --git a/liboctave/Sparse.cc b/liboctave/Sparse.cc +--- a/liboctave/Sparse.cc ++++ b/liboctave/Sparse.cc +@@ -235,7 +235,7 @@ + (*current_liboctave_error_handler) + ("Sparse::Sparse (const dim_vector&): dimension mismatch"); + else +- rep = new typename Sparse::SparseRep (dv(0), dv(1)); ++ rep = new typename Sparse::SparseRep (dv(0), dv(1), 0); + } + + template +@@ -301,11 +301,10 @@ + (*current_liboctave_error_handler) + ("sparse: column index %d out of bound %d", r.extent (nc), nc); + +- rep = new SparseRep (nr, nc); ++ rep = new typename Sparse::SparseRep (nr, nc, (nzm > 0 ? nzm : 0)); + + dimensions = dim_vector (nr, nc); + +- + octave_idx_type n = a.numel (), rl = r.length (nr), cl = c.length (nc); + bool a_scalar = n == 1; + if (a_scalar) +@@ -324,6 +323,7 @@ + if (n == 1 && a(0) != T ()) + { + change_capacity (nzm > 1 ? nzm : 1); ++ xcidx(0) = 0; + xridx(0) = r(0); + xdata(0) = a(0); + for (octave_idx_type j = 0; j < nc; j++) +@@ -352,6 +352,7 @@ + new_nz += rd[i-1] != rd[i]; + // Allocate result. + change_capacity (nzm > new_nz ? nzm : new_nz); ++ xcidx (0) = 0; + xcidx (1) = new_nz; + octave_idx_type *rri = ridx (); + T *rrd = data (); +@@ -494,6 +495,7 @@ + new_nz += rd[i-1] != rd[i]; + // Allocate result. + change_capacity (nzm > new_nz ? nzm : new_nz); ++ xcidx(0) = 0; + xcidx(1) = new_nz; + octave_idx_type *rri = ridx (); + T *rrd = data (); + + +# HG changeset patch +# User John W. Eaton +# Date 1340304125 14400 +# Node ID 4663cc835c65873fe12b599bcab11ba4a8f5fb87 +# Parent f2e72944847b9ec7cec586faa4c72ea91eb53881 +Special-case removing rows or columns from empty sparse matrices + +* Sparse.cc (Sparse::delete_elements): Don't attempt to preserve + elements if nnz = 0; simply reshape if number of rows or columns is zero. + +diff --git a/liboctave/Sparse.cc b/liboctave/Sparse.cc +--- a/liboctave/Sparse.cc ++++ b/liboctave/Sparse.cc +@@ -1240,16 +1240,31 @@ + gripe_del_index_out_of_range (false, idx_j.extent (nc), nc); + else if (idx_j.is_cont_range (nc, lb, ub)) + { +- const Sparse tmp = *this; +- octave_idx_type lbi = tmp.cidx(lb), ubi = tmp.cidx(ub), new_nz = nz - (ubi - lbi); +- *this = Sparse (nr, nc - (ub - lb), new_nz); +- copy_or_memcpy (lbi, tmp.data (), data ()); +- copy_or_memcpy (lbi, tmp.ridx (), ridx ()); +- copy_or_memcpy (nz - ubi, tmp.data () + ubi, xdata () + lbi); +- copy_or_memcpy (nz - ubi, tmp.ridx () + ubi, xridx () + lbi); +- copy_or_memcpy (lb, tmp.cidx () + 1, cidx () + 1); +- mx_inline_sub (nc - ub, xcidx () + lb + 1, +- tmp.cidx () + ub + 1, ubi - lbi); ++ if (lb == 0 && ub == nc) ++ { ++ // Delete all rows and columns. ++ *this = Sparse (nr, 0); ++ } ++ else if (nz == 0) ++ { ++ // No elements to preserve; adjust dimensions. ++ *this = Sparse (nr, nc - (ub - lb)); ++ } ++ else ++ { ++ const Sparse tmp = *this; ++ octave_idx_type lbi = tmp.cidx(lb), ubi = tmp.cidx(ub), ++ new_nz = nz - (ubi - lbi); ++ ++ *this = Sparse (nr, nc - (ub - lb), new_nz); ++ copy_or_memcpy (lbi, tmp.data (), data ()); ++ copy_or_memcpy (lbi, tmp.ridx (), ridx ()); ++ copy_or_memcpy (nz - ubi, tmp.data () + ubi, xdata () + lbi); ++ copy_or_memcpy (nz - ubi, tmp.ridx () + ubi, xridx () + lbi); ++ copy_or_memcpy (lb, tmp.cidx () + 1, cidx () + 1); ++ mx_inline_sub (nc - ub, xcidx () + lb + 1, ++ tmp.cidx () + ub + 1, ubi - lbi); ++ } + } + else + *this = index (idx_i, idx_j.complement (nc)); +@@ -1262,24 +1277,40 @@ + gripe_del_index_out_of_range (false, idx_i.extent (nr), nr); + else if (idx_i.is_cont_range (nr, lb, ub)) + { +- // This is more memory-efficient than the approach below. +- const Sparse tmpl = index (idx_vector (0, lb), idx_j); +- const Sparse tmpu = index (idx_vector (ub, nr), idx_j); +- *this = Sparse (nr - (ub - lb), nc, tmpl.nnz () + tmpu.nnz ()); +- for (octave_idx_type j = 0, k = 0; j < nc; j++) ++ if (lb == 0 && ub == nr) + { +- for (octave_idx_type i = tmpl.cidx(j); i < tmpl.cidx(j+1); i++) ++ // Delete all rows and columns. ++ *this = Sparse (0, nc); ++ } ++ else if (nz == 0) ++ { ++ // No elements to preserve; adjust dimensions. ++ *this = Sparse (nr - (ub - lb), nc); ++ } ++ else ++ { ++ // This is more memory-efficient than the approach below. ++ const Sparse tmpl = index (idx_vector (0, lb), idx_j); ++ const Sparse tmpu = index (idx_vector (ub, nr), idx_j); ++ *this = Sparse (nr - (ub - lb), nc, ++ tmpl.nnz () + tmpu.nnz ()); ++ for (octave_idx_type j = 0, k = 0; j < nc; j++) + { +- xdata(k) = tmpl.data(i); +- xridx(k++) = tmpl.ridx(i); ++ for (octave_idx_type i = tmpl.cidx(j); i < tmpl.cidx(j+1); ++ i++) ++ { ++ xdata(k) = tmpl.data(i); ++ xridx(k++) = tmpl.ridx(i); ++ } ++ for (octave_idx_type i = tmpu.cidx(j); i < tmpu.cidx(j+1); ++ i++) ++ { ++ xdata(k) = tmpu.data(i); ++ xridx(k++) = tmpu.ridx(i) + lb; ++ } ++ ++ xcidx(j+1) = k; + } +- for (octave_idx_type i = tmpu.cidx(j); i < tmpu.cidx(j+1); i++) +- { +- xdata(k) = tmpu.data(i); +- xridx(k++) = tmpu.ridx(i) + lb; +- } +- +- xcidx(j+1) = k; + } + } + else + diff --git a/octave.spec b/octave.spec index 83b9c09..8b24e1d 100644 --- a/octave.spec +++ b/octave.spec @@ -9,7 +9,7 @@ Name: octave Version: 3.6.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A high-level language for numerical computations Epoch: 6 Group: Applications/Engineering @@ -24,6 +24,8 @@ Source1: macros.octave # https://savannah.gnu.org/bugs/index.php?32839 # Fix building packages from directories Patch2: octave-3.4.0-pkgbuilddir.patch +# Upstream patches to fix spase matrix handling +Patch3: octave-sparse.patch URL: http://www.octave.org BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -84,6 +86,7 @@ This package contains documentation for Octave. %prep %setup -q -n %{name}-%{version}%{?rctag} %patch2 -p1 -b .pkgbuilddir +%patch3 -p1 -b .sparse # Check permissions find -name *.cc -exec chmod 644 {} \; @@ -255,6 +258,9 @@ fi %changelog +* Thu Sep 6 2012 Orion Poplawski - 6:3.6.3-2 +- Add upstream patch to fix sparse matrix test crash + * Wed Sep 5 2012 Orion Poplawski - 6:3.6.3-1 - Update to 3.6.3 - Drop gets patch fixed upstream