<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>I have restarted everything, and now I can already compute GCD using the boost library, thank you for your help. Just an annoying thing: when I do:<div><br></div><div><div>sourceCpp("convolve.cpp")</div><div><br></div><div>I get a warning, which I did not get the first time I built my project (without the boost file).</div><div><br></div><div>Warning message:</div><div>In normalizePath(path.expand(path), winslash, mustWork) :</div><div>  path[1]="C:/Users/Jordi/Documents/[A_FOLDER]/JungleR/JungleR/src/../inst/include": The system cannot find the path specified</div><div><br></div>Do you know what can that be? I will definitely look into the examples in BH library, thanks for the recommendation.</div><div><br><div><hr id="stopSpelling">Date: Wed, 11 Mar 2015 07:21:49 -0500<br>Subject: Re: [Rcpp-devel] Question about Rcpp and boost<br>From: deter088@umn.edu<br>To: jordi_molins@hotmail.com<br>CC: rcpp-devel@lists.r-forge.r-project.org<br><br><div dir="ltr">Could you provide the build error you are referring to?  You shouldn't need to change the PKG_CXXFLAGS variable at all.  Try restarting your environment and rebuilding.  I just created a package containing your code with the BH package without error on Windows 7.</div><div class="ecxgmail_extra"><br><div class="ecxgmail_quote">On Wed, Mar 11, 2015 at 7:09 AM, Jordi Molins Coronado <span dir="ltr"><<a href="mailto:jordi_molins@hotmail.com" target="_blank">jordi_molins@hotmail.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">


<div><div dir="ltr">Thank you very much for your answer. I have changed the DESCRIPTION file to include:<div><br></div><div><div>LinkingTo: Rcpp, BH</div><div><br></div><div>(before: <span style="font-size:12pt;">LinkingTo: Rcpp) but it continues giving the same build error.</span></div><br><div><div class="ecxhm ecxHOEnZb"><hr>Date: Wed, 11 Mar 2015 07:05:39 -0500<br>Subject: Re: [Rcpp-devel] Question about Rcpp and boost<br>From: <a href="mailto:deter088@umn.edu" target="_blank">deter088@umn.edu</a><br>To: <a href="mailto:jordi_molins@hotmail.com" target="_blank">jordi_molins@hotmail.com</a><br>CC: <a href="mailto:rcpp-devel@lists.r-forge.r-project.org" target="_blank">rcpp-devel@lists.r-forge.r-project.org</a></div><div><div class="h5"><br><br><div dir="ltr">I think you want to check your DESCRIPTION file.  I believe you need to have the 'LinkingTo:' option to also include BH.<div><br></div><div>Regards,</div><div>Charles</div><div><br><div>On Wed, Mar 11, 2015 at 6:58 AM, Jordi Molins Coronado <span dir="ltr"><<a href="mailto:jordi_molins@hotmail.com" target="_blank">jordi_molins@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex;">


<div><div dir="ltr">Hello,<div><br></div><div>I know this question has been answered before (and I have searched for it), but I cannot figure out a solution:</div><div><br></div><div>I want to use boost with Rcpp, basically to be able to use numbers with a higher precision than a double. I am comfortable using the inline package for small c++ functions, I have never used Rccp per se. I have created a skeleton with convolve, and it works. I have added a new function:</div><div><br></div><div><div>// We can now use the BH package</div><div>// [[Rcpp::depends(BH)]]</div><div><br></div><div>#include <Rcpp.h></div><div>#include <boost/math/common_factor.hpp>  </div><div><br></div><div>using namespace Rcpp;</div><div> </div><div>// [[Rcpp::export]]</div><div>int computeGCD(int a, int b) {</div><div>    return boost::math::gcd(a, b);</div><div>}</div></div><div><br></div><div>and when I try to compile, it fails (basically, the compiler does not find where boost is). I have then run in R:</div><div><br></div><div>Sys.setenv("PKG_CXXFLAGS"="-I C:/Program~Files/boost/boost_1_57_0/")</div><div><br></div><div>which allows me to go a bit more into the build, but the compile fails when reaching the <span style="font-size:12pt;">#include <boost/math/common_factor.hpp>  above, since it does not know where boost is (boost is at </span>C:/Program~Files/boost/boost_1_57_0/ I have not compiled it, but just extracted with 7-zip and copied and pasted the corresponding files into this subfolder).</div><div><br></div><div>From reading the attribute document of Dirk Eddelbuettel, it seems as if adding the comments <span style="font-size:12pt;">// [[Rcpp::export]] and </span><span style="font-size:12pt;">// [[Rcpp::depends(BH)]] would do the job. But for me, it does not work. What do I need to do? Thanks and sorry for the basic question, I have tried to read everything I could before asking this list.</span></div>                                        </div></div>
<br>_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br></blockquote></div><br><div><br></div>
</div></div></div></div></div></div>                                          </div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="ecxgmail_signature"><div dir="ltr">Dr. Charles Determan, PhD<br>Integrated Biosciences<br></div></div>
</div></div></div>                                      </div></body>
</html>