[Rcpp-devel] Request for an update of BH

Jordi Molins jordi.molins.coronado at gmail.com
Wed Oct 24 10:37:45 CEST 2018


An update on this thread:

I successfully compiled a function with the line " #include
<boost/multiprecision/eigen.hpp> ".   I have also been able to compile a
(non-exported) function that gives as an output a
"Eigen::Matrix<boost::multiprecision::float128, Eigen::Dynamic, 4>".

However, when I try to export an auxiliary function that casts the float128
into a double, I get an error message saying "RcppExports.cpp:11:108:
error: 'boost' was not declared in this scope".

So, it seems that in RcppExports, the compiler does not "understand" that
boost exists. Since I have not used BH, since BH uses boost 1.66, and only
boost 1.68 has the include that combines eigen and boost, I assume that the
problem is that, in some unknown way to me, I should tell the compiler that
at RcppExports it should use the includes of boost in my cpp file:

#include <boost/multiprecision/float128.hpp>
#include <boost/multiprecision/eigen.hpp>

But RcppExports only have:

#include <RcppArmadillo.h>#include <RcppEigen.h>#include <Rcpp.h>

What should I do, in order to tell the compiler that in RcppExports, boost
should be "understood"?

The question has also been posted in stackoverflow, since my initial
question was posted there, but I think that rcppdevel is probably a better
place to ask this question:

https://stackoverflow.com/questions/52964042/boost-is-not-recognized-in-r-when-exporting

Best

Jordi Molins i Coronado
+34 69 38 000 59


On Tue, Oct 23, 2018 at 5:10 PM Jordi Molins <
jordi.molins.coronado at gmail.com> wrote:

> An update: it really seems the problem was in updating gcc to 8.1. I have
> installed Rtools again, and now, following the steps in the link above, I
> have been able to successfully compile code with the line " #include
> <boost/multiprecision/eigen.hpp>  ". I will check now if I can use code
> (there is nothing of boost in the code, so far, apart from the include).
>
> So, my request is not urgent now. Of course, I will be delighted with a
> new BH version.
>
> Jordi Molins i Coronado
> +34 69 38 000 59
>
>
> On Tue, Oct 23, 2018 at 4:19 PM Jordi Molins <
> jordi.molins.coronado at gmail.com> wrote:
>
>> Hello,
>>
>> I am trying to use eigen and boost at the same time, in R (Windows). The
>> reason is that eigen allows now data types such as float128.
>>
>> What happens is that this link between eigen and boost is new (boost
>> 1.68). I believe BH uses boost 1.66.
>>
>> I received an answer in stackoverflow:
>>
>>
>> https://stackoverflow.com/questions/52871038/using-boost-multiprecision-with-rcppeigen/52887046?noredirect=1#comment92801003_52887046
>>
>> of how to install boost 1.68 without needing BH. I have tried to
>> implement that solution, but it does not work: I get an error message such
>> as "c:/rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
>> cannot find -lgfortran collect2.exe: error: ld returned 1 exit status".
>> And now I do not know how to solve this "cannot find -lgfortran" issue
>> (note: this could be entangled with the fact that I substituted the gcc 4.9
>> compiler in Rtools for gcc 8.1, since I could not compile a single
>> sourceCpp with gcc 4.9, but yes with gcc 8.1; I can perfectly compile Rcpp
>> projects, though).
>>
>> So, I would like to kindly ask if BH could be updated to boost 1.68. I
>> understand that updating BH must be a big work, and we all have many things
>> to do. But I see usually BH is updated twice per year, and this year there
>> has been one update so far. Also, the union of BH and eigen is possibly a
>> source of happiness for this community, since AFAIK, so far BH and eigen
>> were completely separated.
>>
>> Of course, if this request cannot be executed, I am happy too. I am just
>> asking in case somebody could do it without too much work, and in fact, he
>> was thinking in doing it anyway.
>>
>> Best regards
>>
>> Jordi Molins i Coronado
>> +34 69 38 000 59
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20181024/e809463a/attachment-0001.html>


More information about the Rcpp-devel mailing list