Differences between revisions 11 and 12
Revision 11 as of 2010-09-28 14:48:45
Size: 2396
Comment:
Revision 12 as of 2010-12-22 08:50:31
Size: 2419
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
 * 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:  * you want to use the {{{USE_DLL}}} option of {{{model}}}, or the {{{k_order_solver}}} option of {{{stoch_simul}}} (with Dynare 4.1 only). In that case, you need to tell Dynare which compiler you are using:

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 gcc).

Two compilers are currently supported: GNU C compiler (gcc) 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 (with Dynare 4.1 only). 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

Configuring MATLAB with GNU C compiler (gcc) from Cygwin

  • Install a Cygwin environment (see http://www.cygwin.com). If your MATLAB is 32-bit, you need the "mingw64-i686-gcc" package. If your MATLAB is 64-bit, you need the "mingw64-x86_64-gcc" package.

  • The configuration file is called mexopts-win32.bat for MATLAB 32-bit, and mexopts-win64.bat for MATLAB 64-bit (these files are also distributed in recent packages of Dynare)

  • Rename the configuration file to mexopts.bat, and copy it to c:\Documents and Settings\<User name>\Application Data\MathWorks\MATLAB\<release number>\.

  • 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:

DynareWiki: ConfigureMatlabWindowsForMexCompilation (last edited 2016-10-15 12:21:08 by JohannesPfeifer)