Add patch for suitesparse 4.3.1 support

This commit is contained in:
Orion Poplawski 2014-09-15 17:43:40 -06:00
parent c6df50bec9
commit 864212af38
2 changed files with 276 additions and 1 deletions

268
octave-suitesparse.patch Normal file
View File

@ -0,0 +1,268 @@
diff -up octave-3.8.2/libinterp/dldfcn/amd.cc.suitesparse octave-3.8.2/libinterp/dldfcn/amd.cc
--- octave-3.8.2/libinterp/dldfcn/amd.cc.suitesparse 2014-08-06 11:57:55.000000000 -0600
+++ octave-3.8.2/libinterp/dldfcn/amd.cc 2014-09-12 15:53:32.819832086 -0600
@@ -164,11 +164,11 @@ The author of the code itself is Timothy
// FIXME: how can we manage the memory allocation of amd
// in a cleaner manner?
- amd_malloc = malloc;
- amd_free = free;
- amd_calloc = calloc;
- amd_realloc = realloc;
- amd_printf = printf;
+ suitesparse_assign_function(malloc_func, amd_malloc, malloc);
+ suitesparse_assign_function(free_func, amd_free, free);
+ suitesparse_assign_function(calloc_func, amd_calloc, calloc);
+ suitesparse_assign_function(realloc_func, amd_realloc, realloc);
+ suitesparse_assign_function(printf_func, amd_printf, printf);
octave_idx_type result = AMD_NAME (_order) (n_col, cidx, ridx, P,
Control, Info);
diff -up octave-3.8.2/libinterp/dldfcn/symbfact.cc.suitesparse octave-3.8.2/libinterp/dldfcn/symbfact.cc
--- octave-3.8.2/libinterp/dldfcn/symbfact.cc.suitesparse 2014-08-06 11:54:15.000000000 -0600
+++ octave-3.8.2/libinterp/dldfcn/symbfact.cc 2014-09-12 15:53:32.821832075 -0600
@@ -114,17 +114,17 @@ factorization as determined by @var{typ}
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
double dummy;
cholmod_sparse Astore;
diff -up octave-3.8.2/liboctave/array/CSparse.cc.suitesparse octave-3.8.2/liboctave/array/CSparse.cc
--- octave-3.8.2/liboctave/array/CSparse.cc.suitesparse 2014-08-06 11:57:55.000000000 -0600
+++ octave-3.8.2/liboctave/array/CSparse.cc 2014-09-12 15:53:33.791827033 -0600
@@ -5664,17 +5664,17 @@ SparseComplexMatrix::fsolve (MatrixType
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
@@ -5907,17 +5907,17 @@ SparseComplexMatrix::fsolve (MatrixType
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
@@ -6198,17 +6198,17 @@ SparseComplexMatrix::fsolve (MatrixType
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
@@ -6420,17 +6420,17 @@ SparseComplexMatrix::fsolve (MatrixType
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
diff -up octave-3.8.2/liboctave/array/dSparse.cc.suitesparse octave-3.8.2/liboctave/array/dSparse.cc
--- octave-3.8.2/liboctave/array/dSparse.cc.suitesparse 2014-08-06 11:57:55.000000000 -0600
+++ octave-3.8.2/liboctave/array/dSparse.cc 2014-09-12 15:53:33.756827215 -0600
@@ -5866,17 +5866,17 @@ SparseMatrix::fsolve (MatrixType &mattyp
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
@@ -6083,17 +6083,17 @@ SparseMatrix::fsolve (MatrixType &mattyp
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
@@ -6345,17 +6345,17 @@ SparseMatrix::fsolve (MatrixType &mattyp
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
@@ -6579,17 +6579,17 @@ SparseMatrix::fsolve (MatrixType &mattyp
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_ll = true;
diff -up octave-3.8.2/liboctave/numeric/sparse-base-chol.cc.suitesparse octave-3.8.2/liboctave/numeric/sparse-base-chol.cc
--- octave-3.8.2/liboctave/numeric/sparse-base-chol.cc.suitesparse 2014-08-06 11:54:14.000000000 -0600
+++ octave-3.8.2/liboctave/numeric/sparse-base-chol.cc 2014-09-12 15:53:33.521828437 -0600
@@ -105,17 +105,17 @@ sparse_base_chol<chol_type, chol_elt, p_
if (spu == 0.)
{
cm->print = -1;
- cm->print_function = 0;
+ suitesparse_assign_function(printf_func, cm->print_function, 0);
}
else
{
cm->print = static_cast<int> (spu) + 2;
- cm->print_function =&SparseCholPrint;
+ suitesparse_assign_function(printf_func, cm->print_function, &SparseCholPrint);
}
cm->error_handler = &SparseCholError;
- cm->complex_divide = CHOLMOD_NAME(divcomplex);
- cm->hypotenuse = CHOLMOD_NAME(hypot);
+ suitesparse_assign_function(divcomplex_func, cm->complex_divide, CHOLMOD_NAME(divcomplex));
+ suitesparse_assign_function(hypot_func, cm->hypotenuse, CHOLMOD_NAME(hypot));
cm->final_asis = false;
cm->final_super = false;
diff -up octave-3.8.2/liboctave/util/oct-sparse.h.suitesparse octave-3.8.2/liboctave/util/oct-sparse.h
--- octave-3.8.2/liboctave/util/oct-sparse.h.suitesparse 2014-08-06 11:54:15.000000000 -0600
+++ octave-3.8.2/liboctave/util/oct-sparse.h 2014-09-15 12:14:12.663644773 -0600
@@ -94,4 +94,12 @@ along with Octave; see the file COPYING.
#endif
#endif
+// Cope with new suitesparse versions
+//
+#if defined( SUITESPARSE_VERSION ) && SUITESPARSE_VERSION >= SUITESPARSE_VER_CODE(4,3)
+#define suitesparse_assign_function(f_name,f_var,f_assign) (SuiteSparse_config.f_name = f_assign)
+#else
+#define suitesparse_assign_function(f_name,f_var,f_assign) (f_var = f_assign)
+#endif
+
#endif

View File

@ -16,7 +16,7 @@
Name: octave Name: octave
Epoch: 6 Epoch: 6
Version: 3.8.2 Version: 3.8.2
Release: 5%{?dist} Release: 6%{?dist}
Summary: A high-level language for numerical computations Summary: A high-level language for numerical computations
Group: Applications/Engineering Group: Applications/Engineering
License: GPLv3+ License: GPLv3+
@ -32,6 +32,9 @@ Source1: macros.octave
# Fix to allow pkg build to use a directory # Fix to allow pkg build to use a directory
# https://savannah.gnu.org/bugs/?func=detailitem&item_id=32839 # https://savannah.gnu.org/bugs/?func=detailitem&item_id=32839
Patch0: octave-3.8.0-pkgbuilddir.patch Patch0: octave-3.8.0-pkgbuilddir.patch
# Patch to compile with suitesparse 4.3.1
# https://savannah.gnu.org/bugs/?func=detailitem&item_id=43063
Patch1: octave-suitesparse.patch
Provides: octave(api) = %{octave_api} Provides: octave(api) = %{octave_api}
Provides: bundled(gnulib) Provides: bundled(gnulib)
@ -115,6 +118,7 @@ This package contains documentation for Octave.
%prep %prep
%setup -q -n %{name}-%{version}%{?rctag} %setup -q -n %{name}-%{version}%{?rctag}
%patch0 -p1 -b .pkgbuilddir %patch0 -p1 -b .pkgbuilddir
%patch1 -p1 -b .suitesparse
find -name \*.h -o -name \*.cc | xargs sed -i -e 's/<config.h>/"config.h"/' -e 's/<base-list.h>/"base-list.h"/' find -name \*.h -o -name \*.cc | xargs sed -i -e 's/<config.h>/"config.h"/' -e 's/<base-list.h>/"base-list.h"/'
# Check permissions # Check permissions
@ -304,6 +308,9 @@ fi
%changelog %changelog
* Mon Sep 15 2014 Orion Poplawski <orion@cora.nwra.com> - 6:3.8.2-6
- Add patch for suitesparse 4.3.1 support
* Fri Sep 12 2014 Orion Poplawski <orion@cora.nwra.com> - 6:3.8.2-5 * Fri Sep 12 2014 Orion Poplawski <orion@cora.nwra.com> - 6:3.8.2-5
- Rebuild for libcholmod soname bump - Rebuild for libcholmod soname bump