This documentation is limited to a description of the source code distribution.

Source code distribution

Source code is provided in directory "sources". Except for a c file containing the C main function, the files listed below needs to be compiled as separate compilation units. The remaining c files distributed are included from those in one way or another. Some header files from Sundials are located in sub directories, e.g. "cvode" to match the original Sundials code structure. This is necessary since some #include statements rely on this structure.

The files below are sufficent to create a DLL or shared object file. For a complete executable, also a main program is needed of course.

cvode.c
cvode_dense.c
cvode_direct.c
cvode_io.c
dsmodel.c
fmiCommonFunctions_int.c
fmiCoSimFunctions_int.c
fmiFunctions.c
fmiMEFunctions_int.c
integration.c
jac.c
nvector_serial.c
sundials_dense.c
sundials_direct.c
sundials_math.c
sundials_nvector.c
util.c

If you set the MODEL_IDENTIFIER (FMI 1) or FMI2_FUNCTION_PREFIX (FMI 2) explicitly in your source code, e.g.:

#define FMI2_FUNCTION_PREFIX MyModel_
#include "fmiFunctions.h"
you must also update fmiModelIdentifier.h accordingly.

If your target platform does not have a file system you have to define NO_FILE in conf.h:

#define NO_FILE

Handling multiple FMUs

In order to be able to combine several source code FMUs, the internal functions and symbols need to be static. This in turn requires that the whole source code is compiled in a single compilation unit. To facilitate this, an extra source code file
all.c
is provided, that includes all other C files. The only disadvantage of compiling this instead, is that any modification in the source code requires re-compilation of everything.