Opened 4 years ago

Last modified 4 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 Andreas Heuermann, 4 years ago

Owner: changed from somebody to Andreas Heuermann
Status: newassigned

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

comment:2 by Andreas Heuermann, 4 years ago

Owner: changed from Andreas Heuermann to Adrian Pop

First problem should be fixed in PR 995.

comment:3 by Andreas Heuermann, 4 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 Andreas Heuermann, 4 years ago

Cc: Niklas Worschech added

comment:5 by Francesco Casella, 4 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.

comment:6 by Adrian Pop, 4 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.

in reply to:  6 comment:7 by Francesco Casella, 4 years ago

Replying to adrpo:

We can actually simulate an empty model.

Good to know :)

Note: See TracTickets for help on using tickets.