RLLVMCompile (version 0.2-0)

createProxy: Create an R function to call a native routine

Description

This is a simple function that generates a compiled routine that we can call to invoke the native routine. We can already do this with rdyncall or Rffi. However, this is another approach that uses LLVM.

It is not clear we actually need this. We can call existing routines directly (except with ...) via .llvm. See the example on the Function page.

Usage

createProxy(name, returnType, types = list(), id = sprintf("r%s", name),
             mod = Module(name), ee = ExecutionEngine(mod),
              env = globalenv(), sym = getNativeSymbolInfo(name)$address, ...)

Arguments

name

the name of the routine to which we are interfacing

returnType

the return type of the routine to which we are interfacing

types

the parameter types of the target routine

id

the name of the R routine

mod

the LLVM module in which to create the routine

ee

the LLVM execution engine

env

the environment for the R function

sym

the address of the routine to which we are interfacing

additional arguments

Value

The compiled routine that calls the native routine.

See Also

.llvm