Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

buildModel fails with template error (from CodeGenUtil.tpl)

buildModel fails with template error (from CodeGenUtil.tpl)

I get the following error trying to build this model. And I am struggling to find the source of the problem with no success.

Please let me know how I can resolve this error.

(I built OpenModelica from svn sources - rev. 1.9.3+dev (r25926) - on a Linux box - "Linux vishnu 3.19.8-100.fc20.x86_64 #1 SMP Tue May 12 17:08:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux", with gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)

Attached please find "total.mo" file

Trace from OMShell-terminal
total.mo

>>> buildModel(plant_total)       
{"",""}
>>> getErrorString()
"Warning: Alias set with several free start values
* candidate: adsorber.outlet_outState.p(start = 100000.0)
* candidate: adsorber.outlet.p(start = 1000000.0)
* candidate: v2.inlet.p(start = 1000000.0)
* candidate: adsorber.outlet_State.p(start = 100000.0)
=> select value from adsorber.outlet_outState.p(start = 100000.0) for variable: adsorber.outlet_outState.p
Warning: Alias set with several free start values
* candidate: adsorber.inlet_outState.p(start = 100000.0)
* candidate: adsorber.inlet.p(start = 1000000.0)
* candidate: v1.outlet.p(start = 1000000.0)
* candidate: adsorber.inlet_State.p(start = 100000.0)
=> select value from adsorber.inlet_outState.p(start = 100000.0) for variable: adsorber.inlet_outState.p
Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.
[b][CodegenUtil.tpl:207:16-207:16:writable] Error: Template error: ScalarVariableType: Real[2][/b]

"

Attachments:

Re: buildModel fails with template error (from CodeGenUtil.tpl)

Since I last submitted the post I found the source of the problem in buildModel phase. It appears that the translated (replaceable) function "solve: from the Media.Common.OneNonLinearEquation package has a stray statement that fails compilation of the translated function. Below is the short segment of the code snipped from the "plant_functions.c" file.


if(((fabs(_m) <= _tol) || (_fb == 0.0)))
    {
      _found = 1;

      // 0.0 = 1;                ..... This is the stray line  I had to comment out for the "make" to succeed,

      _x_zero = _b;


I am able identify the corresponding Modelica code in the function is shown .(Attaching a small screenshot of OMEdit session) .

My gut feeling says that it is a bug in the translator. 
https://openmodelica.org/images/agorapro/attachments/2421/mini_solvefunctionListing.png

Edited by: ravi - Jul-24-15 07:53:41

Re: buildModel fails with template error (from CodeGenUtil.tpl)

Hi,

I now opened a ticket about this:
https://trac.openmodelica.org/OpenModelica/ticket/3390
and hopefully we'll get to the bottom of this.

Cheers,
Adrian Pop/

There are 0 guests and 0 other users also viewing this topic
You are here: