Size: 1603
Comment:
|
Size: 2297
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
Two compilers are currently supported: GNU C++ compiler (g++) from Cygwin, and Microsoft Visual C++ (MSVC). |
|
Line 5: | Line 7: |
* you want to use the {{{USE_DLL}}} option of {{{model}}}, or the {{{k_order_solver}}} option of {{{stoch_simul}}} | * you want to use the {{{USE_DLL}}} option of {{{model}}}, or the {{{k_order_solver}}} option of {{{stoch_simul}}}. In that case, you need to tell Dynare which compiler you are using: * if you are using Cygwin, type at the MATLAB prompt: {{{ dynare modfilename cygwin }}} * if you are using Microsoft Visual C++: {{{ dynare modfilename msvc }}} |
Line 7: | Line 17: |
We describe here the installation of two compilers: GNU C++ compiler (g++), and Microsoft Visual C++ (MSVC). | /!\ For MATLAB 64-bit, the only supported compiler is MSVC |
Line 9: | Line 19: |
Note that for {{{USE_DLL}}} and {{{k_order_solver}}}, the only supported compiler is g++ = Configuring MATLAB with GNU C++ compiler (g++) = |
= Configuring MATLAB with GNU C++ compiler (g++) from Cygwin = |
Line 14: | Line 22: |
* Download [[attachment:mexopts.bat]], and put it in {{{c:\Documents and Settings\<User name>\Application Data\MathWorks\MATLAB\<release number>\}}} | * Copy the file {{{mexopts.bat}}} in {{{c:\Documents and Settings\<User name>\Application Data\MathWorks\MATLAB\<release number>\}}}. This file comes with your Dynare installation (in {{{c:\dynare\<Dynare version>}}}). If you don't have it in your distribution, you can pick it [[https://www.dynare.org/trac/browser/windows/mexopts.bat|here in the Git repository]]. * Note that if you installed Cygwin in a non-standard directory (i.e. elsewhere than {{{C:\CYGWIN}}}), you need to edit the {{{mexopts.bat}}} and change the {{{set PATH=...}}} line accordingly. |
Line 20: | Line 29: |
* Install Visual C++ 2008 Express Edition, downloadable at http://www.microsoft.com/Express/VC/ | * Install Visual C++ 2008 Express Edition, downloadable at http://www.microsoft.com/express/Downloads/#Visual_Studio_2008_Express_Downloads |
This page briefly documents how to configure MATLAB for Windows when a MEX compilation environment is required. Under Linux and MacOS, this configuration step is not necessary, because these operating systems already come with a working compilation environment (using g++).
Two compilers are currently supported: GNU C++ compiler (g++) from Cygwin, and Microsoft Visual C++ (MSVC).
With Dynare, you need a working MEX compilation environment in two cases:
- you need to recompile Dynare MEX files, without using Dynare build system
you want to use the USE_DLL option of model, or the k_order_solver option of stoch_simul. In that case, you need to tell Dynare which compiler you are using:
- if you are using Cygwin, type at the MATLAB prompt:
dynare modfilename cygwin
- if you are using Microsoft Visual C++:
dynare modfilename msvc
- if you are using Cygwin, type at the MATLAB prompt:
For MATLAB 64-bit, the only supported compiler is MSVC
Configuring MATLAB with GNU C++ compiler (g++) from Cygwin
Install a Cygwin environment (see http://www.cygwin.com). You need at least the following packages: gcc, gcc-g++, gcc-mingw, gcc-mingw-g++
Copy the file mexopts.bat in c:\Documents and Settings\<User name>\Application Data\MathWorks\MATLAB\<release number>\. This file comes with your Dynare installation (in c:\dynare\<Dynare version>). If you don't have it in your distribution, you can pick it here in the Git repository.
Note that if you installed Cygwin in a non-standard directory (i.e. elsewhere than C:\CYGWIN), you need to edit the mexopts.bat and change the set PATH=... line accordingly.
Configuring MATLAB with Microsoft Visual C++ (MSVC)
The following should work with recent versions of MATLAB:
Install Visual C++ 2008 Express Edition, downloadable at http://www.microsoft.com/express/Downloads/#Visual_Studio_2008_Express_Downloads
At MATLAB prompt, type mex -setup; it should autodetect MSVC, and let you select it
For users of MATLAB 64-bit, please follow these instructions for finishing the installation