Opened 5 years ago
Last modified 5 years ago
#6004 assigned defect
Cpp runtime on Windows can't handle spaces in install path
| Reported by: | Andreas Heuermann | Owned by: | Adrian Pop |
|---|---|---|---|
| Priority: | blocker | Milestone: | Future |
| Component: | Cpp Run-time | Version: | v1.16.0-dev |
| Keywords: | Windows Spaces | Cc: | Adrian Pop, Niklas Worschech |
Description
The C++ runtime can't handle the default installation location C:\Program Files\OpenModelica1.16.0-dev-64bit\ on Windows because of the space.
For omsicpp sim code target:
test.mos:
loadString("model M
end M;"); getErrorString();
setCommandLineOptions("-d=newInst --simCodeTarget=omsicpp"); getErrorString();
simulate(M); getErrorString();
Run mos script:
true
""
true
""
record SimulationResult
resultFile = "",
simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'M', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
messages = "Failed to build model: M",
timeSimulation = 0.0,
timeTotal = 0.3822554
end SimulationResult;
"Error: Error building simulator. Build log: mingw32-make: Entering directory 'D:/WORKSP~1/TESTIT~1/M82C0~1.FMU'
\"mkdir.exe\" -p M.fmutmp/sources M.fmutmp/sources/include M.fmutmp/sources/libs
\"mkdir.exe\" -p M.fmutmp/resources
\"mkdir.exe\" -p M.fmutmp/binaries/win64
# Basic OMSI and OMSIC files
cp -a C:/Program Files/OpenModelica1.16.0-dev-64bit/include/omc/omsi/* M.fmutmp/sources/include/
cp: cannot stat 'C:/Program': No such file or directory
cp: cannot stat 'Files/OpenModelica1.16.0-dev-64bit/include/omc/omsi/*': No such file or directory
M_FMU.makefile:69: recipe for target 'copyFiles' failed
mingw32-make: *** [copyFiles] Error 1
mingw32-make: Leaving directory 'D:/WORKSP~1/TESTIT~1/M82C0~1.FMU'
RESULT: 2
"
And for --simCodeTarget=cpp I get:
$ "C:\Program Files\OpenModelica1.16.0-dev-64bit\bin\omc" BouncingBallFMI20_cpp.mos --locale=en
true
""
true
""
record SimulationResult
resultFile = "",
simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'M', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
messages = "Simulation execution failed for model: M
WARNING: other : Warning: unrecognized command line options Files/OpenModelica1.16.0-dev-64bit/lib//omc/omsicpp/
Simulation stopped with error in model factory: Failed loading SimController library from path C:\\Program\\libOMCppSimController.dll",
timeFrontend = 0.0003001,
timeBackend = 0.0066663,
timeSimCode = 0.0004555,
timeTemplates = 0.0507363,
timeCompile = 7.3837476
end SimulationResult;
""
Change History (7)
comment:1 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 5 years ago
First Problem is fixed in commit b8c9771.
The second problem remains. For it to be caught during tests we need to simulate a sanity model
loadString("model M
end M;"); getErrorString();
simulate(M); getErrorString();
for C, C++ and maybe some additional targets (basically everything that can link dynamic libraries into its executable).
comment:4 by , 5 years ago
| Cc: | added |
|---|
comment:5 by , 5 years ago
Are you sure we can simulate a totally empty model without running into issues? Maybe
model M Real x = 1; end M; could be safer.
follow-up: 7 comment:6 by , 5 years ago
We can actually simulate an empty model. Is it the default sanity test for Linux:
https://github.com/OpenModelica/OpenModelica/blob/master/.CI/common.groovy#L242
On Windows we test a real small model with C, C++, FMI runtimes in a path without spaces and in a path with spaces:
https://github.com/OpenModelica/OpenModelica/blob/master/.CI/common.groovy#L203
I tried to add a path with space and special chars (åöä) but somehow doesn't work via scripting. I'll find some other way.

The first error case is prabaly only missing some quotes in the makefile. I'm going to fix that right now.