Closed cdeverau closed 11 months ago
First of all upgrade R to the latest version. Also upgrade RcppArmadillo which seems to be the problem. Issue #85 has nothing to do.
I was also having the issue described in #85, which is why I mentioned it. Upgrading RcppArmadillo worked, thanks!
Describe the bug rvmf.cpp fails to compile consistently when attempting to install Rfast via CRAN or locally (as suggested in #85).
To Reproduce Copy-pasted from execution of packages.install("Rfast"):
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/usr/local/lib/R/site-library/Rcpp/include' -I'/usr/local/lib/R/site-library/RcppArmadillo/include' -I'/usr/local/lib/R/site-library/RcppParallel/include' -fopenmp -fpic -g -O2 -fdebug-prefix-map=/build/r-base-8OPFog/r-base-4.2.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c rvmf.cpp -o rvmf.o
Error: rvmf.cpp: In function ‘void rvmf(unsigned int, arma::colvec, double, arma::mat&)’: rvmf.cpp:87:56: error: no matching function for call to ‘randn(unsigned int&, const uword&, arma::distr_param)’
mat x1 = randn(n, mu.n_elem, distr_param(0, 1));
^
In file included from /usr/local/lib/R/site-library/RcppArmadillo/include/armadillo:451:0,
from /usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloForward.h:48,
from /usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadillo.h:29,
from rvmf.cpp:4:
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:38:1: note: candidate: template typename arma::arma_real_or_cx_only::result arma::randn()
randn()
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:38:1: note: template argument deduction/substitution failed:
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp: In substitution of ‘template typename arma::arma_real_or_cx_only::result arma::randn() [with eT = arma::Mat]’:
rvmf.cpp:87:56: required from here
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:38:1: error: no type named ‘result’ in ‘struct arma::arma_real_or_cx_only<arma::Mat >’
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:62:1: note: candidate: template const arma::Gen<T1, arma::gen_randn> arma::randn(arma::uword, arma::arma_empty_class, const typename arma::arma_Mat_Col_Row_only::result)
randn(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only::result junk2 = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:62:1: note: template argument deduction/substitution failed:
rvmf.cpp:87:31: note: cannot convert ‘mu.arma::Col::.arma::Mat::n_elem’ (type ‘const uword {aka const unsigned int}’) to type ‘arma::arma_empty_class’
mat x1 = randn(n, mu.n_elem, distr_param(0, 1));