Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- eng_cppheader = function(options)
- {
- opts = options$engine.opts
- code = paste(options$code, collapse = "n")
- if (is.null(opts$path)) opts$path = tempdir()
- cat(code, file = file.path(opts$path, opts$filename))
- Sys.setenv(PKG_CPPFLAGS = paste0("-I", opts$path))
- options$engine = 'cpp'
- engine_output(options, code, "")
- }
- knitr::knit_engines$set(cppheader=eng_cppheader)
Add Comment
Please, Sign In to add comment