Polyspace-configure on a microsoft visual studio project hangs or am I still missing ingredients.

4 views (last 30 days)
The example I am using (some things I found):
"polyspace-configure.exe -lang cpp <MSVS path>/msbuild sample.sln" found at: https://www.mathworks.com/help/codeprover/ug/cannot-create-project-from-visual-studio-build.html?s_tid=srchtitle
  • '-lang' is depricated
  • MSVS path: putting in the base path of MSVS or any path, does not recognize as a command. So I put in the whole path to devenv.exe, {from putting together this is a call it makes to.}
  • '/msbuild' or '/build' Visual studio errors on this
To use "Polyspace-config", I have to go to the path it is located:
C:\Program Files\Polyspace\R2020a\appdata\files\polyspace>
From there I have to use quotes in my command and another set around my path because of spaces:
cmd /C "polyspace-configure.exe "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe" C:\xxx\Source\TRUNK\Systems\DPM\DPM.sln"
Visual Studio opens up and builds the project.
Then the DOS command hangs..

Answers (2)

Anirban
Anirban on 24 Jul 2020
Hi Jeremy,
Sorry you landed on this topic with a deprecated option. This will be definitely fixed.
The recommended way to use a Visual Studio build with polyspace-configure is given in Create Project Using Visual Studio Information. It is essentially what you did. If you close the Visual Studio IDE, the polyspace-configure command would also run to completion.
msbuild PathToSolution works in the Visual Studio developer command prompt. In your Windows Start menu, start typing Developer Command Prompt for VS 2017.
Here is a sample command:
polyspace-configure -output-options-file psopts -allow-overwrite msbuild TestProject.vcxproj /t:Rebuild
If you use a regular command prompt, you have to specify the full path to the msbuild executable. The executable would be in a folder like
C:\Windows\Microsoft.NET\Framework\v4.0.30319
  2 Comments
jeremy longstreet
jeremy longstreet on 29 Jul 2020
Edited: jeremy longstreet on 29 Jul 2020
This is what I am using to build my projects:(seems to hang, but pressing [enter] helps to move it along)
polyspace-configure.exe -module -output-options-path C:\xxx\PolyspaceProjects\PolyspaceConfigOutput\ "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe" /build release "C:\xxx\Source\TRUNK\Systems\DPM\DPM.sln"
I am using the SLN solution as apposed to vcxproj, would that cause a difference in depth of classes it investigates from each project?
In otherwords 30 projects are completed, but how far back in levels of classes did it investigate per each project?
Anirban
Anirban on 3 Aug 2020
Edited: Anirban on 3 Aug 2020
The option -module ensures that a Polyspace options file is created for every executable created (.exe, .dll) in the Visual Studio solution. However, each options file contains source information only for a specific project in the solution. So, there will be a difference in the depth of classes investigated, based on whether the option -module is used or not.
See an example in Modularize Polyspace Analysis by Using Build Command (it is not about Visual Studio, but you will get the idea). Each makefile target in this example is similar to a project in the Visual Studio solution.
Let us say, a VS solution consists of three projects, two projects that lead to two .exe-s and the third one leading to a .dll that will be linked from the two projects. When you run polyspace-configure and build the entire solution:
  • If you do not use the option -module, files from all three projects will be added to one options file. You are mixing sources from two different executables.
  • If you use the option -module, three separate options files will be created.
The second approach might be sufficient for your needs.
But maybe what you want to do is, using polyspace-configure without -module and -output-options-path, build each project in Visual Studio with its related projects that lead to shared libraries, so that all those files that go into one executable are added to one Polyspace options file.
You can look into Visual Studio documentation on how to do this.

Sign in to comment.


jeremy longstreet
jeremy longstreet on 4 Aug 2020
With Polyspace-config, using -module, I got a psopts output file for each project. But these did not include the tree of source and header files that expand beyond this. Hence when we run from the Polyspace GUI... we see all those trees and catch a memory issue with the compilier. But when we run from the cmd window, we only see the surface level classes of the projects and NO memory issue.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!