[Rcpp-devel] [**SPAM**] Re: ___assert_rtn warning with package check
jason.serviss at ki.se
Fri Jun 15 12:56:49 CEST 2018
Sorry for the late reply (somehow your reply ended up in the Junk folder). Switching RcppArmadillo and RcppEigen in the LinkingTo section (and thus the header order) did not help BUT your mention of NDEBUG lead me to this Githuhb issue: https://github.com/RcppCore/RcppArmadillo/issues/116. The addition of a similar file in the inst folder (see change log at the bottom of the issue) with #define NDEBUG 1 and then adding the file as an import in RcppExports.cpp did the trick. Unfortunately, running compileAttributes() locally overwrites the manual changes in RcppExports.cpp but, for now, I guess I will have to live with this. Thanks a lot for your input!
On 13 Jun 2018, at 15:51, Qiang Kou <qkou at qkou.info<mailto:qkou at qkou.info>> wrote:
The assert is from RcppEigen.
I think the reason is how "NDEBUG" is handled by Armadillo.
In your package, the RcppArmadillo header is included before RcppEigen: https://github.com/jasonserviss/check/blob/master/src/RcppExports.cpp#L4<https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL2phc29uc2Vydmlzcy9jaGVjay9ibG9iL21hc3Rlci9zcmMvUmNwcEV4cG9ydHMuY3BwI0w0&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=fdecf48f&_r=a2ktc2U%3D>
The NDEBUG has been undefined.
Then in RcppEigen:
The assert will be used if NDEBUG has been undefined.
I hope this answers your question.
On Wed, Jun 13, 2018 at 7:05 AM, Jason Serviss <jason.serviss at ki.se<mailto:jason.serviss at ki.se>> wrote:
I am currently in the process of trying to utilise C++ via Rcpp, RcppEigen, and RcppArmadillo in a package for the first time. I am experiencing the following on running devtools::check() with the package:
checking compiled code ... WARNING
Found ‘___assert_rtn’, possibly from ‘assert’ (C)
I found a similar problem previously discussed (here: http://rcpp-devel.r-forge.r-project.narkive.com/yc1h8bf6/rcppeigen-package-skeleton-r-cmd-check-warning<https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cDovL3JjcHAtZGV2ZWwuci1mb3JnZS5yLXByb2plY3QubmFya2l2ZS5jb20veWMxaDhiZjYvcmNwcGVpZ2VuLXBhY2thZ2Utc2tlbGV0b24tci1jbWQtY2hlY2std2FybmluZw%3D%3D&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=f9d02bc5&_r=a2ktc2U%3D>) some time ago although, in this case, it seemed to be system specific. Based on the comments, I created a minimal reproducible example (here: https://github.com/jasonserviss/check<https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL2phc29uc2Vydmlzcy9jaGVjaw%3D%3D&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=fd24f0d8&_r=a2ktc2U%3D>) and automated the build with TravisCI (build report here: https://travis-ci.org/jasonserviss/check/builds/391685256<https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly90cmF2aXMtY2kub3JnL2phc29uc2Vydmlzcy9jaGVjay9idWlsZHMvMzkxNjg1MjU2&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=717fbb88&_r=a2ktc2U%3D>).
I have noticed two things:
1) there are 2 functions in the package, function “a" and function “b”, if I remove function “b” I no longer receive the warning. Despite this, there wouldn’t, to my eyes, seem to be anything extremely unusual about function “b”.
2) If I remove RcppArmadillo from the LinkingTo section in the DESCRIPTION file I, again, no longer receive the warning. I am aware of the fact that, in the example, there is no need to link to RcppArmadillo although, in the real use case, there is.
Id be very appreciative if anyone here could help me get an understanding for this warning and how it can be resolved!
Rcpp-devel mailing list
Rcpp-devel at lists.r-forge.r-project.org<mailto:Rcpp-devel at lists.r-forge.r-project.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel