devtools (version 1.8.0)

with_debug: Temporarily set debugging compilation flags.

Description

Temporarily set debugging compilation flags.

Usage

with_debug(code, CFLAGS = NULL, CXXFLAGS = NULL, FFLAGS = NULL,
  FCFLAGS = NULL, debug = TRUE, action = "replace")

Arguments

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

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 DataLab