Merge remote-tracking branch 'community/master' into enterprise

time-shift
Sébastien Villemot 2019-12-06 16:10:09 +01:00
commit 6f91bde894
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
6 changed files with 65 additions and 34 deletions

View File

@ -9,7 +9,7 @@ Software requirements
Packaged versions of Dynare are available for Windows 7/8/10, several GNU/Linux Packaged versions of Dynare are available for Windows 7/8/10, several GNU/Linux
distributions (Debian, Ubuntu, Linux Mint, Arch Linux) and macOS distributions (Debian, Ubuntu, Linux Mint, Arch Linux) and macOS
10.8 or later. Dynare should work on other systems, but some compilation steps 10.11 or later. Dynare should work on other systems, but some compilation steps
are necessary in that case. are necessary in that case.
In order to run Dynare, you need one of the following: In order to run Dynare, you need one of the following:
@ -125,7 +125,7 @@ Compiler installation
Prerequisites on Windows Prerequisites on Windows
------------------------ ------------------------
There is no prerequisites on Windows. Dynare now ships a compilation There are no prerequisites on Windows. Dynare now ships a compilation
environment that can be used with the :opt:`use_dll` option. environment that can be used with the :opt:`use_dll` option.
@ -143,12 +143,11 @@ install liboctave-dev``).
Prerequisites on macOS Prerequisites on macOS
---------------------- ----------------------
[TO BE UPDATED] Dynare now ships a compilation environment that can be used with the
:opt:`use_dll` option. Specifically, the Dynare installer downloads and
If you are using MATLAB under macOS, you should install the latest installs the Xcode Command Line Tools, installs `Homebrew <https://brew.sh>`_
version of XCode: `see instructions on the Dynare wiki under the Dynare installation directory (in the ``.brew`` folder), and finally
<https://git.dynare.org/Dynare/dynare/wikis/Install-on-MacOS>`__. installs GCC.
Configuration Configuration
============= =============

View File

@ -36,7 +36,7 @@ by the ``dynare`` command.
first line of the ``.mod`` file itself (see below). first line of the ``.mod`` file itself (see below).
dynare begins by launching the preprocessor on the ``.mod dynare begins by launching the preprocessor on the ``.mod
file``. By default (unless ``use_dll`` option has been given to file``. By default (unless the :opt:`use_dll` option has been given to
``model``), the preprocessor creates three intermediary files: ``model``), the preprocessor creates three intermediary files:
- ``+FILENAME/driver.m`` - ``+FILENAME/driver.m``
@ -364,7 +364,7 @@ by the ``dynare`` command.
.. option:: fast .. option:: fast
Only useful with model option ``use_dll``. Dont recompile the Only useful with model option :opt:`use_dll`. Dont recompile the
MEX files when running again the same model file and the lists MEX files when running again the same model file and the lists
of variables and the equations havent changed. We use a 32 of variables and the equations havent changed. We use a 32
bit checksum, stored in ``<model filename>/checksum``. There bit checksum, stored in ``<model filename>/checksum``. There

View File

@ -620,7 +620,7 @@ MODEL_EXPRESSION and EXPRESSION:
.. function:: cbrt(x) .. function:: cbrt(x)
Cubic root. Cube root.
.. function:: sign(x) .. function:: sign(x)
@ -11200,6 +11200,40 @@ Misc commands
``save_params_and_steady_state``; see the documentation of that ``save_params_and_steady_state``; see the documentation of that
function for more information. function for more information.
.. command:: compilation_setup (OPTIONS);
When the :opt:`use_dll` option is present, Dynare uses the GCC compiler that
was distributed with it to compile the static and dynamic C files produced
by the preprocessor. You can use this option to change the compiler, flags,
and libraries used.
*Options*
.. option:: compiler = FILENAME
The path to the compiler.
.. option:: substitute_flags = QUOTED_STRING
The flags to use instead of the default flags.
.. option:: add_flags = QUOTED_STRING
The flags to use in addition to the default flags. If
``substitute_flags`` is passed, these flags are added to the flags
specified there.
.. option:: substitute_libs = QUOTED_STRING
The libraries to link against instead of the default libraries.
.. option:: add_libs = QUOTED_STRING
The libraries to link against in addition to the default libraries. If
``substitute_libs`` is passed, these libraries are added to the
libraries specified there.
.. matcomm:: dynare_version ; .. matcomm:: dynare_version ;
|br| Output the version of Dynare that is currently being used |br| Output the version of Dynare that is currently being used

View File

