Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compileC

Compile a C File into a Shared Library Object


Description

This function provides an alternative to using R's SHLIB command to compile C code into a shared library object.

Usage

compileC(file, lib="", options="", logWindow=TRUE, logFile=TRUE)

Arguments

file

name of the file to compile.

lib

name of shared library object (without extension).

options

linker options (in one string) to prepend to a compilation command.

logWindow

if TRUE, a log window containing the compiler output will be displayed.

logFile

if TRUE, a log file containing the compiler output will be created.

Details

If lib="", it will take the same name as file (with a different extension).

If an object with the same name has already been dynamically loaded in R, it will be unloaded automatically for recompilation.

The name of the log file, if created, uses the string value from lib concatenated with ".log".

Author(s)

Anisa Egeli, Vancouver Island University, Nanaimo BC

See Also

Examples

## Not run: 
local(envir=.PBSmodEnv,expr={
  cwd = getwd()
  edir <- system.file("examples", package = "PBSmodelling" )
  file.copy(paste(edir,"fib.c",sep="/"), tempdir(), overwrite=TRUE)
  setwd(tempdir())
  compileC("fib.c", lib="myLib", options="myObj.o", logWindow=FALSE)
  print(list.files())
  setwd(cwd)
})

## End(Not run)

PBSmodelling

GUI Tools Made Easy: Interact with Models and Explore Data

v2.68.8
GPL (>= 2)
Authors
Jon T. Schnute [aut], Alex Couture-Beil [aut], Rowan Haigh [aut, cre], Nicholas Boers [ctb], Anisa Egeli [ctb], A. R. Kronlund [ctb], Steve Martell [ctb], Norm Olsen [ctb]
Initial release
2019-03-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.