Skip to content

cppFunction won't compile #1017

@tjmckinley

Description

@tjmckinley

Hi,
There is an issue with cppFunction in that it won't compile if you require multiple libraries. A minimal reproducible example is below. (I appreciate that this example doesn't actually require the BH and RcppArmadillo header files, but the presence of the former means that the header file for latter isn't linked.)

library(Rcpp)
cppFunction('arma::mat timesTwo(arma::mat x) {
    return x * 2.0;}', depends = c("BH", "RcppArmadillo"))

Running the above example causes a compilation error. I have raised a pull request (#1016 ) that fixes this. The result of me running sessionInfo() is:

R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 19.04

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8   
 [6] LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Rcpp_1.0.3

loaded via a namespace (and not attached):
[1] compiler_3.5.2            tools_3.5.2               RcppArmadillo_0.9.800.1.0 BH_1.69.0-1 

Many thanks,

TJ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions