Skip to contents

This function accepts the code that was written by generateCode, possibly changed by the user. It writes the contents to a c file named 'modelName_gvf.c'. This file is compiled to './modelName.so'.

Usage

write_and_compile(C)

Arguments

C

character vector with the code of this model

Value

the model's name with annotation about file names.

Details

This entire function can be replaced with a call to cat() and then compiling the written file in the system's shell (or via checkModel)

Examples

cCode <- generateCode(m,o)             # a character vector
#> Error in generateCode(m, o): unused argument (o)
modelName <- write_and_compile(cCode)  # commented name
#> Error in eval(expr, envir, enclos): object 'cCode' not found
print(comment(modelName))
#> Error in eval(expr, envir, enclos): object 'modelName' not found