Writes code to file and compiles
write_and_compile.RdThis function accepts an ode model, or cme model, generates code,
compiles it to a shared library, and returns a changed object.
possibly changed by the user. It writes the contents to a c file
named 'modelName_gvf.c'. This file is compiled to './modelName.so'
using normal command line tools, not R CMD SHLIB
Details
This entire function can be replaced with a call to cat() and
then compiling the written file in the system's shell.
Examples
m <- model_from_tsv(uqsa_example("AKAR4"))
o <- write_and_compile(as_ode(m))
print(o)
#> Model name : AKAR4
#> C file : /tmp/Rtmp3WxBip/AKAR4_206d15566e51.c [2026-05-15 14:26:36.708832]
#> shared library : /tmp/Rtmp3WxBip/AKAR4_206d15566e51.so [2026-05-15 14:26:36.708832]
#> Number of state variables : 2
#> Number of parameters : 5
#> Number of outputs : 1
#> Conservation laws : 2
#> Transformations : no