diff --git a/octave-suitesparse.patch b/octave-suitesparse.patch new file mode 100644 index 0000000..27e435f --- /dev/null +++ b/octave-suitesparse.patch @@ -0,0 +1,293 @@ +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-16 15:14:12.538123673 -0600 +@@ -24,7 +24,7 @@ along with Octave; see the file COPYING. + // in the help of the functions. + + #ifdef HAVE_CONFIG_H +-#include ++#include "config.h" + #endif + + #include +@@ -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-16 15:22:41.924557046 -0600 +@@ -22,7 +22,7 @@ along with Octave; see the file COPYING. + */ + + #ifdef HAVE_CONFIG_H +-#include ++#include "config.h" + #endif + + #include "SparseCmplxCHOL.h" +@@ -114,17 +114,15 @@ 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 (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); + + 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-16 15:22:16.310677157 -0600 +@@ -23,7 +23,7 @@ along with Octave; see the file COPYING. + */ + + #ifdef HAVE_CONFIG_H +-#include ++#include "config.h" + #endif + + #include +@@ -5664,17 +5664,15 @@ 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 (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); + + cm->final_ll = true; + +@@ -5907,17 +5905,15 @@ 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 (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); + + cm->final_ll = true; + +@@ -6198,17 +6194,15 @@ 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 (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); + + cm->final_ll = true; + +@@ -6420,17 +6414,15 @@ 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 (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); + + 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-16 15:22:01.253747787 -0600 +@@ -23,7 +23,7 @@ along with Octave; see the file COPYING. + */ + + #ifdef HAVE_CONFIG_H +-#include ++#include "config.h" + #endif + + #include +@@ -5866,17 +5866,15 @@ 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 (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); + + cm->final_ll = true; + +@@ -6083,17 +6081,15 @@ 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 (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); + + cm->final_ll = true; + +@@ -6345,17 +6341,15 @@ 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 (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); + + cm->final_ll = true; + +@@ -6579,17 +6573,15 @@ 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 (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); + + 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-16 15:23:24.252358549 -0600 +@@ -22,7 +22,7 @@ along with Octave; see the file COPYING. + */ + + #ifdef HAVE_CONFIG_H +-#include ++#include "config.h" + #endif + + #include "sparse-base-chol.h" +@@ -105,17 +105,15 @@ sparse_base_cholprint = -1; +- cm->print_function = 0; ++ suitesparse_assign_function(printf_func, cm->print_function, 0); + } + else + { + cm->print = static_cast (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); + + 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-16 15:14:13.417119567 -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 diff --git a/octave.spec b/octave.spec index 0c873ce..8afbea5 100644 --- a/octave.spec +++ b/octave.spec @@ -1,6 +1,12 @@ # From src/version.h:#define OCTAVE_API_VERSION %global octave_api api-v49+ +# Building docs fails on EL7 due to https://bugzilla.redhat.com/show_bug.cgi?id=1064453 +%if 0%{?rhel} == 7 +%global builddocs 0 +%else +%global builddocs 1 +%endif # For rc versions, change release manually #global rcver 2 %if 0%{?rcver:1} @@ -10,7 +16,7 @@ Name: octave Epoch: 6 Version: 3.8.2 -Release: 2%{?dist} +Release: 7%{?dist} Summary: A high-level language for numerical computations Group: Applications/Engineering License: GPLv3+ @@ -26,6 +32,9 @@ Source1: macros.octave # Fix to allow pkg build to use a directory # https://savannah.gnu.org/bugs/?func=detailitem&item_id=32839 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: bundled(gnulib) @@ -109,6 +118,7 @@ This package contains documentation for Octave. %prep %setup -q -n %{name}-%{version}%{?rctag} %patch0 -p1 -b .pkgbuilddir +%patch1 -p1 -b .suitesparse find -name \*.h -o -name \*.cc | xargs sed -i -e 's//"config.h"/' -e 's//"base-list.h"/' # Check permissions @@ -126,8 +136,12 @@ export F77=gfortran %global atlasblaslib -lf77blas -latlas %global atlaslapacklib -llapack %endif +%if !%{builddocs} +%global disabledocs --disable-docs +%endif # JIT support is still experimental, and causes a segfault on ARM. %configure --enable-shared --disable-static --enable-64=%enable64 \ + %{?disabledocs} \ --with-blas="-L%{_libdir}/atlas %{atlasblaslib}" \ --with-lapack="-L%{_libdir}/atlas %{atlaslapacklib}" \ --with-qrupdate \ @@ -226,25 +240,39 @@ exec \$LIB_DIR/%{name}/%{version}%{?rctag}/${script} "\$@" EOF chmod +x %{buildroot}%{_bindir}/${script} done +%if %{builddocs} # remove timestamp from doc-cache sed -i -e '/^# Created by Octave/d' %{buildroot}%{_datadir}/%{name}/%{version}%{?rctag}/etc/doc-cache +%else +cp -p doc/interpreter/macros.texi %{buildroot}%{_datadir}/%{name}/%{version}/etc/macros.texi +%endif # rpm macros mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d cp -p %SOURCE1 %{buildroot}%{_rpmconfigdir}/macros.d/ %check +# Tests are currently segfaulting on arm +# https://bugzilla.redhat.com/show_bug.cgi?id=1149953 +%ifarch %{arm} +make check || : +%else make check +%endif %post /sbin/ldconfig +%if %{builddocs} /sbin/install-info --info-dir=%{_infodir} --section="Programming" \ %{_infodir}/octave.info || : +%endif %preun +%if %{builddocs} if [ "$1" = "0" ]; then /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/octave.info || : fi +%endif %postun -p /sbin/ldconfig @@ -255,9 +283,11 @@ fi %{_bindir}/octave* %{_libdir}/octave/ %{_libexecdir}/octave/ +%if %{builddocs} %{_mandir}/man1/octave*.1.* %{_infodir}/liboctave.info* %{_infodir}/octave.info* +%endif %{_datadir}/applications/octave.desktop # octave_packages is %ghost, so need to list everything else separately %dir %{_datadir}/octave @@ -273,7 +303,9 @@ fi %{_bindir}/mkoctfile %{_bindir}/mkoctfile-%{version}%{?rctag} %{_includedir}/octave-%{version}%{?rctag}/ +%if %{builddocs} %{_mandir}/man1/mkoctfile.1.* +%endif %files doc %doc doc/liboctave/liboctave.html doc/liboctave/liboctave.pdf @@ -282,6 +314,21 @@ fi %changelog +* Mon Oct 6 2014 Orion Poplawski - 6:3.8.2-7 +- Disable test failure on arm for now (bug #1149953) + +* Mon Sep 15 2014 Orion Poplawski - 6:3.8.2-6 +- Add patch for suitesparse 4.3.1 support + +* Fri Sep 12 2014 Orion Poplawski - 6:3.8.2-5 +- Rebuild for libcholmod soname bump + +* Sat Aug 23 2014 Orion Poplawski - 6:3.8.2-4 +- No info scripts when not building docs + +* Fri Aug 22 2014 Orion Poplawski - 6:3.8.2-3 +- Install macros.texi by hand if not building docs + * Sun Aug 17 2014 Fedora Release Engineering - 6:3.8.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild