diff -Nru shogun-3.2.0/debian/changelog shogun-3.2.0/debian/changelog --- shogun-3.2.0/debian/changelog 2014-10-21 03:23:59.000000000 +0000 +++ shogun-3.2.0/debian/changelog 2016-07-28 19:12:37.000000000 +0000 @@ -1,3 +1,9 @@ +shogun (3.2.0-7.3+rpi1) stretch-staging; urgency=medium + + * Apply patch from Debian bts to fix build with eigen 3.3 (Closes: 809290) + + -- Peter Michael Green Thu, 28 Jul 2016 19:12:05 +0000 + shogun (3.2.0-7.3) unstable; urgency=medium * Non-maintainer upload. diff -Nru shogun-3.2.0/debian/patches/eigen3.3.patch shogun-3.2.0/debian/patches/eigen3.3.patch --- shogun-3.2.0/debian/patches/eigen3.3.patch 1970-01-01 00:00:00.000000000 +0000 +++ shogun-3.2.0/debian/patches/eigen3.3.patch 2016-07-28 19:11:41.000000000 +0000 @@ -0,0 +1,166 @@ +Description: Fix build with Eigen 3.3 +Origin: upstream, https://github.com/shogun-toolbox/shogun/commit/57cd0958b153accf12f535ab9406dc8511bf22ec +Bug: https://github.com/shogun-toolbox/shogun/issues/3140 +Bug: https://github.com/shogun-toolbox/shogun/issues/3141 +Bug-Debian: https://bugs.debian.org/809290 +Author: Viktor Gal +Last-Update: 2016-05-18 +--- a/src/shogun/lib/tapkee/defines.hpp ++++ b/src/shogun/lib/tapkee/defines.hpp +@@ -49,12 +49,12 @@ + TapkeeOutput(const tapkee::DenseMatrix& e, const tapkee::ProjectingFunction& p) : + embedding(), projection(p) + { +- embedding.swap(e); ++ embedding = e; + } + TapkeeOutput(const TapkeeOutput& that) : + embedding(), projection(that.projection) + { +- this->embedding.swap(that.embedding); ++ this->embedding = that.embedding; + } + tapkee::DenseMatrix embedding; + tapkee::ProjectingFunction projection; +--- a/src/shogun/mathematics/eigen3.h ++++ b/src/shogun/mathematics/eigen3.h +@@ -62,6 +62,13 @@ + + #endif //EIGEN_VERSION_AT_LEAST(3,0,93) + ++#if ((EIGEN_WORLD_VERSION == 3) && (EIGEN_MAJOR_VERSION == 2) && \ ++ ((EIGEN_MINOR_VERSION == 91) || (EIGEN_MINOR_VERSION == 92))) ++ // Regression has been introduced to eigen develop (3.3alpha1+): ++ // http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1229 ++ // until this is not fixed we need to copy the matrix and calculate the log ++ #define EIGEN_WITH_LOG_BUG_1229 1 ++#endif + namespace shogun + { + template class SGSparseMatrix; +--- a/src/shogun/mathematics/linalg/ratapprox/logdet/opfunc/DenseMatrixExactLog.cpp ++++ b/src/shogun/mathematics/linalg/ratapprox/logdet/opfunc/DenseMatrixExactLog.cpp +@@ -64,7 +64,12 @@ + Map mat(m.matrix, m.num_rows, m.num_cols); + SGMatrix log_m(m.num_rows, m.num_cols); + Map log_mat(log_m.matrix, log_m.num_rows, log_m.num_cols); ++#if EIGEN_WITH_LOG_BUG_1229 ++ MatrixXd tmp = mat; ++ log_mat=tmp.log(); ++#else + log_mat=mat.log(); ++#endif + + // the log(C) is also a linear operator here + // reset the operator of this function with log(C) +--- a/tests/unit/lib/computation/SerialComputationEngine_unittest.cc ++++ b/tests/unit/lib/computation/SerialComputationEngine_unittest.cc +@@ -41,7 +41,12 @@ + mat(1,1)=3.0; + Map m(mat.matrix, mat.num_rows, mat.num_cols); + Map log_m(log_mat.matrix, log_mat.num_rows, log_mat.num_cols); ++#if EIGEN_WITH_LOG_BUG_1229 ++ MatrixXd tmp = m; ++ log_m=tmp.log(); ++#else + log_m=m.log(); ++#endif + + // create linear operator and aggregator + CDenseMatrixOperator* log_op=new CDenseMatrixOperator(log_mat); +--- a/tests/unit/mathematics/linalg/DenseExactLogJob_unittest.cc ++++ b/tests/unit/mathematics/linalg/DenseExactLogJob_unittest.cc +@@ -39,7 +39,12 @@ + mat(1,1)=3.0; + Map m(mat.matrix, mat.num_rows, mat.num_cols); + Map log_m(log_mat.matrix, log_mat.num_rows, log_mat.num_cols); ++#if EIGEN_WITH_LOG_BUG_1229 ++ MatrixXd tmp = m; ++ log_m=tmp.log(); ++#else + log_m=m.log(); ++#endif + + // create linear operator and aggregator + CDenseMatrixOperator* log_op=new CDenseMatrixOperator(log_mat); +--- a/tests/unit/mathematics/linalg/RationalApproximation_unittest.cc ++++ b/tests/unit/mathematics/linalg/RationalApproximation_unittest.cc +@@ -185,7 +185,12 @@ + #if EIGEN_VERSION_AT_LEAST(3,1,0) + // compute the trace of log(m) using Eigen3 that uses Schur-Parlett algorithm + Map eig_m(m.matrix, m.num_rows, m.num_cols); ++#if EIGEN_WITH_LOG_BUG_1229 ++ MatrixXd tmp = eig_m; ++ float64_t trace_log_m=tmp.log().diagonal().sum(); ++#else + float64_t trace_log_m=eig_m.log().diagonal().sum(); ++#endif + #else + float64_t trace_log_m=-11.51292546497021618279; + #endif // EIGEN_VERSION_AT_LEAST(3,1,0) +@@ -367,7 +372,12 @@ + #if EIGEN_VERSION_AT_LEAST(3,1,0) + // compute the trace of log(m) using Eigen3 that uses Schur-Parlett algorithm + Map eig_m(m.matrix, m.num_rows, m.num_cols); ++#if EIGEN_WITH_LOG_BUG_1229 ++ MatrixXd tmp = eig_m; ++ float64_t trace_log_m=tmp.log().diagonal().sum(); ++#else + float64_t trace_log_m=eig_m.log().diagonal().sum(); ++#endif + #else + float64_t trace_log_m=-11.51292546497021618279; + #endif // EIGEN_VERSION_AT_LEAST(3,1,0) +--- a/tests/unit/mathematics/linalg/SparseMatrixOperator_unittest.cc ++++ b/tests/unit/mathematics/linalg/SparseMatrixOperator_unittest.cc +@@ -220,33 +220,37 @@ + + TEST(SparseMatrixOperator, get_sparsity_structure) + { +- const int size=9; +- const int max_pow=10; ++ const int32_t size=9; ++ const int32_t max_pow=10; + +- SGMatrix m(size, size); ++ SGMatrix m(size, size); + + m.set_const(0.0); +- for (int i=0; i feat(m); +- SGSparseMatrix sm=feat.get_sparse_feature_matrix(); +- CSparseMatrixOperator op(sm); ++ CSparseFeatures feat(m); ++ SGSparseMatrix sm=feat.get_sparse_feature_matrix(); ++ CSparseMatrixOperator op(sm); + CSparseMatrixOperator* b_op + =static_cast*>(op); + +- SparseMatrix sp ++ SparseMatrix sp + =EigenSparseUtil::toEigenSparse(b_op->get_matrix_operator()); +- SparseMatrix sm2 +- =EigenSparseUtil::toEigenSparse(sm); ++ SparseMatrix sm2 ++ =EigenSparseUtil::toEigenSparse(sm); + + // compute direct matrix power and then the sparsity structure +- for (int i=2; i<=max_pow; ++i) ++ for (int32_t i=2; i<=max_pow; ++i) ++#if EIGEN_VERSION_AT_LEAST(3,2,91) ++ sp=(sp.cast()*sm2).cast(); ++#else + sp=sp*sm2; ++#endif + + int32_t* outerIndexPtr=const_cast(sp.outerIndexPtr()); + int32_t* innerIndexPtr=const_cast(sp.innerIndexPtr()); diff -Nru shogun-3.2.0/debian/patches/series shogun-3.2.0/debian/patches/series --- shogun-3.2.0/debian/patches/series 2014-07-07 14:56:42.000000000 +0000 +++ shogun-3.2.0/debian/patches/series 2016-07-28 19:11:52.000000000 +0000 @@ -1 +1,3 @@ disable_sse.diff +eigen3.3.patch +