Chen
Chen

Reputation: 143

Rcpp openmp plugin in building package

When I write stand-alone cpp script, I include the openmp using // [[Rcpp::plugins(openmp)]].

However, when I try to build an R package with Rcpp, I don't know how to let the compiler know that I have a plugin. I tried to add Plugin:openmp in description, but it doesn't work.

Can anyone help?

Upvotes: 3

Views: 910

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368261

You edit src/Makevars accordingly, that is explained in Writing R Extensions:

PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)

See Section 1.2.1.1 in the link above for details.

Upvotes: 11

Related Questions