[Rcpp-devel] Question about Rcpp and boost

Jordi Molins Coronado jordi_molins at hotmail.com
Wed Mar 11 19:16:59 CET 2015


I have an odd problem: now I have the computeGCD function working. My next step has been to create another function doing something trivial, but adding the include for multiprecision of integers:
// We can now use the BH package// [[Rcpp::depends(BH)]]
#include <Rcpp.h>#include <boost/multiprecision/cpp_int.hpp>#include <boost/math/common_factor.hpp>
using namespace Rcpp;
// [[Rcpp::export]]int precision(int num) {    int fact = 1;    for(int i=num; i>1; --i)    {        fact *= i;    }        return fact*boost::math::gcd(8, 16);
The build does not work, and the error message is:
precisionboost.cpp:5:44: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directorycompilation terminated.
This is odd, since if I delete the corresponding include for multiprecision and I leave the one of math, the compilation ends without problems. So, it cannot be a LinkingTo issue. Of course, the file cpp_int.hpp is there.
I have tried to find references to the use of boost multiprecision within Rcpp, but I have not found any.
Any idea of what is going on?

 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150311/53797435/attachment.html>


More information about the Rcpp-devel mailing list