Polyspace Test supports any existing compiler you might be using to compile your source code. However, the build process generates some additional code that has been validated only with specific compiler versions. You must have one of those compilers to parse source code or run a build with Polyspace Test. When you run a build in the user interface, the first build step checks if a supported compiler is installed.
On Windows, if you have Visual Studio installed in a default location, it is automatically detected when you open the user interface. If you do not have any compiler pre-installed, install supported versions of the MinGW compiler -- available at no charge -- and set an environment variable to continue (see next steps). For the supported compiler list on other operating systems, see https://www.mathworks.com/support/requirements/supported-compilers.html. To set up the MinGW compiler to work with Polyspace:
- Download MinGW 6.3, MinGW 8.1, or MinGW 14.2. Other versions might also work, but the autogenerated code has been validated only with these specific versions.
- Unzip the downloaded folder and place the unzipped folder in a path without spaces, for example, C:\mingw81.
- Set the environment variable MW_MINGW64_LOC to your install folder:
- Make sure you have administrative privileges.
- Enter Edit the system environment variables in the Windows search.
- Click Environment Variables....
- Under System variables, select New....
- In the New System Variable dialog box, type MW_MINGW64_LOC in the Variable name field.
- In the Variable value field, type the location of the MinGW-w64 compiler installation, for example, C:\mingw81 or C:\TDM-GCC-64. Note that this path name cannot contain any spaces or quotes. This path must contain a bin subfolder with executables such as gcc and g++ (both a C and C++ compiler are required).
- Click OK to close the dialog boxes, then close the Control Panel dialog box.
- Close and reopen the Polyspace Platform user interface.
- To confirm that Polyspace recognizes the compiler:
- On the toolstrip, select Settings.
- On the Testing and Profiling tab, check the option C/C++ Host Compiler to see if a compiler has been detected.