% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/flags.R
\name{flags}
\alias{flags}
\alias{RcppParallelLibs}
\alias{LdFlags}
\alias{CxxFlags}
\title{Compilation flags for RcppParallel}
\usage{
CxxFlags()

LdFlags()

RcppParallelLibs()
}
\value{
Returns \code{NULL}, invisibly. These functions are called for
their side effects (writing the associated flags to stdout).
}
\description{
Output the compiler or linker flags required to build against RcppParallel.
}
\details{
These functions are typically called from \code{Makevars} as follows:\preformatted{PKG_LIBS += $(shell "$\{R_HOME\}/bin/Rscript" -e "RcppParallel::LdFlags()")
}

What is emitted depends on how TBB is resolved at runtime on each platform.
On Windows, every symbol has to be resolved at link time, so the flags name
both the TBB libraries RcppParallel ships and RcppParallel itself. On macOS,
they name the TBB libraries along with an \code{-rpath} entry, so that the
resulting binary can find them without relying on \code{RcppParallel} having been
loaded first. On Linux, the output is empty: TBB symbols are left undefined
at link time and resolved from the libraries \code{RcppParallel} loads.

\R packages using RcppParallel should also add the following to their
\code{NAMESPACE} file:\preformatted{importFrom(RcppParallel, RcppParallelLibs)
}

This is necessary to ensure that \pkg{RcppParallel} (and so, TBB) is loaded
and available.
}
