Compilation error with 1.0.9 and VS-2012 #348

Closed
rcurtin opened this Issue Dec 29, 2014 · 1 comment

Projects

None yet

1 participant

@rcurtin
Member
rcurtin commented Dec 29, 2014

Reported by SinisterMJ on 1 Nov 44639477 17:35 UTC
I have tried to compile 1.0.9 (already had 1.0.8 working), and I get following error(s):

Error 10 error C2784: 'const arma::eOpCube<T1,arma::eop_log2> arma::log2(const arma::BaseCubeT1::elem_type,T1 &)' : could not deduce template argument for 'const arma::BaseCubeT1::elem_type,T1 &' from 'const double' g:\glukosescanner\mlpack-1.0.9\src\mlpack\methods\decision_stump\decision_stump_impl.hpp 435

Error 21 error C2784: 'const arma::eOpCube<T1,arma::eop_log2> arma::log2(const arma::BaseCubeT1::elem_type,T1 &)' : could not deduce template argument for 'const arma::BaseCubeT1::elem_type,T1 &' from 'const double' g:\glukosescanner\mlpack-1.0.9\src\mlpack\methods\decision_stump\decision_stump_impl.hpp 435

Error 11 error C2893: Failed to specialize function template 'enable_if2arma::is_arma_type<T1::value,const arma::eOp<T1,arma::eop_log2>>::result arma::log2(const T1 &)' g:\glukosescanner\mlpack-1.0.9\src\mlpack\methods\decision_stump\decision_stump_impl.hpp 435

Error 22 error C2893: Failed to specialize function template 'enable_if2arma::is_arma_type<T1::value,const arma::eOp<T1,arma::eop_log2>>::result arma::log2(const T1 &)' g:\glukosescanner\mlpack-1.0.9\src\mlpack\methods\decision_stump\decision_stump_impl.hpp 435

@rcurtin rcurtin self-assigned this Dec 29, 2014
@rcurtin rcurtin closed this Dec 29, 2014
@rcurtin
Member
rcurtin commented Dec 30, 2014

Commented by rcurtin on 18 Apr 44661661 20:59 UTC
Hi there,

It took me some time to get the build server's Visual Studio setup working again, but when I did, I managed to reproduce the issue. I fixed it in r17129 and r17131, and I will be releasing mlpack 1.0.10, which contains a couple of bugfixes, later today, so you can download and use that and shouldn't have any problems.

The issue was that log2() may not exist in Visual Studio since Microsoft still hasn't bothered to implement C99, and log2() is a C99 function. So, the solution I chose was to use std::log() then the change-of-base formula to convert std::log() to log2().

Thanks for your patience, and sorry this took so long.

Thanks,

Ryan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment