Commit Graph

109 Commits (a8f5bdd52525ca21a996bd27fd81305a38a4367b)

Author SHA1 Message Date
Sébastien Villemot a8f5bdd525
Build system: no longer need to pass -pthread or -mthreads for C++11 threads as of GCC 10 2023-01-05 17:58:42 +01:00
NormannR a245fbb390 Implements a Fortran update of the states variance-covariance matrix for the Kalman filter 2022-11-14 16:24:46 +00:00
NormannR 855887b249 Implements a logarithmic reduction Fortran routine and the associated test 2022-10-11 12:11:06 +02:00
Normann Rion d17204cc84 Implements a cycle reduction Fortran routine and the associated test.
The Fortran routine replaces the former Matlab code in matlab/cycle_reduction.m
2022-10-03 14:38:12 +02:00
Sébastien Villemot cc8b2fd920
Bump to C++20 standard (with GNU extensions)
In practice, for the time being, we limit ourselves to C++20 features available
in GCC 10.
2022-05-04 18:33:07 +02:00
Sébastien Villemot 39f47dc957
local_state_space_iteration_k MEX now uses the Fortran code (instead of the C++ code)
Closes: #1802
2022-02-04 11:49:46 +01:00
NormannR 5f828e241f Parallelizes local_state_space_iteration_fortran 2022-01-31 18:44:48 +01:00
Sébastien Villemot 1144de4167
Bump version number 2021-12-08 14:23:26 +01:00
Sébastien Villemot 06fd42c19b
Drop the dynare_simul_ MEX in favour of the new Fortran k_order_simul MEX 2021-11-26 17:37:53 +01:00
NormannR 45aad05670 Implements a Fortran routine `k_order_moment` to compute the k-order unconditional moment of the vector of endogenous variables using simulation 2021-11-24 17:09:12 +01:00
Sébastien Villemot f1a0bdb8e5
Build system: fix several warnings with Autoconf 2.70 2021-09-28 18:21:17 +02:00
Normann Rion 6475c52b3d Implements k-order simulation routine in Fortran (Ref: #1802)
`k_order_simul` may replace `dynare_simul_` in the long run
2021-09-24 09:11:15 +02:00
NormannR cab65dabb5 Implements `local_state_space_iteration_fortran`, the Fortran replacement of `local_state_space_iteration_k` (Ref #1802)
- Creates the library `libkordersim` with all the relevant Fortran routines to `folded_to_unfolded_dr` and `local_state_space_iteration_fortran`
   - Implements `folded_to_unfolded_dr`, which converts folded decision rule matrices to their unfolded counterparts
2021-09-22 16:28:46 +02:00
Sébastien Villemot 3d6f86c234
Build system: fix detection of SLICOT for MATLAB on RHEL
The MATLAB_CFLAGS variable was not injected when testing for the presence of
libslicot64_pic. In particular, on GNU/Linux system, this means that the -fPIC
flag was not injected when doing the test. This was not a problem on Debian,
where GCC now enables -fPIC by default. But this would fail on RHEL, where
-fPIC is not enabled by default.

By the way:
— rename ac_save_* variables to my_save_*, to avoid conflicts with internal
  autoconf variables;
— do not inject “$(mkoctfile -p LFLAGS)” into LDFLAGS when testing for SLICOT
  under Octave; this is no longer necessary, since those flags are already
  injected at the beginning of mex/build/octave/configure.ac.
2021-09-02 17:14:01 +02:00
Sébastien Villemot 5d5fefca25
Bump version numbers 2021-07-23 15:57:19 +02:00
Normann Rion 3d27672c58
kth-order approximation of conditional welfare
Partially addresses issue #1680:
- unconditional welfare resorts to dynare++ simulation tools, which shall be updated very soon
TO DO:
- implement a function computing kth-order approximation of simulated moments of y
2021-06-15 15:04:31 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot 0741963ca5
Build system: streamline handling of compilation flags for MEX
— allow the user to override compilation flags for MATLAB MEX (it was already
  working for the preprocessor, the MEX for Octave and Dynare++)
— increase the symmetry of MEX build infrastructure between MATLAB and Octave
— when linking MEX for Octave, do not add the output of “mkoctfile -p FLIBS”.
  It is unneeded, and it can create a conflict between the system compiler and
  a user-supplied compiler

By the way:
— restore optimization on macOS for C/C++ MEX (it had been removed in
  5df2392a09)
— remove -fno-omit-frame-pointer on MATLAB/Linux, since it would be cancelled
  by subsequent -O2 and should not be needed anyways
— remove FFLAGS under Octave, unused
2021-05-10 14:39:41 +02:00
Stéphane Adjemian (Odysseus) 0e1c9312e2
Merge remote-tracking branch 'Dynare/master' into enterprise 2021-01-11 11:06:55 +01:00
Sébastien Villemot 93a8e60265
Build system: various macOS cleanups
– remove clang support
– we no longer support 32-bit
– simplify Darwin specific hacks for Octave MEX files
2020-12-18 15:40:48 +01:00
Sébastien Villemot e8d01abdca
Build system: remove obsolete comments 2020-12-18 15:40:48 +01:00
Stéphane Adjemian (Odysseus) 248ad18846 Merge remote-tracking branch 'Dynare/master' into enterprise
Fixed conflicts in:

 - .gitlab-ci.yml
 - matlab/dynare_config.m
 - matlab/dynare_solve.m
 - matlab/initvalf.m
 - matlab/perfect-foresight-models/make_ex_.m
 - matlab/perfect-foresight-models/perfect_foresight_setup.m
 - mex/build/matlab/Makefile.am
 - mex/build/matlab/configure.ac
 - mex/build/octave/Makefile.am
 - mex/build/octave/configure.ac
 - mex/sources/Makefile.am
 - preprocessor
 - tests/Makefile.am
2020-09-17 14:53:32 +02:00
Sébastien Villemot f6c2471eef
New MEX for solving discrete Lyapunov equations with doubling algorithm
This is a Fortran 2008 rewrite of disclyap_fast.m.

Closes: #1737
2020-07-30 16:34:35 +02:00
Sébastien Villemot 6e0f104d7e
Bump minimal MATLAB version to R2014a
Ref. #1713
2020-04-07 16:32:32 +02:00
Sébastien Villemot 43ed7b2b69
Merge remote-tracking branch 'community/master' into enterprise 2020-03-27 16:28:41 +01:00
Sébastien Villemot 47e4649026
Add support for Fortran 2008 in MEX files
By the same token, remove unused support for Fortran 77.
2020-01-06 18:29:47 +01:00
Sébastien Villemot 39ed7c6742
Bump version number to 4.7-unstable 2019-12-20 17:20:07 +01:00
Sébastien Villemot fe0fdf2ccb
Fix Fortran flags under MEX for MATLAB
There was a typo in fedeeaad9f.

By the way, use the modern Fortran compiler when trying to detect slicot.
2019-12-03 18:48:19 +01:00
Sébastien Villemot 6a26926892
Add new block_trust_region MEX
This MEX solves nonlinear systems of equations using a trust region algorithm.
The problem is subdivided in smaller problems by doing a block
triangularisation of the Jacobian at the guess value, using the
Dulmage-Mendelsohn algorithm.

The interface of the MEX is simply:

  [x, info] = block_trust_region(f, guess_value);

Where f is either a function handle or a string designating a function.
f must take one argument (the evaluation point), and return either one or two
arguments (the residuals and, optionally, the Jacobian).

On success, info=0; on failure, info=1.
2019-12-03 16:17:16 +01:00
Sébastien Villemot fedeeaad9f
Add support for Fortran 2008 in MEX files
By the same token, remove unused support for Fortran 77.
2019-12-03 16:17:00 +01:00
Sébastien Villemot 5cae192487
Build system: really error out if some dependency is missing
The changes in 8065e9d439 were not working as
intended, because AC_CHECK_PROG expect values and not actions. Hence
AC_MSG_ERROR was not properly executed.

By the way, simplify some test conditions using && instead of if/then/fi
blocks.
2019-11-28 14:43:44 +01:00
Sébastien Villemot 8065e9d439
Build system: by default, error out if some dependency is missing
In particular, if either MATLAB or Octave is missing, one needs to pass either
--disable-matlab or --disable-octave.

Moreover, several new configure flags have been introduced for disabling some
components:
--disable-doc
--disable-dynare++
--disable-mex-dynare++
--disable-mex-ms-sbvar
--disable-mex-kalman-steady-state
2019-11-26 13:53:42 +01:00
Sébastien Villemot 0d0a0a9bbb
Bump to C++17
This means we now require GCC 8.

Boost filesystem library is no longer needed.

Ref preprocessor#16
2019-09-11 15:06:12 +02:00
Sébastien Villemot 9557061fa3
Add new num_procs MEX file for getting number of available processing units 2019-06-27 14:34:09 +02:00
Sébastien Villemot 7c39b12b7b
Always compile MEX files with OpenMP (when they can take advantage of it)
As a consequence, remove the --enable-openmp option of the configure script.
2019-06-25 17:26:17 +02:00
Sébastien Villemot 5b591fac42
New perfect_foresight_problem MEX file
It constructs the stacked residuals and jacobian of the perfect foresight
problem.

It is an almost perfect replacement for the perfect_foresight_problem.m
routine, while being much more efficient.

Note however that the DLL never return complex numbers (it instead puts NaNs at
the place where there would have been complex). This may create problems for
some MOD files; the algorithms will need to be adapted to use a more
line-search method.
2019-06-24 17:53:59 +02:00
Sébastien Villemot f5e2bfc30a
Ask GCC to warn about C-style casts (-Wold-style-cast)
Adapt the code accordingly.
2019-04-23 13:03:20 +02:00
Sébastien Villemot f953374dba
More Unicode copyright symbol 2019-04-16 14:34:05 +02:00
Sébastien Villemot dee230bf32
Minor shell modernization 2019-04-05 12:12:24 +02:00
Houtan Bastani 7e46d8267c
mac: make build system work with clang and gcc 2019-04-01 17:38:42 +02:00
Sébastien Villemot fb4d14c0a2
Fix build failure with MATLAB ≤ R2011a with recent GCC 2019-03-25 18:47:50 +01:00
Sébastien Villemot c46023ad56
POSIX shell stylistic improvements 2019-03-25 18:47:49 +01:00
Sébastien Villemot 752a02a36c
Dynare++: use C++11 threads (instead of POSIX threads API)
On Windows, this means that a POSIX threads implementation is no longer needed,
since C++11 threads are implemented using native Windows threads.

On GNU/Linux and macOS, POSIX threads are still used under the hood.

A new m4 macro (AX_CXX11_THREAD) is used to add the proper compilation
flags (instead of AX_PTHREAD).
2019-01-28 18:44:24 +01:00
Sébastien Villemot 736d43c4e6
Bump minimal MATLAB version requirement to 7.9 (R2009b) 2018-11-13 15:59:16 +01:00
Sébastien Villemot c6f5c804d9
Gensylv MEX also needs MatIO (because Dynare++ code does) 2018-11-12 12:56:01 +01:00
Sébastien Villemot afc9f94854
On Windows, statically link the pthread library
Otherwise the DLL is dynamically linked against libwinpthread. This regression
was introduced by commit 671fe4bcd.
2018-11-07 14:38:04 +01:00
Sébastien Villemot 671fe4bcd4
Build system improvements on Windows (MinGW / MSYS2)
- Use the -static flag when linking Dynare++, so that shipping libquadmath and
  libgcc DLL in the installer is no longer needed.

- Use AM_CXXFLAGS and AM_LDFLAGS variables for changing flags, since CXXFLAGS
  and LDFLAGS are user variables. Also, this avoids passing these flags down to
  configure scripts in subdirectories.

- Check for the SZIP library in the configure test for the MatIO, this is
  needed under MSYS2.

- Statically link MatIO and GSL in MEX files for MATLAB, this is needed under
  MSYS2.
2018-11-06 12:17:56 +01:00
Houtan Bastani f5bf76deb5 fix mex build system for macOS 2018-06-27 15:04:33 +02:00
Sébastien Villemot a71e0ebee4 Add a compile-time check for MATLAB version, as we already do for Octave 2018-06-06 14:31:25 +02:00
Sébastien Villemot e669321eec Require C++14 for MEX files
Needed because bytecode DLL uses some preprocessor code which is C++14.
2018-06-05 11:34:41 +02:00