compileC {PBSmodelling} | R Documentation |
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 |
logFile |
if |
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)