@@ -311,7 +311,7 @@ against.
311
311
312
312
On the Linux command-line, you can do the following:\newline
313
313
<<lang =bash >>=
314
- $ export PKG_LIBS = `Rscript -e "Rcpp:::LdFlags()"`
314
+ $ export PKG_LIBS = `Rscript -e "Rcpp:::LdFlags()"` # if Rcpp older than 0.11.0
315
315
$ export PKG_CXXFLAGS = `Rscript -e "Rcpp:::CxxFlags()"`
316
316
$ R CMD SHLIB myfile.cpp
317
317
@
@@ -325,6 +325,20 @@ Dirk's older 'Intro to HPC with R' tutorial slides). It is still not
325
325
recommended as there are tools and automation mechanisms that can do the work
326
326
for you.
327
327
328
+ \pkg {Rcpp} versions 0.11.0 or later can do with the definition of
329
+ \code {PKG\_ LIBS} as a user-facing library is no longer needed (and hence no
330
+ longer shipped with the package). One still needs to set \code {PKG\_ CXXFLAGS}
331
+ to tell R where the \pkg {Rcpp} headers files are located.
332
+
333
+ Once \code {R CMD SHLIB} has created the dyanmically-loadable file (with
334
+ extension \code {.so} on Linux, \code {.dylib} on OS X or \code {.dll} on
335
+ Windows), it can be loaded in an R session via \rdoc {base}{dyn.load}, and the
336
+ function can be executed via \rdoc {base}{.Call}. Needless to say, we
337
+ \emph {strongly } recommend using a package, or at least Rcpp Attributes as
338
+ either approach takes care of a lot of these tedious and error-prone manual
339
+ steps.
340
+
341
+
328
342
\subsection {But R CMD SHLIB still does not work ! }
329
343
330
344
We have had reports in the past where build failures occurred when users had
@@ -380,13 +394,14 @@ complain to its vendor if you are still upset.
380
394
OS X used to be a little more conservative with compiler versions as Apple
381
395
stuck with gcc-4.2. Following the 'Mavericks' release, it is the opposite as
382
396
only llvm is provide in Xcode---while the R build provided by CRAN still has
383
- hardwired settings for the gcc/g++ combination. Until that is resolved, users
384
- either need to create softlinks (say, in, \code {/usr/local/bin}) or override
385
- the \code {CC} and \code {CXX} variables via a file \code {~/.R/Makevars} or its
386
- system-equivalent in R's \code {etc/} directory.
397
+ hardwired settings for the gcc/g++ combination.
398
+
399
+ Until that is resolved, users either need to create softlinks (say, in,
400
+ \code {/usr/local/bin}) or override the \code {CC} and \code {CXX} variables via
401
+ a file \code {~/.R/Makevars} or its system-equivalent in R's \code {etc/}
402
+ directory. See the \code {r-sig-mac} mailing for further details.
387
403
388
- Compilation from source is recommended. See the \code {r-sig-mac} mailing for
389
- further details.
404
+ Compilation from source is recommended.
390
405
% At the time of writing this paragraph (in the spring of 2011), \pkg{Rcpp}
391
406
% (just like CRAN) supports all OS X releases greater or equal to 10.5.
392
407
% However, building \pkg{Rcpp} from source (or building packages using
0 commit comments