RfastOfficial/Rfast

Installation/Compiling Error - Ubuntu (rvmf.cpp?)

patrickkoval opened this issue · 3 comments

I'm trying to install RFast but it gives me an error, seemingly regarding rvmf.cpp. I'll include the error output (everything in red after successful compilation) below.

Computer Details:

  • OS: Linux - Pop! OS (Ubuntu 22.04)
  • R-Version 4.3.2

Compiler Information (from output):
using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1 22.04) 11.4.0’
using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1 22.04) 11.4.0’
using C++17

Error Output:
rvmf.cpp: In function ‘void rvmf(unsigned int, arma::colvec, double, arma::mat&)’:
rvmf.cpp:87:24: error: no matching function for call to ‘randnarma::mat(unsigned int&, const uword&, arma::distr_param)’
87 | mat x1 = randn(n, mu.n_elem, distr_param(0, 1));
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/R/site-library/RcppArmadillo/include/armadillo:450,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadilloForward.h:48,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadillo.h:29,
from rvmf.cpp:4:
/usr/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()’
38 | randn()
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:38:1: note: template argument deduction/substitution failed:
/usr/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:24: required from here
/usr/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/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:62:1: note: candidate: ‘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*) [with obj_type = arma::Mat; arma::uword = unsigned int; typename arma::arma_Mat_Col_Row_only<obj_type>::result = arma::Mat]’
62 | 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/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:62:50: note: no known conversion for argument 2 from ‘const uword’ {aka ‘const unsigned int’} to ‘arma::arma_empty_class’
62 | 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)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/R/site-library/RcppArmadillo/include/armadillo:450,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadilloForward.h:48,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadillo.h:29,
from rvmf.cpp:4:
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:105:1: note: candidate: ‘const arma::Gen<T1, arma::gen_randn> arma::randn(arma::uword, arma::uword, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*) [with obj_type = arma::Mat; arma::uword = unsigned int; typename arma::arma_Mat_Col_Row_only<obj_type>::result = arma::Mat]’
105 | randn(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:105:103: note: no known conversion for argument 3 from ‘arma::distr_param’ to ‘const result*’ {aka ‘const arma::Mat’}
105 | randn(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<obj_type>::result
junk = nullptr)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:129:1: note: candidate: ‘const arma::Gen<T1, arma::gen_randn> arma::randn(const arma::SizeMat&, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*) [with obj_type = arma::Mat; typename arma::arma_Mat_Col_Row_only<obj_type>::result = arma::Mat]’
129 | randn(const SizeMat& s, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:129:1: note: candidate expects 2 arguments, 3 provided
/usr/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*)’
167 | randn(const uword n_rows, const uword n_cols, const uword n_slices, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:167:1: note: template argument deduction/substitution failed:
/usr/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:24: required from here
/usr/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/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*)’
181 | randn(const SizeCube& s, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randn.hpp:181:1: note: template argument deduction/substitution failed:
/usr/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:24: required from here
/usr/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:22: error: no matching function for call to ‘randuarma::colvec(unsigned int&, arma::distr_param)’
136 | u = randu(n, distr_param(0.0, pi_2));
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/R/site-library/RcppArmadillo/include/armadillo:449,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadilloForward.h:48,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadillo.h:29,
from rvmf.cpp:4:
/usr/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()’
38 | randu()
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:38:1: note: template argument deduction/substitution failed:
/usr/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:22: required from here
/usr/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/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:62:1: note: candidate: ‘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*) [with obj_type = arma::Col; arma::uword = unsigned int; typename arma::arma_Mat_Col_Row_only<obj_type>::result = arma::Col]’
62 | 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/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:62:50: note: no known conversion for argument 2 from ‘arma::distr_param’ to ‘arma::arma_empty_class’
62 | 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)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/R/site-library/RcppArmadillo/include/armadillo:449,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadilloForward.h:48,
from /usr/lib/R/site-library/RcppArmadillo/include/RcppArmadillo.h:29,
from rvmf.cpp:4:
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:105:1: note: candidate: ‘const arma::Gen<T1, arma::gen_randu> arma::randu(arma::uword, arma::uword, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*) [with obj_type = arma::Col; arma::uword = unsigned int; typename arma::arma_Mat_Col_Row_only<obj_type>::result = arma::Col]’
105 | randu(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:105:39: note: no known conversion for argument 2 from ‘arma::distr_param’ to ‘arma::uword’ {aka ‘unsigned int’}
105 | randu(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
| ~~~~~~~~~~~~^~~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:129:1: note: candidate: ‘const arma::Gen<T1, arma::gen_randu> arma::randu(const arma::SizeMat&, const typename arma::arma_Mat_Col_Row_only<obj_type>::result*) [with obj_type = arma::Col; typename arma::arma_Mat_Col_Row_only<obj_type>::result = arma::Col]’
129 | randu(const SizeMat& s, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:129:22: note: no known conversion for argument 1 from ‘unsigned int’ to ‘const arma::SizeMat&’
129 | randu(const SizeMat& s, const typename arma_Mat_Col_Row_only<obj_type>::result* junk = nullptr)
| ~~~~~~~~~~~~~~~^
/usr/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*)’
167 | randu(const uword n_rows, const uword n_cols, const uword n_slices, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:167:1: note: template argument deduction/substitution failed:
/usr/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:22: required from here
/usr/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/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*)’
181 | randu(const SizeCube& s, const typename arma_Cube_only<cube_type>::result* junk = nullptr)
| ^~~~~
/usr/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_randu.hpp:181:1: note: template argument deduction/substitution failed:
/usr/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:22: required from here
/usr/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 >’
make: *** [/usr/lib/R/etc/Makeconf:200: rvmf.o] Error 1
ERROR: compilation failed for package ‘Rfast’

  • removing ‘/home/patrickkoval/R/x86_64-pc-linux-gnu-library/4.3/Rfast’
    Warning in install.packages :
    installation of package ‘Rfast’ had non-zero exit status

Hello, I am afraid I cannot help since I don't have an Ubuntu system to test. Check if all the packages that Rfast depends are updated yo the latest version.

Yes, all packages are updated. I'll cross-post this to Rcpp's page to see if it's something with their package.

Update - Reinstalling RcppArmadillo and RcppParallel and then trying again fixed the issue.