My colleague @dbarneche and I recently submitted our package fishflux to CRAN. Even though it passed all automatic checks at first, there seems to be an error for solaris.
I then received an email asking to fix the issue if we want to keep our package on cran, with the following:
This is covered in the manual 'Writing R Extensions Why did you not use 8.65e-5?
Could anyone please help us decipher the error that seems to be related to stan? You can find the check results here.
I asked the cran team for more information and they responded this:
stanExports_getB0.h:148:50: error: call of overloaded ‘pow(int, int)’ is ambiguous
stan::math::assign(k,(8.62 * pow(10, -(5))));
And then see “Portable C and C++ code” in R-exts …
I am afraid I cannot make any sense of this. Thanks in advance for any help!
Do you mean that when a user does install.packages("fishflux") it starts to compile? As far as I know that should only happen in two situations:
the user is running linux (CRAN doesn’t build binaries for linux)
you’ve recently submitted a package update to CRAN and binaries haven’t been built yet (it usually takes a few days after getting an update on CRAN for binaries to be built and until then everyone has to install from source)
Is either of those the case here? If not we’ll need to look into that.
(We also just released a new version of rstantools today and will be releasing a new rstan soon, but I don’t think what you’re reporting is related to that.)
Yes indeed. In the case of Windows, installation now works without compilation. However, on Mac, it starts to compile upon installation.
Looking at the CRAN page it says the following for macOS binaries:
When it says “not available”, does that mean it is still building? This may indeed explain why it is building from source from the moment on mac even though it has been 4 days. Otherwise there may be another issue here.
So just to make sure I add the right installation instructions: linux users need a c++ compiler to install the package both via Github and CRAN. Windows and Mac users only need a c++ compiler if they want to install the latest development version from source. Is that correct?
Hmm, I’m not sure if “not available” means it is still building or if there’s a problem (@bgoodri do you know?) , but 4 days is usually enough time.
Checking your CRAN page at CRAN - Package fishflux it does look like it built the Mac binary for the previous R version (r-oldrel) but not for the latest (r-release). I just tried installing your package on a Mac running R 3.6.1 (oldrel) and it didn’t need to compile anything, so I can confirm that the r-oldrel binary for Mac works. As expected based on the “not available” on the CRAN website, my other Mac running R 4.0 needed to install from source.
Checking https://cran.r-project.org/web/checks/check_results_fishflux.html it doesn’t look like it has been checked on Mac with r-release, so that may be why there’s no binary for R >= 4.0. I’m not sure what’s up with that, but I don’t think it’s related to your package containing Stan models. If it hasn’t built in a few more days you might try asking somewhere online that offers general R help (stackoverflow, R mailing list, probably other places). Sorry I can’t be of more help!
Yeah I think that’s right.
If you really do want people to also be able to install binaries from GitHub then there are a few options available, but the simplest is probably to use drat.
Thanks a lot for your answer and for testing the installation from CRAN.
Indeed, it seems like it hasn’t been checked on Mac for r-release.
I’ll follow your advice and check on stackoverflow.