[Rcpp-devel] Regular Expressions

Dirk Eddelbuettel edd at debian.org
Tue Mar 5 03:09:08 CET 2013


On 4 March 2013 at 20:18, Gabor Grothendieck wrote:
| I had no luck with sourceCpp or inline on Windows but did manage to
| use R CMD SHLIB to build a dll which loads into 32-bit R (it does not
| currently load in 64-bit R - haven't yet figured out why) and seems to
| run ok there.  To get it to work I did replace the first and last
| statements in regexDemo with these two respectively so that all inputs
| and outputs are SEXPs:
| 
|     extern "C" SEXP regexDemo(SEXP ss) {
|        std::vector<std::string> s = Rcpp::as<std::vector<std::string> >(ss);
| 
|     return Rcpp::wrap(Rcpp::DataFrame::create(Rcpp::Named("input") = s,
|                                    Rcpp::Named("valid") = valid,
|                                    Rcpp::Named("machine") = machine,
|                                    Rcpp::Named("human") = human));
| 
| This isn't quite as nice as what you had but at least it runs.

Thanks for reporting back, and glad you get something to work. Going back to
the metal can help.

I won't be of much help for the Windows aspect.  The basic things all work,
and from the 100+ CRAN packages now using Rcpp, many do involve libraries. If
you _really_ wanted to squash this you could try to rebuild libboost_regex.a
during the package build process (of a to be built package) to ensure that
the same g++ gets used. That should help with 32/64 bit too.  But that is
surely overkill.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list