pkgbuild v1.1.0


Monthly downloads



Find Tools Needed to Build R Packages

Provides functions used to build R packages. Locates compilers needed to build R packages on various platforms and ensures the PATH is configured appropriately so R can use them.



R build status Codecov test coverage

The goal of pkgbuild is to make it easy to build packages with compiled code. It provides tools to configure your R session, and check that everything is working ok. If you are using RStudio, it also helps you trigger automatic install of the build tools.


You can install pkgbuild from github with:

# install.packages("devtools")


# Check that you have the build tools installed
pkgbuild::check_build_tools(debug = TRUE)

# Build a package

# Run your own code in an environment guaranteed to 
# have build tools available

Functions in pkgbuild

Name Description
compile_dll Compile a .dll/.so from source.
pkg_has_src Does a source package have src/ directory?
needs_compile Does the package need recompiling? (i.e. is there a source or header file newer than the dll)
rcmd_build_tools Call R CMD 'command' with build tools active
rtools_needed Retrieve a text string with the rtools version needed
has_build_tools Are build tools are available?
has_compiler Is a compiler available?
pkg_links_to_rcpp Test if a package path is linking to Rcpp or cpp11
has_latex Is latex installed?
rtools_path Is Rtools installed?
pkgbuild_process Build package in the background
clean_dll Remove compiled objects from /src/ directory
with_debug Temporarily set debugging compilation flags.
build Build package
without_compiler Tools for testing pkgbuild
compiler_flags Default compiler flags used by devtools.
No Results!

Last month downloads


License GPL-3
Encoding UTF-8
LazyData true
RoxygenNote 7.1.1
NeedsCompilation no
Packaged 2020-07-13 15:26:18 UTC; jhester
Repository CRAN
Date/Publication 2020-07-13 17:30:02 UTC

Include our badge in your README