Code change:
<ins> From: Sebastián Mancilla <smancill@smancill.dev> Subject: [PATCH] Fix compile errors when using Eigen 3.4 --- .../machine/gp/MultiLaplaceInferenceMethod.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp index 2e27678d2..60050afea 100644 --- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp +++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp @@ -84,9 +84,9 @@ class CMultiPsiLine : public func_base float64_t result=0; for(index_t bl=0; bl<C; bl++) { -			eigen_f.block(bl*n,0,n,1)=K*alpha->block(bl*n,0,n,1)*CMath::exp(log_scale*2.0); -			result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0; -			eigen_f.block(bl*n,0,n,1)+=eigen_m; +			eigen_f.segment(bl*n,n)=K*alpha->segment(bl*n,n)*CMath::exp(log_scale*2.0); +			result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0; +			eigen_f.segment(bl*n,n)+=eigen_m; } // get first and second derivatives of log likelihood @@ -272,7 +272,7 @@ void CMultiLaplaceInferenceMethod::update_alpha() { Map<VectorXd> alpha(m_alpha.vector, m_alpha.vlen); for(index_t bl=0; bl<C; bl++) -			eigen_mu.block(bl*n,0,n,1)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.block(bl*n,0,n,1); +			eigen_mu.segment(bl*n,n)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.segment(bl*n,n); //alpha'*(f-m)/2.0 Psi_New=alpha.dot(eigen_mu)/2.0; @@ -316,7 +316,7 @@ void CMultiLaplaceInferenceMethod::update_alpha() for(index_t bl=0; bl<C; bl++) { -			VectorXd eigen_sD=eigen_dpi.block(bl*n,0,n,1).cwiseSqrt(); +			VectorXd eigen_sD=eigen_dpi.segment(bl*n,n).cwiseSqrt(); LLT<MatrixXd> chol_tmp((eigen_sD*eigen_sD.transpose()).cwiseProduct(eigen_ktrtr*CMath::exp(m_log_scale*2.0))+ MatrixXd::Identity(m_ktrtr.num_rows, m_ktrtr.num_cols)); MatrixXd eigen_L_tmp=chol_tmp.matrixU(); @@ -341,11 +341,11 @@ void CMultiLaplaceInferenceMethod::update_alpha() VectorXd tmp2=m_tmp.array().rowwise().sum(); for(index_t bl=0; bl<C; bl++) -			eigen_b.block(bl*n,0,n,1)+=eigen_dpi.block(bl*n,0,n,1).cwiseProduct(eigen_mu.block(bl*n,0,n,1)-eigen_mean_bl-tmp2); +			eigen_b.segment(bl*n,n)+=eigen_dpi.segment(bl*n,n).cwiseProduct(eigen_mu.segment(bl*n,n)-eigen_mean_bl-tmp2); Map<VectorXd> &eigen_c=eigen_W; for(index_t bl=0; bl<C; bl++) -			eigen_c.block(bl*n,0,n,1)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.block(bl*n,0,n,1)); +			eigen_c.segment(bl*n,n)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.segment(bl*n,n)); Map<MatrixXd> c_tmp(eigen_c.data(),n,C); @@ -409,7 +409,7 @@ float64_t CMultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix<float64_t { result+=((eigen_E.block(0,bl*n,n,n)-eigen_U.block(0,bl*n,n,n).transpose()*eigen_U.block(0,bl*n,n,n)).array() *eigen_dK.array()).sum(); -		result-=(eigen_dK*eigen_alpha.block(bl*n,0,n,1)).dot(eigen_alpha.block(bl*n,0,n,1)); +		result-=(eigen_dK*eigen_alpha.segment(bl*n,n)).dot(eigen_alpha.segment(bl*n,n)); } return result/2.0; @@ -489,7 +489,7 @@ SGVector<float64_t> CMultiLaplaceInferenceMethod::get_derivative_wrt_mean( result[i]=0; //currently only compute the explicit term for(index_t bl=0; bl<C; bl++) -			result[i]-=eigen_alpha.block(bl*n,0,n,1).dot(eigen_dmu); +			result[i]-=eigen_alpha.segment(bl*n,n).dot(eigen_dmu); } return result; </ins>

Related discussion:
text: shogun fails to build since the eigen 3.4.0 bump: The package is a likely candidate for removal. Upstream is unresponsive and development has halted. Removed from debian: Removed from fedora: Blocking vcpkg update: Please run and paste the result. Maintainer information:
I think you were the last one to modify this package, so please speak up if you need it. Also pinging Last call - if no one responds within the next week, I'll open a PR to remove this package.
Yes, I was working on making it build on Darwin and adding it as a Python 3 module. Well, I did, but I didn't feel motivated to create a PR. As you comment, upstream has been inactive for almost a year, the latest release is several years old, and it becomes harder and harder to make it work, and the patches would start to accumulate. To make it work on Darwin we need two upstream patches that fix the build with newer compiler versions. In the current derivation, the Python interface is not built because the CMake flag is not the right one. When enabled, Swig 3 is used to generate the Python interface, but Swig 3 doesn't support Python 3.8+ (and with Swig 4 just fails). It can be fixed with a patch, that feels more like a hack, intercepting the Makefile build, so I am not happy with it: Another small patch is needed to fix the deprecated . Also, I wasn't happy that adding it as a Python module will recompile the entire library again, which takes too much time IMO. I haven't checked if it is possible to build with Eigen 3.4 because it takes forever to compile. It could probably work on the development version. Note that the development version doesn't support Eigen 3.4 because of this, but it may work: But there is no such limitation on the 6.1.4 release, which probably means it would require another patch to fix the code, if somebody figures out. So, I'd argue that the package is too old now, and the derivation has too many issues, and it's too much of a hassle to maintain it, so it's probably better to just remove it.
I decided to sit and take a look at the error, and I actually fixed it.