1.[**Fedora, CentOS or RHEL**](#fedora-centos-or-rhel)
1.[**Windows**](#windows)
1.[**macOS**](#macos)
...
...
@@ -68,9 +69,12 @@ A number of tools and libraries are needed in order to recompile everything. You
- A POSIX compliant shell and an implementation of Make (mandatory)
- The [GNU Compiler Collection](http://gcc.gnu.org/), version 8 or later, with
gcc, g++ and gfortran (mandatory)
- MATLAB (if you want to compile the MEX for MATLAB)
-[GNU Octave](http://www.octave.org), with the development headers (if you
want to compile the MEX for Octave)
-[MATLAB](https://mathworks.com)(if you want to compile the MEX for MATLAB)
-[GNU Octave](http://www.octave.org) with
- the development headers (if you want to compile the MEX for Octave)
- the development libraries corresponding to the [UMFPACK](https://people.engr.tamu.edu/davis/suitesparse.html) packaged with Octave
- Optionally, the [Control](https://wiki.octave.org/Control_package), [IO](https://wiki.octave.org/IO_package), [Optimization](https://wiki.octave.org/Optimization_package) and [Statistics](https://wiki.octave.org/Statistics_package) package either installed via your package manager or through [Octave Forge](https://wiki.octave.org/Category:Octave_Forge).
-[Boost libraries](http://www.boost.org), version 1.36 or later
-[Bison](http://www.gnu.org/software/bison/), version 3.2 or later (only if you get the source through Git)
-[Flex](http://flex.sourceforge.net/), version 2.5.4 or later (only if you get the source through Git)
...
...
@@ -86,48 +90,35 @@ A number of tools and libraries are needed in order to recompile everything. You
-[Sphinx](http://www.sphinx-doc.org/)
-[MathJax](https://www.mathjax.org/)
-[Doxygen](http://www.stack.nl/%7Edimitri/doxygen/)(if you want to build Dynare preprocessor source documentation)
-For Octave, the development libraries corresponding to the UMFPACK packaged with Octave
The last line runs Autoconf and Automake in order to prepare the build environment (this is not necessary if you got the sources from an official source archive or the source snapshot).
The last line runs Autoconf and Automake in order to prepare the build environment (this is not necessary if you got the sources from an official source archive or the source snapshot). If you want a certain version (e.g. 4.6) , then add `--single-branch --branch 4.6` to the git clone command.
### Configuring the build tree
Simply launch the configure script from a terminal:
```sh
./configure --with-matlab=<…>
```
./configure
```
If you have MATLAB, you need to indicate both the MATLAB location. For example, on GNU/Linux:
Alternatively, you can disable the compilation of MEX files for MATLAB with the `--disable-matlab` flag, and MEX files for Octave with `--disable-octave`.
Some important options:
You may need to specify additional options to the configure script, see the
output of the `--help` option, and also the platform specific instructions
below.
-`--disable-matlab`: skip the compilation of MEX files for MATLAB
-`--disable-octave`: skip the compilation of MEX files for Octave
-`--disable-doc`: skip the compilation of the documentation (PDF and HTML)
Note that if you don't want to compile the C/C++ programs with debugging information, you can specify the `CFLAGS` and `CXXFLAGS` variables to the configure script, such as:
```
./configure CFLAGS="-O3" CXXFLAGS="-O3"
```
To remove debugging information for MATLAB MEX functions, the analogous call would be:
If the configuration goes well, the script will tell you which components are
correctly configured and will be built.
You may need to specify additional options to the configure script, see the output of the `--help` option, and also the platform specific instructions below. If the configuration goes well, the script will tell you which components are correctly configured and will be built.
Note that it is possible that some MEX files cannot be compiled, due to missing
build dependencies. If you find no way of installing the missing dependencies,
PDF and HTML documentation are respectively built with:
```
```sh
make pdf
make html
```
The testsuites can be run with:
```
make check
```
Note that running the testsuite with Octave requires the additional packages
`pstoedit`, `epstool`, `xfig`, and `gnuplot`.
### Check
The Git source comes with unit tests (in the MATLAB functions) and integration tests (under the `tests` subfolder). All the tests can be run with:
```
```sh
make check
```
In the `tests` subfolder. If Dynare has been compiled against MATLAB and Octave, the tests will be run with MATLAB and Octave. Depending on
the performance of your machine, this can take several hours. It is possible to run the tests only with MATLAB:
```
in the `tests` subfolder. If Dynare has been compiled against MATLAB and Octave, the tests will be run with both MATLAB and Octave. Depending on the performance of your machine, this can take several hours. It is possible to run the tests only with MATLAB:
```sh
make check-matlab
```
or only with Octave:
```
```sh
make check-octave
```
A summary of the results is available in `tests/run_test_matlab_output.txt` or `tests/run_test_octave_output.txt`. Often, it does not make sense
to run the complete testsuite. For instance, if you modify codes only related to the perfect foresight model solver, you can decide to run only a
subset of the integration tests, with:
```
Note that running the testsuite with Octave requires the additional packages `pstoedit`, `epstool`, `xfig`, and `gnuplot`.
A summary of the results is available in `tests/run_test_matlab_output.txt` or `tests/run_test_octave_output.txt`. Often, it does not make sense to run the complete testsuite. For instance, if you modify codes only related to the perfect foresight model solver, you can decide to run only a subset of the integration tests, with:
```sh
make deterministic_simulations
```
This will run all the integration tests in `tests/deterministic_simulations` with MATLAB and Octave. Again, it is possible to do this only with MATLAB:
```
```sh
make m/deterministic_simulations
```
or with Octave:
```
```sh
make o/deterministic_simulations
```
Finally if you want to run a single integration test, e.g. `deterministic_simulations/lbj/rbc.mod` with MATLAB:
```
```sh
make deterministic_simulations/lbj/rbc.m.trs
```
or with Octave:
```
```sh
make deterministic_simulations/lbj/rbc.o.trs
```
The result of the test (`PASSED` or `FAILED`) will be printed in the terminal, the produced log can be displayed with:
```
```sh
make deterministic_simulations/lbj/rbc.m.drs
```
or
```
```sh
make deterministic_simulations/lbj/rbc.o.drs
```
Note that only tests will be executed where the `m.trs/o.trs` does not yet exist. You can run
```
```sh
make clean
```
in the `tests` folder to delete files that were created by the run of the testsuite. You can also manually delete the desired `m.trs/o.trs` file(s).
...
...
@@ -239,11 +222,120 @@ All the prerequisites are packaged:
If you use MATLAB, we strongly advise to also `apt install matlab-support` and confirm to rename the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by your distribution.
In Fedora these are available from the default repositories; whereas for CentOS and RHEL you need to enable the [Extra Packages for Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL) repository and either the PowerTools repository for CentOS or the CodeReady Linux Builder repository for RHEL:
The documentation packages have slightly different names in CentOS and RHEL, you can also choose to pass the `--disable-doc` flag to your configure script to skip these dependencies.
`Slicot` and `x13as` need to be compiled from source:
```sh
# compile slicot from source and put it into /home/$USER/dynare/slicot/lib/
sed-i"s|-static| |" makefile.gf # this removes '-static' in the makefile.gf
make -f makefile.gf FFLAGS="-O2 -std=legacy"PROGRAM=x13as
sudo cp x13as /usr/bin/
```
If you use MATLAB, we strongly advise to also rename or exclude the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by Fedora, see e.g. [Matlab on Fedora 33](https://mutschler.eu/linux/install-guides/fedora-post-install/#matlab) or [MATLAB-ArchWiki](https://wiki.archlinux.org/index.php/MATLAB) for instructions.
Keep in mind to use the `--with-slicot` option to the configure command, e.g.:
make -j$(($(nproc)+1))#rule of thumb: one more than CPUs as shown by e.g. lscpu
```
If your distribution ships an older version of `bison`, compile it from source and append it *temporarily* to your path before calling the configure script:
```sh
bison --version# bison (GNU Bison) 3.0.4
mkdir-p /home/$USER/dynare/bison
cd /home/$USER/dynare/bison
wget http://ftp.gnu.org/gnu/bison/bison-3.6.4.tar.gz #change the version number accordingly
- `CC=gcc-9 CXX=g++-9 ./configure --disable-octave --with-matlab=/Applications/MATLAB_R2019a.app --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local`, adjusting the MATLAB path to accord with your local installation. If you don't have MATLAB, simply remove `--with-matlab=/Applications/MATLAB_R2019a.app` from the above command
- `make -j`
- **(Optional)** To then build mex files for Octave, run
* Smets, Frank and Rafael Wouters (2003): “An Estimated Dynamic Stochastic General Equilibrium Model of the Euro Area,” *Journal of the European Economic Association*, 1(5), 1123–1175.
* Stock, James H. and Mark W. Watson (1999). “Forecasting Inflation,”, *Journal of Monetary Economics*, 44(2), 293–335.
* Uhlig, Harald (2001): “A Toolkit for Analysing Nonlinear Dynamic Stochastic Models Easily,” in *Computational Methods for the Study of Dynamic Economies*, Eds. Ramon Marimon and Andrew Scott, Oxford University Press, 30–61.
* U.S. Census Bureau (2017): “X-13 ARIMA-SEATSReference Manual”.
* Villemot, Sébastien (2011): “Solving rational expectations models at first order: what Dynare does,” *Dynare Working Papers*, 2, CEPREMAP.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.