[Rcpp-devel] Regular Expressions

Dirk Eddelbuettel edd at debian.org
Sun Mar 3 02:54:53 CET 2013


On 2 March 2013 at 20:39, Gabor Grothendieck wrote:
| On Sat, Mar 2, 2013 at 7:05 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
| > Sorry that this is so frustrating, but this (IMNSHO) all just Windows...
| >
| > I would try two things:
| >
| >       a) forward slashes (no escaping needed)
| >
| >       b) use verbose=TRUE so that you see the R CMD ... invocation.
| >
| > Your initial boost test was key.  We know you have a working boost library;
| > we know Rcpp can create working code, now we just need to tie'em together.
| >
| 
| I had tried both these. It does not seem to be picking up the
| PKG_LIBS.  There is no -l... or -L... on the g++ cmd line.

There was also an issue with sourceCpp overwriting rather than extending
PKG_LIBS.  I would suggest to for now ignore sourceCpp as a means of
debugging.

"All" we really need is one proper R CMD COMPILE step, and one R CMD SHLIB
step.  You can do that by hand -- my old talks have the explicit steps, but I
think you you know what do to do.

You can also try just ~/.R/Makevars -- which is what I do when switcing from
g++ to clang (setting CXX and CC), changing compiler options or warnings
(PKG_CXXFLAGS), ... and so on.
 
| Its also not clear precisely which boost distribution to use.  I had
| tried http://nuwen.net/mingw.html (version 8.0) and also tried the
| boost library from Cygwin.

I have no idea. We need subsets of Boost for QuantLib, but as I recall that
only covers the headers-only template use.  In any event if you must use
something compatible with MinGw, as always, so Cygwin is probably a no-no.
 
| If I use the MinGW from nuewn and run this from the Windows cnd line I
| get no errors or warnings (note that ^ must be the last character on
| the line to escape the newline):
| 
| C:\MinGW\set_distro_paths.bat
| g++ -DNDEBUG ^
|  -L %userprofile%/Documents/R/win-library/2.15/Rcpp/lib/x64/libRcpp.a ^
|  -lboost_regex ^
|  -I"C:/PROGRA~1/R/R-2.15/include" ^
|  -I%userprofile%/Documents/R/win-library/2.15/Rcpp/include ^
|  -O2 -Wall -mtune=core2 -c credit.cpp -o credit.o
| 
| If tyhat is ok then what would the next step be?

That looks pretty good.  Use similar settings, make sure R sees them, and let
R CMD ... do its magic.  Everything, be it via Makevars and Makevars.win, via
inline's cxxfunction or Rcpp's sourceCpp just calls them anyway.  

Dirk

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


More information about the Rcpp-devel mailing list