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

assert does not play well with CRAN #5

Open
astamm opened this issue Apr 16, 2020 · 5 comments
Open

assert does not play well with CRAN #5

astamm opened this issue Apr 16, 2020 · 5 comments

Comments

@astamm
Copy link

astamm commented Apr 16, 2020

It seems that conversions of exit(), abort(), std::cout and std::cerr into Rcpp equivalents have been done for complying to CRAN rules. But I just ran into this error again when CRAN-checking one of my packages the links to dlib. It seems assert() is prohibited as well by CRAN but it is still in use in dlib as far as I understand.

@jwijffels
Copy link
Contributor

yes, I should also use the latest release and fix all these r cmd check notes at cran: https://cran.r-project.org/web/checks/check_results_dlib.html
are you interested in creating a pull request for this
where can i find your package?

@astamm
Copy link
Author

astamm commented Apr 16, 2020

I am sorry. I don’t think I have the right skills to help you on this. I do not really know how to fix this problem. I just noticed that it doesn’t pass CRAN checks.
My package can be found here: https://github.com/astamm/fdakmapp/tree/fix-template-domain.

@jwijffels
Copy link
Contributor

dlib uses assert statements all over the place - will indeed not be trivial to replace these
i think the best to proceed is that you set up continuous integration which shows the r cmd check issues

@astamm
Copy link
Author

astamm commented Apr 17, 2020

Let's forget about my package for now (there is indeed an item in my todo list to set up continuous integration but there are more important things to fix first as this is originally a package written by many other colleagues). For dlib to be used by other packages, the assert statement needs to be replaced by something Rcpp equivalent, otherwise CRAN will complain. But we could use the same trick you used for cout for instance, i.e. redirecting std::cout to Rcpp::Rcout. We could define a dlib_assert() function that could use e.g. throw ?

@jwijffels
Copy link
Contributor

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

2 participants