@ -51,15 +51,12 @@ change_path_flag = true;
% Filter out some options. % Filter out some options.
preprocessoroutput = true; preprocessoroutput = true;
if nargin>1 if nargin>1
id = strfind(varargin,'nopathchange'); id = ismember(varargin, 'nopathchange');
if ~all(cellfun(@isempty, id)) if any(id)
change_path_flag = false; change_path_flag = false;
varargin(cellfun(@isempty, id) == 0) = []; varargin(id) = [];
end
id = strfind(varargin, 'nopreprocessoroutput');
if ~all(cellfun(@isempty, id))
preprocessoroutput = false;
end end
preprocessoroutput = ~ismember('nopreprocessoroutput', varargin);
end end
% Check matlab path % Check matlab path
@ -260,17 +257,11 @@ if exist(fname(1:end-4),'dir') && exist([fname(1:end-4) filesep 'hooks'],'dir')
end end
% Save preprocessor result in logfile (if `no_log' option not present) % Save preprocessor result in logfile (if `no_log' option not present)
no_log = 0;
for i=1:length(varargin)
no_log = no_log || strcmp(varargin{i}, 'nolog');
end
fid = fopen(fname, 'r'); fid = fopen(fname, 'r');
firstline = fgetl(fid); firstline = fgetl(fid);
fclose(fid); fclose(fid);
if ~isempty(regexp(firstline, '//\s*--\+\s*options:(|.*\s|.*,)nolog(|\s.*|,.*)\+--')) if ~ismember('nolog', varargin) ...
no_log = 1; && isempty(regexp(firstline, '//\s*--\+\s*options:(|.*\s|.*,)nolog(|\s.*|,.*)\+--'))
end
if ~no_log
logname = [fname(1:end-4) '.log']; logname = [fname(1:end-4) '.log'];
fid = fopen(logname, 'w'); fid = fopen(logname, 'w');
fprintf(fid, '%s', result); fprintf(fid, '%s', result);

@ -1 +1 @@
Subproject commit 23ff36a0dd4f5ee56f553d72849a79d320b2a456 Subproject commit 8962a9d5897e3b835c19bdc1b3132c2eebee4af5

View File

@ -38,6 +38,7 @@
;; - basically deactivate the mode within verbatim blocks? ;; - basically deactivate the mode within verbatim blocks?
;; - blocks templates "model/end", "initval/end", etc. ;; - blocks templates "model/end", "initval/end", etc.
;; - functions to insert main keywords, with shortcuts in the keymap ;; - functions to insert main keywords, with shortcuts in the keymap
;; - make font-locking case insensitive (as is Dynare lexer)
(defgroup dynare nil (defgroup dynare nil
"Editing Dynare mod files." "Editing Dynare mod files."
@ -87,7 +88,7 @@
;; Also include "verbatim" in this list ;; Also include "verbatim" in this list
(defvar dynare-blocks (defvar dynare-blocks
'("model" "steady_state_model" "initval" "endval" "histval" "shocks" '("model" "steady_state_model" "initval" "endval" "histval" "shocks"
"shock_groups" "mshocks" "estimated_params" "epilogue" "priors" "shock_groups" "init2shocks" "mshocks" "estimated_params" "epilogue" "priors"
"estimated_param_init" "estimated_params_bounds" "osr_params_bounds" "estimated_param_init" "estimated_params_bounds" "osr_params_bounds"
"observation_trends" "optim_weights" "homotopy_setup" "observation_trends" "optim_weights" "homotopy_setup"
"conditional_forecast_paths" "svar_identification" "moment_calibration" "conditional_forecast_paths" "svar_identification" "moment_calibration"
@ -95,11 +96,12 @@
"verbatim") "verbatim")
"Dynare block keywords.") "Dynare block keywords.")
;; Mathematical functions used in model equations (see "expression" in Bison file) ;; Mathematical functions and operators used in model equations (see "hand_side" in Bison file)
(defvar dynare-functions (defvar dynare-functions
'("exp" "log" "ln" "log10" "sin" "cos" "tan" "asin" "acos" "atan" "sqrt" '("expectation" "var_expectation" "pac_expectation" "exp" "diff" "adl" "log"
"abs" "sign" "max" "min" "normcdf" "normpdf" "erf") "ln" "log10" "sin" "cos" "tan" "asin" "acos" "atan" "sqrt" "cbrt" "abs"
"Dynare mathematical functions.") "sign" "max" "min" "normcdf" "normpdf" "erf" "steady_state")
"Dynare mathematical functions and operators.")
(defvar dynare-constants (defvar dynare-constants
'("nan" "inf") '("nan" "inf")
@ -110,8 +112,13 @@
"Dynare attributes for on-the-fly type declarations.") "Dynare attributes for on-the-fly type declarations.")
(defvar dynare-macro-keywords (defvar dynare-macro-keywords
'("in" "length" "line" "define" "echomacrovars" "save" "for" "endfor" "ifdef" '("line" "include" "includepath" "define" "echo" "error" "if" "ifdef" "ifndef"
"ifndef" "if" "else" "endif" "echo" "error" "include" "includepath") "elseif" "else" "endif" "for" "endfor" "echomacrovars" "in" "when" "save"
"true" "false" "exp" "log" "ln" "log10" "sin" "cos" "tan" "asin" "acos"
"atan" "sqrt" "cbrt" "sign" "max" "min" "floor" "ceil" "trunc" "mod" "sum"
"erf" "erfc" "gamma" "lgamma" "round" "length" "normpdf" "normcdf" "isempty"
"isboolean" "isreal" "isstring" "istuple" "isarray" "bool" "real" "string"
"tuple" "array" "defined" "nan" "inf")
"Dynare macroprocessor keywords.") "Dynare macroprocessor keywords.")
(defvar dynare-font-lock-keywords (defvar dynare-font-lock-keywords