FMIConnector
CreateArchive
compile FMI C Code and create an FMU archive
Calling Sequence
Parameters
Returns
Options
Description
CreateArchive(cFile)
cFile
-
string; full path to the generated .c file
options
(optional) equation(s) of the form name = value
list : If target is a Microsoft Windows DLL then a list containing the string of the batch file contents that can be used to compile the C code. Otherwise, the list is empty.
All of the option settings used in this function should be direct outputs of the FMIConnector[GenerateCode] function to avoid conflicts.
fmiTmpStr : string
Specifies the path to the generated FMI directory. The default value is currentdir().
removetmpdir : true or false
Specifies whether the generated temporary directory should be removed. The default value is true.
architecture : string; one of "32" or "64"
Specifies the architecture of the target binary.
compiler : string
Specifies the compiler to use during construction of the FMU. The default is "CLANG" for Windows (installed with MapleSim) and "GCC" for Linux and Mac. Valid options for Windows include "CLANG" (default), "MSVC", and "TCC"(path must be provided). Valid options for Mac/Linux include "GCC" (default) and "TCC". If architecture is specified as anything other than "64", only "MSVC" can be used for Windows and only "GCC" for Mac/Linux.
path : string
Specifies the path for the compiler. For "CLANG" this only need be used for an alternate installation of the clang compiler. For "MSVC" this should specify the path to the compiler setup batch script (vcvars.bat) for the version of Microsoft Visual C++ to be used. For "TCC" this should specify the path to the tcc binary (tcc.exe on Windows, tcc on Mac/Linux). For "GCC" path is ignored. If "MSVC" is chosen for compiler, but no path has been provided, then the connector will try to find an MSVC installation in the PATH environment variable, or in standard install locations.
includedirs : set(string)
Specifies a set of paths to include directories to be used during compilation of models with external library dependencies. The default value is an empty set.
removesrc : true or false
Specifies whether the generated source directory and its contents should be removed. Default is false.
fmiVersion : string; one of "FMI3.0" or "FMI2.0"
Specifies which version of the FMI standard will be generated. The default value is "FMI2.0".
fmiDistType : string; one of "DLL" or "SourceCode"
Specifies if the generated sources should be compiled into a dynamically linked library. If set to "SourceCode" then the FMU will contain source code only. The default value is "DLL".
The CreateArchive command compiles the generated FMI C code into a shared library (.so/.dll/.dylib) and creates an FMU archive.
See Also
FMIConnector[GenerateCode]
FMU Distribution Notice
MapleSim
Download Help Document