Opened 7 years ago
Last modified 7 years ago
#4702 closed defect
assigning to 'modelica_string' (aka 'void *') from incompatible type 'double' data->simulationInfo->stringParameter[6] = 0.0; — at Initial Version
Reported by: | Owned by: | somebody | |
---|---|---|---|
Priority: | high | Milestone: | 1.13.0 |
Component: | Frontend | Version: | v1.12.0 |
Keywords: | Cc: |
Description
Hi there,
After upgrading to the new version of omc and omlibraries, we found a compiling-related error while running a test case () from our open-modelica based repositort, SOLARTHERM, which can be found from https://github.com/SolarTherm/SolarTherm. The instructions to run this test case is given in https://github.com/SolarTherm/SolarTherm/wiki/Building-SolarTherm.
I am copying the error in the following:
build/openmodelica-djNULe/openmodelica-1.12.0/OMCompiler/Compiler/BackEnd/Unit.mo:869:7-869:68:writable Error: Internal error function lexer failed
Compiling simulator
SimpleSystem.c:1135:91: warning: magnitude of floating-point constant too large
for type 'double'; maximum is 1.7976931348623157E+308 [-Wliteral-range]
.../* pri._nextTimeEventScaled DISCRETE */,1.797693134862316e+308);
SimpleSystem.c:1136:154: warning: magnitude of floating-point constant too large
for type 'double'; maximum is 1.7976931348623157E+308 [-Wliteral-range]
.../* pri._nextTimeEventScaled DISCRETE */:1.797693134862316e+308);
2 warnings generated.
SimpleSystem_06inz.c:468:88: warning: magnitude of floating-point constant too
large for type 'double'; maximum is 1.7976931348623157E+308
[-Wliteral-range]
.../* pri._nextTimeEventScaled DISCRETE */,1.797693134862316e+308);
SimpleSystem_06inz.c:469:151: warning: magnitude of floating-point constant too
large for type 'double'; maximum is 1.7976931348623157E+308
[-Wliteral-range]
.../* pri._nextTimeEventScaled DISCRETE */:1.797693134862316e+308);
2 warnings generated.
SimpleSystem_08bnd.c:675:44: error: assigning to 'modelica_string'
(aka 'void *') from incompatible type 'double'
data->simulationInfo->stringParameter[6] = 0.0;
~
1 error generated.
<builtin>: recipe for target 'SimpleSystem_08bnd.o' failed
make: * [SimpleSystem_08bnd.o] Error 1
Traceback (most recent call last):
File "/home/ali/.local/bin/st_simulate", line 103, in <module>
sim.compile_sim(args=([] if args.v else -s))
File "/home/ali/.local/lib/python2.7/site-packages/solartherm/simulation.py", line 244, in compile_sim
+ args)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-j', '1', '-f', 'SimpleSystem.makefile', '-s']' returned non-zero exit status 2
Apparently, the issue is related to the Strings.substring command which is supposed to find a string from a file, but it sets a float value instead, and this raises an error. I should also mention that the older compiler versions were working just fine. As such we suspect that there is some bug in the compiling process in the omc v1.12.
I would greatly appreciate it if you could have a look at this issue and let us know what is exactly wrong.
Regards,
Ali Shirazi