devtools (version 1.2)

with_debug: Temporarily set debugging compilation flags.

Description

Temporarily set debugging compilation flags.

Usage

with_debug(code, PKG_CFLAGS = NULL, PKG_CXXFLAGS = NULL,
    PKG_FFLAGS = NULL, PKG_FCFLAGS = NULL, debug = TRUE,
    action = "replace")

Arguments

code
to execute.
PKG_CFLAGS
flags for compiling C code
PKG_CXXFLAGS
flags for compiling C++ code
PKG_FFLAGS
flags for compiling Fortran code.
PKG_FCFLAGS
flags for Fortran 9x code.
action
(for with_envvar only): should new values "replace", "suffix", "prefix" existing environmental variables with the same name.
debug
If TRUE adds -g -O0 to all flags (Adding PKG_FFLAGS and PKG_FCFLAGS

See Also

Other debugging flags: compiler_flags

Examples

Run this code
flags <- names(compiler_flags(TRUE))
with_debug(Sys.getenv(flags))

install("mypkg")
with_debug(install("mypkg"))

Run the code above in your browser using DataCamp Workspace