parent
00c95ea352
commit
4f2f9e7ed6
|
@ -30,6 +30,8 @@ using namespace std;
|
||||||
#endif
|
#endif
|
||||||
#include "macro/MacroDriver.hh"
|
#include "macro/MacroDriver.hh"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
/* Prototype for second part of main function
|
/* Prototype for second part of main function
|
||||||
Splitting main() in two parts was necessary because ParsingDriver.h and MacroDriver.h can't be
|
Splitting main() in two parts was necessary because ParsingDriver.h and MacroDriver.h can't be
|
||||||
included simultaneously (because of Bison limitations).
|
included simultaneously (because of Bison limitations).
|
||||||
|
@ -58,6 +60,13 @@ usage()
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
Redirect stderr to stdout.
|
||||||
|
Made necessary because MATLAB/Octave can only capture stdout (but not
|
||||||
|
stderr), in order to put it in the logfile (see issue #306)
|
||||||
|
*/
|
||||||
|
dup2(STDOUT_FILENO, STDERR_FILENO);
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
cerr << "Missing model file!" << endl;
|
cerr << "Missing model file!" << endl;
|
||||||
|
|
|
@ -477,11 +477,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool no_log, b
|
||||||
mOutputFile << "global_initialization;" << endl
|
mOutputFile << "global_initialization;" << endl
|
||||||
<< "diary off;" << endl;
|
<< "diary off;" << endl;
|
||||||
if (!no_log)
|
if (!no_log)
|
||||||
mOutputFile << "logname_ = '" << basename << ".log';" << endl
|
mOutputFile << "diary('" << basename << ".log');" << endl;
|
||||||
<< "if exist(logname_, 'file')" << endl
|
|
||||||
<< " delete(logname_)" << endl
|
|
||||||
<< "end" << endl
|
|
||||||
<< "diary(logname_)" << endl;
|
|
||||||
|
|
||||||
if (console)
|
if (console)
|
||||||
mOutputFile << "options_.console_mode = 1;" << endl
|
mOutputFile << "options_.console_mode = 1;" << endl
|
||||||
|
|
Loading…
Reference in New Issue