The compile_model is used to compile the model code that is written under C or GNU MCSim format and generate the executable program in numerical analysis.

compile_model(
  mName,
  application = "mcsim",
  use_model_file = TRUE,
  mcsim_dir = NULL,
  mod_dir = NULL
)

Arguments

mName

a string giving the name of the model code (without extension).

application

a character to assign the specific methods (mcsim or R) that will be applied to the numerical analysis (default is mcsim). The version must be assigned for Windows user (default is 6.2.0).

use_model_file

a logical value to operate the compiler to model or C file, the default is set to TRUE to assign the GNU MCSim's model file in compiling.

mcsim_dir

a character to assign the installed location of MCSim directory (The default is set to home).

mod_dir

a character giving the name of the directory that is used to store the model file.

Value

The default application is set to 'mcsim'

to generate the executable program to solve differential equations by GNU MCSim. If application = 'R', the function will compile and create dynamic-link libraries (.dll) on Windows and shared objects (.so) on Unix-likes systems (e.g., Linux and MacOS) that can link with deSolve solver.

Details

Generally, the solving function through GNU MCSim can provide faster computing speed than exporting C in R. Therefore, this function set use_model_file = TRUE and application = 'mcsim' as a default setting, suggesting to use GNU MCSim as main solver to solve the differential equation. To compile model code in Windows, be sure to install Rtools (rtools40) first. In addition, the version of GNU MCSim should provide to conduct model compiling in Windows.