diff --git a/doc/manual.xml b/doc/manual.xml index 7f049267b..522b21752 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -280,6 +280,7 @@ mark_as_command dynare + @@ -347,6 +348,10 @@ mark_as_command dynare Display a warning for each variable or parameter which is not initialized. Initialization should be done through or for parameters, or through , or for endogenous and exogenous. + + + Activate console mode: Dynare will not use graphical waitbars for long computations. Note that this option is only useful under MATLAB, since Octave does not provide graphical waitbar capabilities. + Tells Dynare that your MATLAB is configured for compiling MEX files with Cygwin (see ). This option is only available under Windows, and is used in conjunction with . diff --git a/preprocessor/DynareMain.cc b/preprocessor/DynareMain.cc index 27225bfa6..5aec0a9b4 100644 --- a/preprocessor/DynareMain.cc +++ b/preprocessor/DynareMain.cc @@ -34,7 +34,7 @@ using namespace std; Splitting main() in two parts was necessary because ParsingDriver.h and MacroDriver.h can't be included simultaneously (because of Bison limitations). */ -void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms, bool warn_uninit, +void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms, bool warn_uninit, bool console, bool parallel, const string ¶llel_config_file, const string &cluster_name, bool parallel_slave_open_mode, bool parallel_test #if defined(_WIN32) || defined(__CYGWIN32__) @@ -46,7 +46,7 @@ void usage() { cerr << "Dynare usage: dynare mod_file [debug] [noclearall] [savemacro[=macro_file]] [onlymacro] [nolinemacro] [notmpterms] [warn_uninit]" - << " [parallel[=cluster_name]] [conffile=parallel_config_path_and_filename] [parallel_slave_open_mode] [parallel_test]" + << " [console] [parallel[=cluster_name]] [conffile=parallel_config_path_and_filename] [parallel_slave_open_mode] [parallel_test]" #if defined(_WIN32) || defined(__CYGWIN32__) << " [cygwin] [msvc]" #endif @@ -71,6 +71,7 @@ main(int argc, char **argv) bool only_macro = false; bool no_line_macro = false; bool warn_uninit = false; + bool console = false; #if defined(_WIN32) || defined(__CYGWIN32__) bool cygwin = false; bool msvc = false; @@ -109,6 +110,8 @@ main(int argc, char **argv) no_tmp_terms = true; else if (!strcmp(argv[arg], "warn_uninit")) warn_uninit = true; + else if (!strcmp(argv[arg], "console")) + console = true; #if defined(_WIN32) || defined(__CYGWIN32__) else if (!strcmp(argv[arg], "cygwin")) cygwin = true; @@ -180,7 +183,7 @@ main(int argc, char **argv) return EXIT_SUCCESS; // Do the rest - main2(macro_output, basename, debug, clear_all, no_tmp_terms, warn_uninit, + main2(macro_output, basename, debug, clear_all, no_tmp_terms, warn_uninit, console, parallel, parallel_config_file, cluster_name, parallel_slave_open_mode, parallel_test #if defined(_WIN32) || defined(__CYGWIN32__) , cygwin, msvc diff --git a/preprocessor/DynareMain2.cc b/preprocessor/DynareMain2.cc index 5b944a4ac..3813a6e27 100644 --- a/preprocessor/DynareMain2.cc +++ b/preprocessor/DynareMain2.cc @@ -26,7 +26,7 @@ using namespace std; #include "ConfigFile.hh" void -main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms, bool warn_uninit, +main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms, bool warn_uninit, bool console, bool parallel, const string ¶llel_config_file, const string &cluster_name, bool parallel_slave_open_mode, bool parallel_test #if defined(_WIN32) || defined(__CYGWIN32__) @@ -56,7 +56,7 @@ main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tm mod_file->computingPass(no_tmp_terms); // Write outputs - mod_file->writeOutputFiles(basename, clear_all, config_file + mod_file->writeOutputFiles(basename, clear_all, console, config_file #if defined(_WIN32) || defined(__CYGWIN32__) , cygwin, msvc #endif diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc index bf6b9130f..ab1eb6552 100644 --- a/preprocessor/ModFile.cc +++ b/preprocessor/ModFile.cc @@ -345,7 +345,7 @@ ModFile::computingPass(bool no_tmp_terms) } void -ModFile::writeOutputFiles(const string &basename, bool clear_all, const ConfigFile &config_file +ModFile::writeOutputFiles(const string &basename, bool clear_all, bool console, const ConfigFile &config_file #if defined(_WIN32) || defined(__CYGWIN32__) , bool cygwin, bool msvc #endif @@ -398,6 +398,9 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, const ConfigFi << "end" << endl << "diary(logname_)" << endl; + if (console) + mOutputFile << "options_.console_mode = 1;" << endl; + cout << "Processing outputs ..."; symbol_table.writeOutput(mOutputFile); diff --git a/preprocessor/ModFile.hh b/preprocessor/ModFile.hh index 71d363167..00999c88b 100644 --- a/preprocessor/ModFile.hh +++ b/preprocessor/ModFile.hh @@ -105,9 +105,11 @@ public: /*! \param basename The base name used for writing output files. Should be the name of the mod file without its extension \param clear_all Should a "clear all" instruction be written to output ? + \param console Are we in console mode ? + \param cygwin Should the MEX command of use_dll be adapted for Cygwin? \param msvc Should the MEX command of use_dll be adapted for MSVC? */ - void writeOutputFiles(const string &basename, bool clear_all, const ConfigFile &config_file + void writeOutputFiles(const string &basename, bool clear_all, bool console, const ConfigFile &config_file #if defined(_WIN32) || defined(__CYGWIN32__) , bool cygwin, bool msvc #endif