[Rcpp-commits] r4497 - in pkg/Rcpp: . R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Sep 17 16:18:38 CEST 2013
Author: edd
Date: 2013-09-17 16:18:37 +0200 (Tue, 17 Sep 2013)
New Revision: 4497
Added:
pkg/Rcpp/man/RcppLdFlags.Rd
Modified:
pkg/Rcpp/ChangeLog
pkg/Rcpp/NAMESPACE
pkg/Rcpp/R/Attributes.R
pkg/Rcpp/R/SHLIB.R
pkg/Rcpp/R/inline.R
pkg/Rcpp/inst/NEWS.Rd
Log:
The function RcppLdFlags, used to build packages using Rcpp, is now exported.
Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog 2013-09-16 15:02:21 UTC (rev 4496)
+++ pkg/Rcpp/ChangeLog 2013-09-17 14:18:37 UTC (rev 4497)
@@ -1,3 +1,11 @@
+2013-09-17 Dirk Eddelbuettel <edd at debian.org>
+
+ * NAMESPACE: Export RcppLdFlags which is often used to build Rcpp
+ * man/RcppLdFlags.Rd: Added required manual page
+ * R/Attributes.R: Call RcppLdFlags() via '::' instead of ':::'
+ * R/SHLIB.R: Ditto
+ * R/inline.R: Ditto
+
2013-09-16 JJ Allaire <jj at rstudio.org>
* R/Attributes.R : Remove calls to non-exported functions from the tools package
Modified: pkg/Rcpp/NAMESPACE
===================================================================
--- pkg/Rcpp/NAMESPACE 2013-09-16 15:02:21 UTC (rev 4496)
+++ pkg/Rcpp/NAMESPACE 2013-09-17 14:18:37 UTC (rev 4497)
@@ -1,22 +1,31 @@
+
useDynLib(Rcpp, .registration = TRUE)
-import( methods )
-importFrom( utils, capture.output, assignInNamespace, .DollarNames, prompt, packageDescription )
+import(methods)
+importFrom(utils, capture.output, assignInNamespace, .DollarNames, prompt, packageDescription)
-exportClasses( Module, "C++Field",
- "C++OverloadedMethods",
- "C++Constructor",
- "C++Class", "C++Object", "C++Function"
- )
+exportClasses(Module, "C++Field",
+ "C++OverloadedMethods",
+ "C++Constructor",
+ "C++Class", "C++Object", "C++Function")
-S3method( .DollarNames, "C++Object" )
-S3method( .DollarNames, "Module" )
-exportMethods( prompt, show, .DollarNames, initialize, "formals<-" )
+S3method(.DollarNames, "C++Object")
+S3method(.DollarNames, "Module")
+exportMethods(prompt, show, .DollarNames, initialize, "formals<-")
-export(
- Module, Rcpp.package.skeleton, populate, loadRcppModules, setRcppClass,
- loadModule, cppFunction, evalCpp, sourceCpp, compileAttributes, registerPlugin
-)
+export(Module,
+ Rcpp.package.skeleton,
+ populate,
+ loadRcppModules,
+ setRcppClass,
+ loadModule,
+ cppFunction,
+ evalCpp,
+ sourceCpp,
+ compileAttributes,
+ registerPlugin,
+ RcppLdFlags
+ )
exportClass(RcppClass)
Modified: pkg/Rcpp/R/Attributes.R
===================================================================
--- pkg/Rcpp/R/Attributes.R 2013-09-16 15:02:21 UTC (rev 4496)
+++ pkg/Rcpp/R/Attributes.R 2013-09-17 14:18:37 UTC (rev 4497)
@@ -312,9 +312,9 @@
pkgDesc <- read.dcf(descFile)[1,]
pkgname = .readPkgDescField(pkgDesc, "Package")
depends <- .readPkgDescField(pkgDesc, "Depends", character())
- depends <- unique(.splitDepends(depends))
+ depends <- unique(.splitDepends(depends))
depends <- depends[depends != "R"]
-
+
# determine source directory
srcDir <- file.path(pkgdir, "src")
if (!file.exists(srcDir))
@@ -451,7 +451,7 @@
# Split the depends field of a package description
.splitDepends <- function(x) {
- if (!length(x))
+ if (!length(x))
return(character())
x <- unlist(strsplit(x, ","))
x <- sub("[[:space:]]+$", "", x)
@@ -566,7 +566,7 @@
# we are using a plugin -- confirm that the plugin includes the Rcpp
# PKG_LIBS and if it doesn't then add them
pkgLibs <- buildEnv$PKG_LIBS
- rcppLibs <- Rcpp:::RcppLdFlags()
+ rcppLibs <- Rcpp::RcppLdFlags()
if (is.null(pkgLibs) || !grepl(rcppLibs, pkgLibs, fixed = TRUE))
buildEnv$PKG_LIBS <- paste(pkgLibs, rcppLibs)
}
Modified: pkg/Rcpp/R/SHLIB.R
===================================================================
--- pkg/Rcpp/R/SHLIB.R 2013-09-16 15:02:21 UTC (rev 4496)
+++ pkg/Rcpp/R/SHLIB.R 2013-09-17 14:18:37 UTC (rev 4497)
@@ -14,10 +14,10 @@
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
-
-SHLIB.maker <- function(env =
- list(
- PKG_LIBS = Rcpp:::RcppLdFlags(),
+
+SHLIB.maker <- function(env =
+ list(
+ PKG_LIBS = Rcpp::RcppLdFlags(),
PKG_CPPFLAGS = Rcpp:::RcppCxxFlags()
)
){
@@ -26,7 +26,7 @@
R <- file.path( R.home(component = "bin"), "R" )
system( sprintf( "%s CMD SHLIB %s", R, cmd ) )
}
-}
-
+}
+
SHLIB <- SHLIB.maker()
Modified: pkg/Rcpp/R/inline.R
===================================================================
--- pkg/Rcpp/R/inline.R 2013-09-16 15:02:21 UTC (rev 4496)
+++ pkg/Rcpp/R/inline.R 2013-09-17 14:18:37 UTC (rev 4497)
@@ -42,7 +42,7 @@
", include.before, include.after )
list(
- env = list( PKG_LIBS = paste( libs, Rcpp:::RcppLdFlags() ) ),
+ env = list( PKG_LIBS = paste( libs, Rcpp::RcppLdFlags() ) ),
includes = includes,
LinkingTo = LinkingTo ,
body = function( x ){
Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd 2013-09-16 15:02:21 UTC (rev 4496)
+++ pkg/Rcpp/inst/NEWS.Rd 2013-09-17 14:18:37 UTC (rev 4497)
@@ -34,6 +34,8 @@
if you expose a class \code{Foo} via modules, then you can wrap
\code{vector<Foo>}, ... An example is included in the \code{wrap} unit test
file
+ \item \code{RcppLdFlags()}, often used in \code{Makevars} files of
+ packages using \pkg{Rcpp}, is now exported from the package namespace.
}
\item Changes in Attributes:
\itemize{
Added: pkg/Rcpp/man/RcppLdFlags.Rd
===================================================================
--- pkg/Rcpp/man/RcppLdFlags.Rd (rev 0)
+++ pkg/Rcpp/man/RcppLdFlags.Rd 2013-09-17 14:18:37 UTC (rev 4497)
@@ -0,0 +1,41 @@
+\name{RcppLdFlags}
+\alias{RcppLdFlags}
+\title{Provide Rcpp Linker Flags}
+\description{
+ \code{RcppLdFlags} returns the required flags and options for the the
+ system linker. This allows portable use of \pkg{Rcpp} as package
+ location as well as operating-system specific details are abstracted
+ away behind the interface of this function.
+
+ It is commonly called from the files \code{Makevars} (or
+ \code{Makevars.win}) rather than in an interactive session.
+}
+\usage{
+RcppLdFlags(static=staticLinking())
+}
+\arguments{
+ \item{static}{A boolean determining use of static (as opposed to
+ dynamic) linking; defaults to using the \code{staticLinking()}
+ function which defaults to \code{FALSE} on Linux, and \code{TRUE}
+ if the operating system is different from Linux.}
+}
+\value{
+ A character vector suitable by use by the system linker in order to
+ create a library based on \pkg{Rcpp}.
+}
+\details{
+ This function is not meant to used interactively, and is intended
+ solely for use by the build tools.
+}
+\references{
+ Dirk Eddelbuettel and Romain Francois (2011). \pkg{Rcpp}: Seamless R
+ and C++ Integration. \emph{Journal of Statistical Software},
+ \bold{40(8)}, 1-18. URL http://www.jstatsoft.org/v40/i08/ and
+ available as \code{vignette("Rcpp-introduction")}.
+}
+\seealso{
+ The vignette \sQuote{Rcpp-package} has more details.
+}
+\author{Dirk Eddelbuettel and Romain Francois}
+\keyword{programming}
+\keyword{interface}
More information about the Rcpp-commits
mailing list