[Rcpp-devel] ___assert_rtn warning with package check

Qiang Kou qkou at qkou.info
Wed Jun 13 15:51:43 CEST 2018

Hi, Jason,

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:

In RcppArmadillo:


The NDEBUG has been undefined.

Then in RcppEigen:


The assert will be used if NDEBUG has been undefined.

I hope this answers your question.

Best wishes,


On Wed, Jun 13, 2018 at 7:05 AM, Jason Serviss <jason.serviss at ki.se> wrote:

> Hello everyone,
> 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 ... WARNINGFile ‘check/libs/check.so’:
>   Found ‘___assert_rtn’, possibly from ‘assert’ (C)
>     Object: ‘RcppExports.o’
> 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) 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) and automated the build with TravisCI (build report
> here: https://travis-ci.org/jasonserviss/check/builds/391685256).
> 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!
> Kind Regards,
> Jason Serviss
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180613/d531e320/attachment-0001.html>

More information about the Rcpp-devel mailing list