#5804 closed defect (fixed)
Profiling blocks+html is broken again in OMEdit
Reported by: | Francesco Casella | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | blocker | Milestone: | 1.16.0 |
Component: | OMEdit | Version: | |
Keywords: | Cc: |
Description
It seems that we really cannot keep profiling to work for more than half a year (see #4708, #5030).
Steps to reproduce:
- open OMEdit 1.16.0-dev
- open Modelica.Blocks.Examples.PID_Controller
- enable blocks+html profiling in the Simulation Setup | Simulation window
- run the simulation
The following error messages are reported
Plot command failed: C:/Program Files/OpenModelica1.16.0-dev-64bit//lib/omc/libexec/gnuplot/binary/gnuplot.exe d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.plt Failed to generate html version of profiling results: C:/Program Files/OpenModelica1.16.0-dev-64bit//lib/omc/libexec/xsltproc/xsltproc.exe -o d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.html C:/Program Files/OpenModelica1.16.0-dev-64bit//share/omc/scripts/default_profiling.xsl d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.xml Time measurements are stored in d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.html (human-readable) and d:/temp/OMEdit/Modelica.Blocks.Examples.PID_Controller/Modelica.Blocks.Examples.PID_Controller_prof.xml (for XSL transforms or more details) "C:/Program" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. "C:/Program" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch.
and of course the HTML file is not produced, nor any data is visualized in the declarative debugger.
I guess this is yet another case of space in an executable path (the damn Program Files
breaking a Windows script. May them be damned.
The other options that do not produce an html file work fine, and the profiling results are eventualy loaded in the debugger.
Can you please fix this ASAP?
Change History (11)
comment:1 by , 5 years ago
comment:3 by , 5 years ago
Sorry to push you, I badly need this stuff to prepare the keynote next week. Any chance to get it fixed by today or tomorrow?
comment:4 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
The issues is here:
https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/SimulationRuntime/c/simulation/modelinfo.c#L499
and here:
https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/SimulationRuntime/c/simulation/modelinfo.c#L517
and possibly here:
https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/SimulationRuntime/c/simulation/modelinfo.c#L522
I guess one would need to just insert double quotes in the paths.
comment:5 by , 5 years ago
Seems adeas31 already has a fix for it:
https://github.com/OpenModelica/OpenModelica/commit/5c9ca2eddc11b0e5c8c4075304e40dd3f08d96b7
comment:6 by , 5 years ago
Tested the fix and is not working. Seems you need to also quote the entire thing send to system!?
https://stackoverflow.com/questions/2642551/windows-c-system-call-with-spaces-in-command
I have an additional fix for this.
comment:7 by , 5 years ago
Fixed via: https://github.com/OpenModelica/OpenModelica/pull/702
Also tested it. Hopefully will work fine in the tomorrow's build.
comment:8 by , 5 years ago
Thank you folks!
BTW, it was not only an OMEdit issue, the thing was broken also from command line scripts.
I guess we should put some profiling stuff in the testsuite so that we catch when it gets broken, though I'm not 100% sure if and how this could be done.
comment:9 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Of course, this will also work from command line. The call to gnuplot and xsltproc is done by the simulation executable so the fix will work for any qt client or omc.
Fixed in 6589c8/OpenModelica.
comment:10 by , 5 years ago
We do have profiling stuff in the test suite, but no spaces in the install path :)
@adeel: can Windows escape paths in the system call using double quotes? some of these issues affect Linux as well (if spaces are in the install path)