r - Using boost multiprecision with Rcpp on Windows -
i'm trying compile , use following code (which have seen on so):
// [[rcpp::depends(bh)]] #include <rcpp.h> #include <boost/multiprecision/float128.hpp> namespace mp = boost::multiprecision; // [[rcpp::export]] std::string mexp(double mx) { mp::float128 x(mx); mp::float128 res = mp::exp(x); return res.convert_to<std::string>(); }
before compiling, have sys.setenv("pkg_libs" = "-lquadmath")
otherwise compilation not work. compilation runs fine, when type mexp(1)
in r, r session totally crashes. missing ? session crashes in rstudio in classical r gui.
ps: under windows , crash r-3.3.3 r-3.4.1.
edit:
just tried on linux r-3.4.1 , works fine. don't need sys.setenv("pkg_libs" = "-lquadmath")
.
Comments
Post a Comment