Commit Graph

244 Commits (cf0c2858706d8201183527c0fab2a9b8bd10086d)

Author SHA1 Message Date
Sébastien Villemot 8f1a4cb363
Drop block-decomposed first-order perturbation solution and kalman filter 2023-01-13 16:57:49 +01:00
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
NormannR c6d5c48ff7 Local state-space iteration at order 3: multi-thread 3rd-order version with and without pruning 2022-08-30 14:06:19 +02:00
Sébastien Villemot 6e1635658f
Bytecode MEX: split out code for dealing with variable names into a dedicated BasicSymbolTable class 2022-07-28 16:56:40 +02:00
Sébastien Villemot f454d1ae21
Bytecode MEX: build with -Wmaybe-unitialized 2022-07-20 15:10:40 +02:00
Sébastien Villemot 888a87312d
Enable -Wunused-parameter for C++ MEX
Except for libdynare++, since Dynare++ is not ready (and is probably not worth
fixing by adding [[maybe_unused]] tags).
2022-07-05 12:12:53 +02:00
Sébastien Villemot dfcfdda318
Enable more compiler warnings for C++ 2022-06-07 18:01:58 +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 2f6120de0c
Octave 7 compatibility fix: add --link-stand-alone when getting LDFLAGS from mkoctfile
Since Octave 7, LDFLAGS as returned by mkoctfile include -shared, which is
undesirable for generic LDFLAGS. Pass the --link-stand-alone option to strip
this flag.
2022-04-15 14:32:54 +02:00
Sébastien Villemot 8c16d1745e
block_trust_region MEX: first part of handling complex values returned by solved function
If solved function returns complex values (with nonzero imaginary part), turn
them into NaNs. This mimics the behaviour of the use_dll case.

Next step will be to adapt the trust region algorithm to diminish radius when
there are NaNs.

Incidentally, bump the required GCC version to 9, since we use the %re and %im
components of complex values in Fortran.
2022-03-21 18:55:42 +01: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 79132ebe55
Build system: no longer use deprecated LFLAGS from mkoctfile
By the way, drop the -static-* flags from LDFLAGS in Windows mkoctfile stub. It
is no more needed and creates duplicates in the link command line (since those
flags are already in DL_LDFLAGS).
2022-01-24 12:52:24 +01:00
Sébastien Villemot ae5be8d717
Build system: add provisions for k_order_mean MEX under Octave 2021-12-16 10:42:37 +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 e155c5cbb2
macOS: fix compilation of MEX files against Homebrew’s octave
It is necessary to link MEX files against Octave libraries, as under Windows.
2021-10-25 18:02:46 +02: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
Normann Rion a576bdd03f Fixing the header doc and automake files for the local state space iteration Fortran MEX 2021-09-24 09:11:06 +02:00
Sébastien Villemot 7083f1d692 Merge branch 'local_state_space_it' into 'master'
Implements the Fortran replacement of local_state_space_iteration_k (Ref #1802)

See merge request Dynare/dynare!1918
2021-09-22 15:54:17 +00: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 91e3348806
Windows package: fix bug introduced in c5120e1278 2021-09-21 18:40:54 +02:00
Sébastien Villemot c5120e1278
Build system: no longer link MEX for Octave against liboctave and other libraries
Since Octave 5, mkoctfile no longer links MEX files against shared
libraries (other than libc/libstdc++/libgfortran), so we now mimick that
behaviour.
2021-09-21 15:19:49 +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 3bd3c78e0e
A_times_B_kronecker_C MEX: rewrite in Fortran 2021-06-04 12:58:39 +02:00
Sébastien Villemot 2a1183e1fa
Fortran MEX: add -Wimplicit-interface to compiler flags
This warns about hard-to-detect bugs where a function is called with an
implicit interface, thus possibly having mismatches in the calling sequence.
2021-06-04 12:57:39 +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
Sébastien Villemot 47477e152a
Bump minimal Octave version to 6.2.0 2021-03-12 16:21:57 +01:00
Sébastien Villemot c0ccca26cb
macOS package: drop support for Octave
The current Octave support is utterly broken (both in stable and unstable), it
crashes Octave. It relies on an unofficial Octave app for
macOS (https://octave-app.org), which is infrequently updated.

This commits drop support for Octave in the macOS package. We will now tell our
macOS+octave users to use the Homebrew Dynare package (which is maintained by
the Homebrew team, and is in reasonably good shape).
2021-03-12 16:21:57 +01: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
Sébastien Villemot d06ae350c5
Build system: add --with-octave configure option to specify non-default install path
(cherry picked from commit bd97fdc1d5)
2020-12-02 18:52:36 +01:00
Sébastien Villemot bd97fdc1d5
Build system: add --with-octave configure option to specify non-default install path 2020-12-02 18:26:49 +01:00
Sébastien Villemot f104b9d517
Windows package: statically link MatIO and GSL in Octave MEX files
Closes: #1750
2020-11-18 15:31:06 +01:00
Sébastien Villemot a922505bbe
Another fix for Fedora, needed for building MEX for Octave 2020-11-13 10:05:40 +01:00
Sébastien Villemot 3a42c234fe
Fix build failures on Fedora
— FCFLAGS needs to contain the compilation flags used when compiling Octave,
  otherwise it fails at configure stage when looking for gfortran
— Explicitly add -L$OCTLIBDIR, because with Octave 5 it is no longer there, and
  on Fedora the Octave libraries are no in the default linker search path
2020-11-05 18:52:11 +01:00
Sébastien Villemot f7ee0b9441
Build system: add missing -fPIC flag for Fortran 2008 MEX files under Octave 2020-11-05 15:40:14 +01:00
Sébastien Villemot 865ab47fa9
Provide block_trust_region MEX under solve_algo 13 and 14
- block trust region solver now available under solve_algo=13
  It is essentially the same as solve_algo=4, except that Jacobian by finite
  difference is not handled. A test file is added for that case
- block trust region solver with shortcut for equations that can be evaluated
  is now available under solve_algo=14 (in replacement of the pure-MATLAB solver)

Closes: Enterprise/dynare#3
2020-09-18 18:01:56 +02: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 400979fd44
macOS: fix handling LDFLAGS when building MEX for Octave
If something was already in LDFLAGS, it was concatenated without a whitespace,
leading to failure.
2020-06-15 18:29:42 +02:00