<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Qiang,
<div class=""><br class="">
</div>
<div class="">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: <a href="https://github.com/RcppCore/RcppArmadillo/issues/116" class="">https://github.com/RcppCore/RcppArmadillo/issues/116</a>.
 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!</div>
<div class=""><br class="">
</div>
<div class="">Kind Regards,</div>
<div class="">Jason</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 13 Jun 2018, at 15:51, Qiang Kou <<a href="mailto:qkou@qkou.info" class="">qkou@qkou.info</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi, Jason,
<div class=""><br class="">
</div>
<div class="">The assert is from RcppEigen.</div>
<div class=""><br class="">
</div>
<div class="">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)" class="">NDEBUG</span>" is handled by Armadillo.</div>
<div class=""><br class="">
</div>
<div class="">In your package, the RcppArmadillo header is included before RcppEigen: <a href="https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL2phc29uc2Vydmlzcy9jaGVjay9ibG9iL21hc3Rlci9zcmMvUmNwcEV4cG9ydHMuY3BwI0w0&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=fdecf48f&_r=a2ktc2U%3D" class="">https://github.com/jasonserviss/check/blob/master/src/RcppExports.cpp#L4</a></div>
<div class=""><br class="">
</div>
<div class="">In RcppArmadillo:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL1JjcHBDb3JlL1JjcHBBcm1hZGlsbG8vYmxvYi9tYXN0ZXIvaW5zdC9pbmNsdWRlL1JjcHBBcm1hZGlsbG9Db25maWcuaCNMOTItTDk0&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=cf8cff17&_r=a2ktc2U%3D" class="">https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/RcppArmadilloConfig.h#L92-L94</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">The NDEBUG has been undefined.</div>
<div class=""><br class="">
</div>
<div class="">Then in RcppEigen:</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL1JjcHBDb3JlL1JjcHBFaWdlbi9ibG9iL21hc3Rlci9pbnN0L2luY2x1ZGUvRWlnZW4vc3JjL0NvcmUvdXRpbC9NYWNyb3MuaCNMNTQ5&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=4af01d3b&_r=a2ktc2U%3D" class="">https://github.com/RcppCore/RcppEigen/blob/master/inst/include/Eigen/src/Core/util/Macros.h#L549</a><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">The assert will be used if NDEBUG has been undefined.</div>
<div class=""><br class="">
</div>
<div class="">I hope this answers your question.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class=""><br class="">
</div>
<div class="">KK</div>
<div class=""><br class="">
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Wed, Jun 13, 2018 at 7:05 AM, Jason Serviss <span dir="ltr" class="">
<<a href="mailto:jason.serviss@ki.se" target="_blank" class="">jason.serviss@ki.se</a>></span> wrote:<br class="">
<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" class="">Hello everyone,
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">
<pre class="m_-8507038357753510365GNKRCKGCJV m_-8507038357753510365ace_text-layer m_-8507038357753510365GNKRCKGCGSB m_-8507038357753510365GNKRCKGCJSB 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_-8507038357753510365GNKRCKGCJV m_-8507038357753510365ace_text-layer m_-8507038357753510365GNKRCKGCGSB m_-8507038357753510365GNKRCKGCJSB 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_language m_-8507038357753510365ace_constant" 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 class=""><br class=""></div></pre>
</div>
<div class="">I found a similar problem previously discussed (here: <a href="https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cDovL3JjcHAtZGV2ZWwuci1mb3JnZS5yLXByb2plY3QubmFya2l2ZS5jb20veWMxaDhiZjYvcmNwcGVpZ2VuLXBhY2thZ2Utc2tlbGV0b24tci1jbWQtY2hlY2std2FybmluZw%3D%3D&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=f9d02bc5&_r=a2ktc2U%3D" target="_blank" class="">
http://rcpp-devel.r-forge.r-<wbr class="">project.narkive.com/yc1h8bf6/<wbr class="">rcppeigen-package-skeleton-r-<wbr class="">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://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL2phc29uc2Vydmlzcy9jaGVjaw%3D%3D&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=fd24f0d8&_r=a2ktc2U%3D" target="_blank" class="">
https://github.com/<wbr class="">jasonserviss/check</a>) and automated the build with TravisCI (build report here:
<a href="https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly90cmF2aXMtY2kub3JnL2phc29uc2Vydmlzcy9jaGVjay9idWlsZHMvMzkxNjg1MjU2&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=717fbb88&_r=a2ktc2U%3D" target="_blank" class="">
https://travis-ci.org/<wbr class="">jasonserviss/check/builds/<wbr class="">391685256</a>). </div>
<div class=""><br class="">
</div>
<div class="">I have noticed two things:</div>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">Id be very appreciative if anyone here could help me get an understanding for this warning and how it can be resolved!</div>
<div class=""><br class="">
</div>
<div class="">Kind Regards,</div>
<div class="">Jason Serviss</div>
<div class=""> </div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
Rcpp-devel mailing list<br class="">
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" class="">Rcpp-devel@lists.r-forge.r-<wbr class="">project.org</a><br class="">
<a href="https://mailfilter.sunet.se/canit/urlproxy.php?_q=aHR0cHM6Ly9saXN0cy5yLWZvcmdlLnItcHJvamVjdC5vcmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3JjcHAtZGV2ZWw%3D&_s=amFzb24uc2Vydmlzc0BraS5zZQ%3D%3D&_c=07a68f11&_r=a2ktc2U%3D" rel="noreferrer" target="_blank" class="">https://lists.r-forge.r-<wbr class="">project.org/cgi-bin/mailman/<wbr class="">listinfo/rcpp-devel</a><br class="">
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>