Learn R Programming

Rcpp (version 1.0.3)

dependsAttribute: Rcpp::depends Attribute

Description

The Rcpp::depends attribute is added to a C++ source file to indicate that it has a compilation dependency on one or more other packages. For example:

// [[Rcpp::depends(RcppArmadillo)]]

Arguments

Packages which the source file depends on for compilation

Details

The Rcpp::depends attribute is used by the implementation of the sourceCpp function to correctly setup the build environment for R CMD SHLIB.

The include directories of the specified packages are added to the CLINK_CPPFLAGS environment variable. In addition, if the referenced package provides an inline plugin it is called to determine additional environment variables required to successfully build.

See Also

sourceCpp

Examples

Run this code
# NOT RUN {
// [[Rcpp::depends(RcppArmadillo)]]

// [[Rcpp::depends(Matrix, RcppGSL)]]
# }

Run the code above in your browser using DataLab