Skip to content

Note on OpenMP & Rcpp Plugin #2

@coatless

Description

@coatless

Nino,

Hope all is well. Glancing at the updated package, I think everything should now be in order for your CRAN submission.

That is, you are using an #ifdef _OPENMP to protect against including OpenMP headers ( <omp.h> ) if they are absent from the crippled compiler inside a custom myomp.h

#ifdef _OPENMP

However, the next line down, you are including:

// [[Rcpp::plugins(openmp)

This plugin only works with the standalone Rcpp functions (evalCpp(), cppFunction(), and sourceCpp()). Within a package context, it isn't setting any variables required. You can remove this line as a result.

The true compiler flags for OpenMP are being set in src/Makevars:

echoice2/src/Makevars

Lines 2 to 3 in 114108d

PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

In particular, note that SHLIB_OPENMP_CXXFLAGS appears twice over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions