Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling with RCpp: no match for call to function #61

Open
ahoundetoungan opened this issue Feb 6, 2023 · 4 comments
Open

Comments

@ahoundetoungan
Copy link

ahoundetoungan commented Feb 6, 2023

I get these errors when compiling my the cpp file with Rcpp

From the file nm.hpp
unconstrained/nm.hpp:230:58: error: no match for call to ‘(optim::ColVec_t {aka arma::Col<double>}) (optim::ColVecUInt_t&)’

From the file core/access.hpp
core/access.hpp:27:43: error: no matching function for call to ‘arma::Mat<double>::rows(optim::ColVecUInt_t&)’

I also got a lot of notes and warnings: for example int used at the place of long.
Did I miss something? I followed method 2 for the installation.

@kthohr
Copy link
Owner

kthohr commented Feb 8, 2023

Can you provide some details about the system you're compiling this on?

@ahoundetoungan
Copy link
Author

Thank you for your answer.
I tested on many computers but all have Ubuntu (20.04 somewhere and 22.04 somewhere). I thought that I should update RcppArmadillo. But that does not fix the issue.

@kthohr
Copy link
Owner

kthohr commented Feb 12, 2023

Can you provide a minimal reproducible example that generates this error?

@oelhammouchi
Copy link

I've experienced this problem as well. It appears to be related to the fact that RcppArmadillo forces the use of 32 bit integers (this is required by R itself, see https://stackoverflow.com/questions/57802546/unable-to-load-armadillo-cubeuword-when-using-rcpparmadillo). I managed to solve it by replacing line 150 in include/misc/optim_options.hpp from

using ColVecUInt_t = arma::Col<unsigned long long>;

to

using ColVecUInt_t = arma::uvec;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants