Learn R Programming

⚠️There's a newer version (1.4.7) of this package.Take me there.

pkgbuild

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.

Installation

You can install pkgbuild from github with:

# install.packages("devtools")
devtools::install_github("r-lib/pkgbuild")

Example

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

# Build a package
pkgbuild::build("/path/to/my/package")

# Run your own code in an environment guaranteed to 
# have build tools available
pkgbuild::with_build_tools(my_code)

Copy Link

Version

Install

install.packages('pkgbuild')

Monthly Downloads

428,540

Version

1.3.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Gabor Csardi

Last Published

December 20th, 2021

Functions in pkgbuild (1.3.1)

with_debug

Temporarily set debugging compilation flags.
pkgbuild_process

Build package in the background
pkg_links_to_rcpp

Test if a package path is linking to Rcpp or cpp11
rtools_needed

Retrieve a text string with the rtools version needed
rcmd_build_tools

Call R CMD 'command' with build tools active
clean_dll

Remove compiled objects from /src/ directory
without_compiler

Tools for testing pkgbuild
build

Build package
has_latex

Is latex installed?
has_compiler

Is a compiler available?
pkg_has_src

Does a source package have src/ directory?
has_build_tools

Are build tools are available?
needs_compile

Does the package need recompiling? (i.e. is there a source or header file newer than the dll)
compile_dll

Compile a .dll/.so from source.
rtools_path

Is Rtools installed?
compiler_flags

Default compiler flags used by devtools.