
C Compilers on Windows
Visual Studio - Free editions:
- Visual Studio 2012 Express Edition (11.0)
- Visual Studio 2015 Express Edition for Windows Desktop (14.0)
- Visual Studio 2017 Community 2017 (15)
- Visual Studio 2017 Desktop Express for Windows Desktop (15) - Note that this compiler only support compiling to Windows 32-bit executables.
- Microsoft Build Tools 2017
- The recommended selection to run Dymola is:
- Visual C++ build tools
- C++/CLI support
- Installing the above selection, no IDE (Integrated Development Environment) is installed, only command line features
- This installation is not visible as a specific selection when later selecting the compiler in Dymola, the alternative to select is the same as for any other Visual Studio 2017 alternatives.
- The recommended selection to run Dymola is:
- Visual Studio 2019 Community (16)
- Microsoft Build Tools 2019 (see instructions on Installing and Testing Microsoft Build Tools)
- The recommended selection to run Dymola is:
- Visual C++ build tools
- C++/CLI support
- The recommended selection to run Dymola is:
See Downloads below for the link to the free Visual Studio compiler. Rights to use Visual Studio Community depend on the customer segment and usage scenarios; please check on Microsoft web site.
Visual Studio - Professional editions:
- Visual Studio 2012 (11.0)
- Visual Studio 2015 (14.0)
- Visual Studio Professional 2017 (VS 15)
- Visual Studio Enterprise 2017 (VS 15)
- Visual Studio Professional 2019 (VS 16)
- Visual Studio Enterprise 2019 (VS 16)
See Downloads below for the link to the Visual Studio compiler.
Intel compiler:
The support for Intel compilers has been discontinued.
GCC compilers:
Both 32- and 64-bit MinGW can be installed from the same installer, using different options. Link to download from: https://sourceforge.net/projects/mingw-w64. Start the MinGW installer, then select:
- For 32-bit
- Architecture: i686
- Threads: win32
- Exception: dwarf
- For 64-bit
- Architecture: x86_64
- Threads: posix
- Exception: she
The following compilers have been tested (later versions are usually compatible):
- 32-bit MinGW, GCC version 5.3, 6.3, 8.2
- 64-bit MinGW, GCC version 5.3, 7.3, 8.1
Note – the GCC compilers have some limitations, and demand for add-ons during installation etc. Click here for more details and find below the download link.
WSL GCC compiler (Linux cross-compiler):
Dymola on Windows supports cross-compilation for Linux via the use of Windows Subsystem for Linux (WSL) GCC compiler. The default WSL setup is 64-bit only and Dymola adopts this limitation.
See Using Windows Subsystem for Linux with Dymola.
Installing a C Compiler on Windows
Please note that for the Windows platform, a C/C++ compiler must be installed separately. The C compiler can be installed before or after you install Dymola. You can run Dymola and browse models, but to translate any model you must install the C compiler. To change the compiler Dymola uses to translate the model, use the command Simulation > Setup... and the Compiler tab. (To the right is an example of the Compiler tab).
The selected compiler is stored as a per user setting and for the future kept for new installations of Dymola.
C Compilers on Linux
On Linux systems the default compiler is used. The compilation is controlled by the shell script insert/dsbuild.sh. Dymola 2022x runs on Red Hat Enterprise Linux, 64-bit, with gcc version 8.3.1, and compatible systems. In addition to gcc, the model C code can also be compiled by clang.
For instructions on how to change compiler, and further notes, click here.
Troubleshooting
Compiler check and error coding
The compiler that is used to compile the C code generated by Dymola into executable code for simulation is set in the Compiler tab using the command Simulation > Setup… (see above).
Some potential problems can be found by pressing the Test compiler button. A small Modelica program is compiled and executed to test the compiler, both for 32 and 64 bit Dymola executables. Messages will be displayed on success or failure.
Any warning messages indicate problems that need to be resolved before translating a model. Error messages with information how to proceed (including a link to this web page) will be displayed, e. g. when no compiler is selected. If no compiler has been selected (or installed) when starting Dymola, a message will be displayed with a link to the compiler setup. The corresponding information is also displayed in the command log.
Dymola on Windows
Note that Visual Studio performs parts of its installation the first time it is run. This must be performed in order to use Visual Studio with Dymola, a step that requires administrator privileges. If needed, the rights can be elevated by running Dymola as administrator the first time. This is done by right-clicking the Dymola icon in the Windows Start menu and selecting Run as administrator.
To validate this, any model (e. g. a demo) should be opened and translated in Dymola.