Add option to not write the dynamic model routines (m|mex).

nodynamic
Stéphane Adjemian (Guts) 2023-12-22 11:49:48 +01:00
parent e32025a76f
commit 94f454cd24
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
3 changed files with 9 additions and 5 deletions

View File

@ -62,7 +62,7 @@ usage()
<< " [json=parse|check|transform|compute] [jsonstdout] [onlyjson] [jsonderivsimple] " << " [json=parse|check|transform|compute] [jsonstdout] [onlyjson] [jsonderivsimple] "
"[nopathchange] [nopreprocessoroutput]" "[nopathchange] [nopreprocessoroutput]"
<< " [mexext=<extension>] [matlabroot=<path>] [onlymodel] [notime] [use_dll] " << " [mexext=<extension>] [matlabroot=<path>] [onlymodel] [notime] [use_dll] "
"[nocommutativity]" "[nocommutativity] [nodynamic]"
<< endl; << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -169,6 +169,7 @@ main(int argc, char** argv)
filesystem::path matlabroot; filesystem::path matlabroot;
bool onlymodel = false; bool onlymodel = false;
bool use_dll = false; bool use_dll = false;
bool nodynamic = false;
for (auto s : options) for (auto s : options)
{ {
@ -426,6 +427,8 @@ main(int argc, char** argv)
use_dll = true; use_dll = true;
else if (s == "nocommutativity") else if (s == "nocommutativity")
DataTree::setNoCommutativity(); DataTree::setNoCommutativity();
else if (s == "nodynamic")
nodynamic = true;
else else
{ {
cerr << "Unknown option: " << s << endl; cerr << "Unknown option: " << s << endl;
@ -541,7 +544,7 @@ main(int argc, char** argv)
else else
mod_file->writeMOutput(basename, clear_all, clear_global, no_warn, console, nograph, mod_file->writeMOutput(basename, clear_all, clear_global, no_warn, console, nograph,
nointeractive, config, check_model_changes, minimal_workspace, nointeractive, config, check_model_changes, minimal_workspace,
compute_xrefs, mexext, matlabroot, onlymodel, gui, notime); compute_xrefs, mexext, matlabroot, onlymodel, gui, notime, nodynamic);
/* Ensures that workers are not destroyed before they finish compiling. /* Ensures that workers are not destroyed before they finish compiling.
Also ensures that the preprocessor final message is printed after the end of Also ensures that the preprocessor final message is printed after the end of

View File

@ -845,7 +845,7 @@ ModFile::writeMOutput(const string& basename, bool clear_all, bool clear_global,
bool console, bool nograph, bool nointeractive, const Configuration& config, bool console, bool nograph, bool nointeractive, const Configuration& config,
bool check_model_changes, bool minimal_workspace, bool compute_xrefs, bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string& mexext, const filesystem::path& matlabroot, bool onlymodel, const string& mexext, const filesystem::path& matlabroot, bool onlymodel,
bool gui, bool notime) const bool gui, bool notime, bool nodynamic) const
{ {
if (basename.empty()) if (basename.empty())
{ {
@ -1165,7 +1165,8 @@ ModFile::writeMOutput(const string& basename, bool clear_all, bool clear_global,
} }
} }
dynamic_model.writeDynamicFile(basename, use_dll, mexext, matlabroot, false); if (!nodynamic)
dynamic_model.writeDynamicFile(basename, use_dll, mexext, matlabroot, false);
dynamic_model.writeParamsDerivativesFile<false>(basename); dynamic_model.writeParamsDerivativesFile<false>(basename);
} }

View File

@ -179,7 +179,7 @@ public:
bool console, bool nograph, bool nointeractive, const Configuration& config, bool console, bool nograph, bool nointeractive, const Configuration& config,
bool check_model_changes, bool minimal_workspace, bool compute_xrefs, bool check_model_changes, bool minimal_workspace, bool compute_xrefs,
const string& mexext, const filesystem::path& matlabroot, bool onlymodel, const string& mexext, const filesystem::path& matlabroot, bool onlymodel,
bool gui, bool notime) const; bool gui, bool notime, bool nodynamic) const;
void writeJuliaOutput(const string& basename) const; void writeJuliaOutput(const string& basename) const;