Unable to install
cdeverau opened this issue · 2 comments
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 ‘randnarma::mat(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<obj_type>::result*)
randn(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only<obj_type>::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));
~~~^~~~~~
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:105:1: note: candidate: template const arma::Gen<T1, arma::gen_randn> arma::randn(arma::uword, arma::uword, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*)
randn(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:105:1: note: template argument deduction/substitution failed:
rvmf.cpp:87:39: note: cannot convert ‘arma::distr_param(0, 1)’ (type ‘arma::distr_param’) to type ‘const result* {aka const arma::Mat}’
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:129:1: note: candidate: template const arma::Gen<T1, arma::gen_randn> arma::randn(const arma::SizeMat&, const typename arma::arma_Mat_Col_Row_only<obj_type>::result)
randn(const SizeMat& s, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:129:1: note: template argument deduction/substitution failed:
rvmf.cpp:87:56: note: candidate expects 2 arguments, 3 provided
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:167:1: note: candidate: template const arma::GenCube<typename cube_type::elem_type, arma::gen_randn> arma::randn(arma::uword, arma::uword, arma::uword, const typename arma::arma_Cube_only<cube_type>::result*)
randn(const uword n_rows, const uword n_cols, const uword n_slices, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:167:1: note: template argument deduction/substitution failed:
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp: In substitution of ‘template const arma::GenCube<typename cube_type::elem_type, arma::gen_randn> arma::randn(arma::uword, arma::uword, arma::uword, const typename arma::arma_Cube_only<cube_type>::result*) [with cube_type = arma::Mat]’:
rvmf.cpp:87:56: required from here
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:167:1: error: no type named ‘result’ in ‘struct arma::arma_Cube_only<arma::Mat >’
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:181:1: note: candidate: template const arma::GenCube<typename cube_type::elem_type, arma::gen_randn> arma::randn(const arma::SizeCube&, const typename arma::arma_Cube_only<cube_type>::result*)
randn(const SizeCube& s, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:181:1: note: template argument deduction/substitution failed:
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp: In substitution of ‘template const arma::GenCube<typename cube_type::elem_type, arma::gen_randn> arma::randn(const arma::SizeCube&, const typename arma::arma_Cube_only<cube_type>::result*) [with cube_type = arma::Mat]’:
rvmf.cpp:87:56: required from here
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:181:1: error: no type named ‘result’ in ‘struct arma::arma_Cube_only<arma::Mat >’
rvmf.cpp: In function ‘T rvonmises(unsigned int, double, double, bool)’:
rvmf.cpp:136:48: error: no matching function for call to ‘randuarma::colvec(unsigned int&, arma::distr_param)’
u = randu(n, distr_param(0.0, pi_2));
^
In file included from /usr/local/lib/R/site-library/RcppArmadillo/include/armadillo:450: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_randu.hpp:38:1: note: candidate: template typename arma::arma_real_or_cx_only::result arma::randu()
randu()
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:38:1: note: template argument deduction/substitution failed:
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp: In substitution of ‘template typename arma::arma_real_or_cx_only::result arma::randu() [with eT = arma::Col]’:
rvmf.cpp:136:48: required from here
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:38:1: error: no type named ‘result’ in ‘struct arma::arma_real_or_cx_only<arma::Col >’
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:62:1: note: candidate: template const arma::Gen<T1, arma::gen_randu> arma::randu(arma::uword, arma::arma_empty_class, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*)
randu(const uword n_elem, const arma_empty_class junk1 = arma_empty_class(), const typename arma_Mat_Col_Row_only<obj_type>::result* junk2 = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:62:1: note: template argument deduction/substitution failed:
rvmf.cpp:136:48: note: cannot convert ‘arma::distr_param(0.0, pi_2)’ (type ‘arma::distr_param’) to type ‘arma::arma_empty_class’
u = randu(n, distr_param(0.0, pi_2));
^
In file included from /usr/local/lib/R/site-library/RcppArmadillo/include/armadillo:450: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_randu.hpp:105:1: note: candidate: template const arma::Gen<T1, arma::gen_randu> arma::randu(arma::uword, arma::uword, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*)
randu(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:105:1: note: template argument deduction/substitution failed:
rvmf.cpp:136:48: note: cannot convert ‘arma::distr_param(0.0, pi_2)’ (type ‘arma::distr_param’) to type ‘arma::uword {aka unsigned int}’
u = randu(n, distr_param(0.0, pi_2));
^
In file included from /usr/local/lib/R/site-library/RcppArmadillo/include/armadillo:450: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_randu.hpp:129:1: note: candidate: template const arma::Gen<T1, arma::gen_randu> arma::randu(const arma::SizeMat&, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*)
randu(const SizeMat& s, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:129:1: note: template argument deduction/substitution failed:
rvmf.cpp:136:48: note: cannot convert ‘n’ (type ‘unsigned int’) to type ‘const arma::SizeMat&’
u = randu(n, distr_param(0.0, pi_2));
^
In file included from /usr/local/lib/R/site-library/RcppArmadillo/include/armadillo:450: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_randu.hpp:167:1: note: candidate: template const arma::GenCube<typename cube_type::elem_type, arma::gen_randu> arma::randu(arma::uword, arma::uword, arma::uword, const typename arma::arma_Cube_only<cube_type>::result*)
randu(const uword n_rows, const uword n_cols, const uword n_slices, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:167:1: note: template argument deduction/substitution failed:
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp: In substitution of ‘template const arma::GenCube<typename cube_type::elem_type, arma::gen_randu> arma::randu(arma::uword, arma::uword, arma::uword, const typename arma::arma_Cube_only<cube_type>::result*) [with cube_type = arma::Col]’:
rvmf.cpp:136:48: required from here
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:167:1: error: no type named ‘result’ in ‘struct arma::arma_Cube_only<arma::Col >’
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:181:1: note: candidate: template const arma::GenCube<typename cube_type::elem_type, arma::gen_randu> arma::randu(const arma::SizeCube&, const typename arma::arma_Cube_only<cube_type>::result*)
randu(const SizeCube& s, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
^~~~~
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:181:1: note: template argument deduction/substitution failed:
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp: In substitution of ‘template const arma::GenCube<typename cube_type::elem_type, arma::gen_randu> arma::randu(const arma::SizeCube&, const typename arma::arma_Cube_only<cube_type>::result*) [with cube_type = arma::Col]’:
rvmf.cpp:136:48: required from here
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:181:1: error: no type named ‘result’ in ‘struct arma::arma_Cube_only<arma::Col >’
/usr/lib/R/etc/Makeconf:177: recipe for target 'rvmf.o' failed
make: *** [rvmf.o] Error 1
ERROR: compilation failed for package ‘Rfast’
Expected behavior
Installation of the package.
Desktop (please complete the following information):
- OS: Ubuntu 18.04
- R-Version 4.2.1
- Rfast-Version current, fresh install
Any help is appreciated, thank you!
First of all upgrade R to the latest version. Also upgrade RcppArmadillo which seems to be the problem. Issue #85 has nothing to do.