[Rcpp-devel] Debugging Rcpp for Solaris
Kevin Ushey
kevinushey at gmail.com
Wed Jan 9 16:25:58 CET 2019
Many of the Solaris quirks are documented in R-exts:
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Portable-C-and-C_002b_002b-code
In particular:
Mathematical functions such as sqrt are defined in C++ for
floating-point arguments. It is legitimate in C++ to overload these
with versions for types float, double, long double and possibly more.
This means that calling sqrt on an integer type may have ‘overloading
ambiguity’ as it could be promoted to any of the supported
floating-point types: this is commonly seen on Solaris, but for pow
also seen on macOS. (C++98 has an overload for std::pow(<double>,
<int>), but this may not be visible from the main namespace. C++11
requires additional overloads for integer types, and ambiguous
overloads are more common in C++11 (and later) compiler modes.)
You seem to be bumping into some form of this.
That said, it seems unlikely that you intended to take the log of a bool...
Best,
Kevin
On Wed, Jan 9, 2019 at 6:04 AM mike guggis <mikeguggis at gmail.com> wrote:
>
> Hello,
>
> I submitted a package to CRAN that passed all checks in RStudio but failed when it was tested on Solaris (after it was on CRAN). Now I need to correct the error and resubmit to CRAN. I would like to avoid using CRAN as a debugging tool. Is there a way to check packages on Solaris? I am using Windows 10.
>
> The packages checks are here https://cran.r-project.org/web/checks/check_results_BiProbitPartial.html
>
> An excerpt of the error is below
>
> BiProbitPartialMCMC.cpp:424:49: error: call of overloaded ‘log(bool)’ is ambiguous
> double SupportRatio = log(abs(rhoStar)<1) - log(abs(rho)<1);
> ^
>
> There is a similar error for the second log function. It seems I can simply fix it with an if/else statement, but I would like to check it before submitting back to CRAN.
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
More information about the Rcpp-devel
mailing list