Requirements for Project Creation from Build Systems
For automatic project creation from build systems, your build commands or makefiles must meet certain requirements.
Compiler Requirements
Your compiler must be called locally.
If you use a compiler cache such as
ccache
or a distributed build system such asdistmake
, the software cannot trace your build. You must deactivate them.Your compiler must perform a clean build.
If your compiler performs only an incremental build, use appropriate options to build all your source files. For example, if you use
gmake
, append the-B
or-W
option to force a clean build. For the list of options allowed with the GNU®makefileName
make
, see make options.Your compiler configuration must be available to Polyspace®. The compilers currently supported include the following:
Arm Keil.
ARM® v5. See also
ARM v5 Compiler (-compiler armcc)
.ARM v6. See also
ARM v6 Compiler (-compiler armclang)
.Clang. For a list of supported versions, see Clang Compilers.
Cosmic. See also
Cosmic Compiler (-compiler cosmic)
.Wind River® Diab. See also
Diab Compiler (-compiler diab)
.Green Hills®. See also
Green Hills Compiler (-compiler greenhills)
.GNU C/C++. For a list of supported versions, see GCC Compilers.
IAR Embedded Workbench. See also
IAR Embedded Workbench Compiler (-compiler iar-ew)
.IAR systems.
Intel® C++ Compiler Classic (icc/icl) compiler. See also
Intel C++ Compiler Classic (icc/icl) (-compiler intel)
.Microsoft® Visual C++®. For a list of supported versions, see Visual Studio Compilers.
MPLAB XC8 C. See also
MPLAB XC8 C Compiler (-compiler microchip)
.NXP CodeWarrior®. See also
NXP CodeWarrior Compiler (-compiler codewarrior)
.Renesas®. See also
Renesas Compiler (-compiler renesas)
.Altium® Tasking. See also
TASKING Compiler (-compiler tasking)
.Texas Instruments®. See also
Texas Instruments Compiler (-compiler ti)
.tcc - Tiny C Compiler
If your compiler configuration is not available to Polyspace:
Write a compiler configuration file for your compiler in a specific format. For more information, see Create Polyspace Projects from Build Systems That Use Unsupported Compilers.
Contact MathWorks Technical Support. For more information, see Contact Technical Support About Issues with Running Polyspace.
If you build your code in Cygwin™, use versions 2.x or 3.x of Cygwin for Polyspace project creation from your build system (for instance, Cygwin version 2.10 or 3.0).
With the TASKING compiler, if you use an alternative sfr file with extension
.asfr
, Polyspace might not be able to locate your file. If you encounter an error, explicitly#include
your.asfr
file in the preprocessed code using the optionInclude (-include)
.Typically, you use the statement
#include __SFRFILE__(__CPU__)
along with the compiler option--alternative-sfr-file
to specify an alternative sfr file. The path to the file is typically
. For instance, if your TASKING compiler is installed inTasking_C166_INSTALL_DIR
\include\sfr\regCPUNAME
.asfrC:\Program Files\Tasking\C166-VX_v4.0r1\
and you use the CPU-related flag-Cxc2287m_104f
or--cpu=xc2287m_104f
, the path isC:\Program Files\Tasking\C166-VX_v4.0r1\include\sfr\regxc2287m.asfr
.
Build Command Requirements
Your build command must run to completion without any user interaction.
In Linux®, only UNIX® shell (sh) commands must be used. If your build uses advanced commands such as commands supported only by bash, tcsh or zsh, Polyspace cannot trace your build.
In Windows®, only DOS commands must be used. If your build uses advanced commands such as commands supported only by PowerShell or Cygwin, Polyspace cannot trace your build. To see if Polyspace supports your build command, run the command from
cmd.exe
in Windows. For more information, see Check If Polyspace Supports Build Scripts.Your build command must not contain lines where several sources are compiled in a single line using wildcard characters, for instance:
cl.exe *.c
If you use statically linked libraries, Polyspace cannot trace your build. In Linux, you can install the full Linux Standard Base (LSB) package to allow dynamic linking. For example, on Debian® systems, install LSB with the command
apt-get install lsb
.Your build command must not use aliases.
The
alias
command is used in Linux to create an alternate name for commands. If your build command uses those alternate names, Polyspace cannot recognize them.Your build process must not use the
LD_PRELOAD
mechanism.Your build command must be executable completely on the current machine and must not require privileges of another user.
If your build uses
sudo
to change user privileges orssh
to remotely log in to another machine, Polyspace cannot trace your build.If your build command uses redirection with the
>
or|
character, the redirection occurs after Polyspace traces the command. Therefore, Polyspace does not handle the redirection.For example, if your command occurs as
And you entercommand1 | command2
When tracing the build, Polyspace traces the first command only.polyspace-configure command1 | command2
If the System Integrity Protection (SIP) feature is active on the operating system macOS El Capitan (10.11) or a later macOS version, you can use
polyspace-configure
to generate a project or build options file only if your build system supports the generation of a compilation database file that you pass topolyspace-configure
. See Create Polyspace Options File from JSON Compilation Database. If your build system does not support the generation of compilation database file and the SIP feature is enabled, Polyspace cannot trace your build command. Alternatively, before tracing your build command, disable the SIP feature. You can reenable this feature after tracing the build command.Similar considerations apply to other security applications such as security-related products from CylanceProtect, Avecto and Tanium.
If your computer hibernates during the build process, Polyspace might not be able to trace your build.
When creating projects from build commands in the Polyspace User Interface, you might encounter errors such as
libcurl.so.4: version 'CURL_OPENSSL_3' not found
. In such cases, create the Polyspace project by using the commandpolyspace-configure
in the system command line interface, using the build command as the argument. Seepolyspace-configure
.
Note
Your environment variables are preserved when Polyspace traces your build command.