<div dir="ltr">Hi, Jason,<div><br></div><div>The assert is from RcppEigen.</div><div><br></div><div>I think the reason is how "<span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre;background-color:rgb(255,251,221)">NDEBUG</span>" is handled by Armadillo.</div><div><br></div><div>In your package, the RcppArmadillo header is included before RcppEigen: <a href="https://github.com/jasonserviss/check/blob/master/src/RcppExports.cpp#L4">https://github.com/jasonserviss/check/blob/master/src/RcppExports.cpp#L4</a></div><div><br></div><div>In RcppArmadillo:</div><div><br></div><div><a href="https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/RcppArmadilloConfig.h#L92-L94">https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/RcppArmadilloConfig.h#L92-L94</a><br></div><div><br></div><div>The NDEBUG has been undefined.</div><div><br></div><div>Then in RcppEigen:</div><div><br></div><div><a href="https://github.com/RcppCore/RcppEigen/blob/master/inst/include/Eigen/src/Core/util/Macros.h#L549">https://github.com/RcppCore/RcppEigen/blob/master/inst/include/Eigen/src/Core/util/Macros.h#L549</a><br></div><div><br></div><div>The assert will be used if NDEBUG has been undefined.</div><div><br></div><div>I hope this answers your question.</div><div><br></div><div>Best wishes,</div><div><br></div><div>KK</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 13, 2018 at 7:05 AM, Jason Serviss <span dir="ltr"><<a href="mailto:jason.serviss@ki.se" target="_blank">jason.serviss@ki.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;line-break:after-white-space">
Hello everyone,
<div><br>
</div>
<div>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:</div>
<div><br>
</div>
<div>
<pre class="m_-8507038357753510365GNKRCKGCGSB m_-8507038357753510365ace_text-layer m_-8507038357753510365GNKRCKGCJSB m_-8507038357753510365GNKRCKGCJV m_-8507038357753510365ace_line" style="line-height:1.45;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px;box-sizing:border-box;width:703.1025390625px;padding:6px;font-family:Monaco!important;font-stretch:inherit!important;white-space:pre-wrap!important"><pre class="m_-8507038357753510365GNKRCKGCGSB m_-8507038357753510365ace_text-layer m_-8507038357753510365GNKRCKGCJSB m_-8507038357753510365GNKRCKGCJV m_-8507038357753510365ace_line" style="line-height:1.45;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px;box-sizing:border-box;width:729.6525268554688px;padding:6px;font-family:Monaco!important;font-stretch:inherit!important;white-space:pre-wrap!important"><span class="m_-8507038357753510365GNKRCKGCGSB m_-8507038357753510365ace_constant m_-8507038357753510365ace_language" style="outline:none;border:none;word-break:break-all;margin:0px">checking compiled code ... WARNING
</span><span class="m_-8507038357753510365GNKRCKGCGSB" style="outline:none;border:none;word-break:break-all;margin:0px">File ‘check/libs/check.so’:
  Found ‘___assert_rtn’, possibly from ‘assert’ (C)
    Object: ‘RcppExports.o’</span></pre><div><br></div></pre>
</div>
<div>I found a similar problem previously discussed (here: <a href="http://rcpp-devel.r-forge.r-project.narkive.com/yc1h8bf6/rcppeigen-package-skeleton-r-cmd-check-warning" target="_blank">
http://rcpp-devel.r-forge.r-<wbr>project.narkive.com/yc1h8bf6/<wbr>rcppeigen-package-skeleton-r-<wbr>cmd-check-warning</a>) some time ago although, in this case, it seemed to be system specific. Based on the comments, I created a minimal reproducible example (here:
<a href="https://github.com/jasonserviss/check" target="_blank">https://github.com/<wbr>jasonserviss/check</a>) and automated the build with TravisCI (build report here:
<a href="https://travis-ci.org/jasonserviss/check/builds/391685256" target="_blank">https://travis-ci.org/<wbr>jasonserviss/check/builds/<wbr>391685256</a>). </div>
<div><br>
</div>
<div>I have noticed two things:</div>
<div><br>
</div>
<div>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”.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Id be very appreciative if anyone here could help me get an understanding for this warning and how it can be resolved!</div>
<div><br>
</div>
<div>Kind Regards,</div>
<div>Jason Serviss</div>
<div> </div>
</div>

<br>______________________________<wbr>_________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-<wbr>project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-<wbr>project.org/cgi-bin/mailman/<wbr>listinfo/rcpp-devel</a><br></blockquote></div><br></div>