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
  • Index
  • » Users
  • » MikeThomson
  • » Profile

Posts

Posts

Jan-14-13 15:44:03
Model C code from the Eclipse Console differs from OMShell

Wow, that was a quick response - thanks.
But...
I have removed the +g=MetaModelica line and restarted Eclipse but now in the console I get no responses in the console whatever I type; it doesn't seem to do anything at all. e.g.:

Code:

Welcome to Modelica Development Tooling (MTD) Console

You can send commands to OMC from here.
Type !help for help.
omc> cd("/mnt/MikeyT/Project/Modelica/workspace/DCMotor")

omc> cd()

omc>

Jan-14-13 15:38:46
Simulating a simple DC Motor causes OMEdit to process for hours

I have created the simple DC Motor model using OMEdit. The model runs from the OM Shell fine in about 2 sec and results can be plotted. But when I simulate by clicking on the Simulate button, OMEdit starts processing and this goes on for ages. I'm not patient enough to see if it does end but it may go on for hours. While this process is running, the OMEdit window cannot be used; I have to kill the OMEdit process.
What on earth can it be doing and more to the point, what can I do to resolve the problem?
Thanks,
Mike

PS
Some additional info:
OMEdit version:

Code:

OMEdit - OpenModelica Connection Editor Version: 1.9.0

Connected to OpenModelica 1.9.0 Beta2 (r14391)

Steps taken:
I open OMEdit
I open the model (which runs OK in OMShell)
I can Instantiate Model & Check Model OK
I click the Simulate icon and leave the settings Start 0.0, Stop 1.0; dassl; Tol 0.000001; no flags then click on the Simulate button
A progress bar shows at 100% for a moment
The OMEdit view changes to Plotting
Then nothing more can be done in the OMEdit window - it will not respond to any mouse or keyboard commands
The System Monitor shows that OMEdit is processing 100% and continues till I get bored of waiting and kill it

Any ideas??

Jan-14-13 15:14:25
Model C code from the Eclipse Console differs from OMShell

I have created the simple DC Motor model referred to in the OM Users Guide. When I run it from the OMShell it simulates fine and produces the results which can be plotted. But if I enter the same commands in the Eclipse MDT Console, simulate fails with the message below.
Please can anyone explain what I should do to be able to use the Eclipse Console? (or should I not be using it?)

Fail message:

Code:

omc> simulate(DCMotor,startTime=0.0,stopTime=10.0)

record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'DCMotor', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
    messages = "Simulation failed for model: DCMotor
Error: Error building simulator. Buildlog: perl /opt/modelica/build//share/omc/scripts/convert_lines.pl DCMotor.c DCMotor.conv.c.tmp
perl /opt/modelica/build//share/omc/scripts/convert_lines.pl DCMotor_functions.c DCMotor.conv.c.tmp
gcc  -O0 -g -falign-functions -march=native -mfpmath=sse -fPIC   -I\"/opt/modelica/build//include/omc\" -I. -L\"Motor\"   -c -o DCMotor.conv.o DCMotor.conv.c
DCMotor.c: In function ‘eqFunction_18’:
DCMotor.c:297:7: error: ‘tmpMeta’ undeclared (first use in this function)
DCMotor.c:297:7: note: each undeclared identifier is reported only once for each function it appears in
DCMotor.c:297:7: warning: passing argument 2 of ‘stringAppend’ discards ‘const’ qualifier from pointer target type [enabled by default]
In file included from /opt/modelica/build//include/omc/modelica.h:99:0,
                 from /opt/modelica/build//include/omc/mmc_gc.h:63,
                 from /opt/modelica/build//include/omc/meta_modelica.h:46,
                 from DCMotor_functions.h:4,
                 from DCMotor.c:13:
/opt/modelica/build//include/omc/meta_modelica_builtin.h:67:34: note: expected ‘metamodelica_string_const’ but argument is of type ‘modelica_string’

And sure enough the C code is different. From OMShell:

Code:

void eqFunction_18(DATA *data)

{
  modelica_boolean tmp0;
  modelica_boolean tmp1;
  static int tmp2 = 0;
  modelica_string tmp3;
  modelica_string tmp4;
  if (!tmp2) {
    tmp0 = GreaterEq($Presistor1$PT_ref,1.0);
    tmp1 = LessEq($Presistor1$PT_ref,6000.0);
    if (!(tmp0 && tmp1)) {
      tmp3 = modelica_real_to_modelica_string_format($Presistor1$PT_ref, "g");
      tmp4 = cat_modelica_string("Variable resistor1.T_ref out of [min, max] interval: resistor1.T_ref >= 1.0 and resistor1.T_ref <= 6000.0 has value: ",tmp3);
      FILE_INFO info = {"/opt/modelica/build//lib/omlibrary/Modelica 3.2.1/Electrical/Analog/Basic.mo",66,3,66,78,0};
      omc_assert_warning(tmp4, info);
      tmp2 = 1;
    }
  }
}

From Eclipse Console:

Code:

void eqFunction_18(DATA *data)

{
  modelica_boolean tmp0;
  modelica_boolean tmp1;
  static int tmp2 = 0;
  modelica_string tmp3;
  /*#modelicaLine [/opt/modelica/build//lib/omlibrary/Modelica 3.2.1/Electrical/Analog/Interfaces.mo:312:5-313:99]*/
  if (!tmp2) {
    tmp0 = GreaterEq($Presistor1$PT,1.0);
    tmp1 = LessEq($Presistor1$PT,6000.0);
    if (!(tmp0 && tmp1)) {
      tmp3 = modelica_real_to_modelica_string_format($Presistor1$PT, "g");
      tmpMeta[12] = stringAppend("Variable resistor1.T out of [min, max] interval: resistor1.T >= 1.0 and resistor1.T <= 6000.0 has value: ",tmp3);
      FILE_INFO info = {"/opt/modelica/build//lib/omlibrary/Modelica 3.2.1/Electrical/Analog/Interfaces.mo",312,5,313,99,0};
      omc_assert_warning(MMC_STRINGDATA(tmpMeta[12]), info);
      tmp2 = 1;
    }
  }
  /*#endModelicaLine*/
}

Dec-19-12 21:05:25
Complete beginner needs help

OK, thanks - it's comforting to know I'm getting the correct behaviour.

Dec-19-12 19:53:12
Complete beginner needs help

Yes, that lists all the errors that occurred but I'm wondering why I don't get the same response as I see in the README.Linux.txt or in the OpenModelica Users Guide
Version 2012-12-08 in Example Session 1 on pages 14 & 15. Surely I don't have to execute getErrorString() after every command to see if there was an error?

Dec-19-12 19:23:34
Complete beginner needs help

I'm starting to use OM for the first time.
I put in some commands into OMShell-terminal that should fail and I get no messages:

Code:

>>> a:=1:5;

>>> b:=3:8
{3,4,5,6,7,8}
>>> a*b

>>>

So I tried setting setDebugFlags("failtrace") as below:

Code:

>>> setDebugFlags("failtrace")

true
>>>

but I still get no fail messages.
What should I do to get messages?
Thanks, M

Dec-19-12 18:01:39
Are these errors my fault or a problem?
Category: Developer

Thanks again. I did make mosh & I now have the OMShell-terminal.

Dec-19-12 16:54:14
Are these errors my fault or a problem?
Category: Developer

Thanks.
I was unable to install g++-4.4 on OpenSuse. I tried hunting for it and tried g++-5.5 but it wouldn't install so I gave up that route and tried without paradiseo.
I rebuilt everything and it all seems to have worked (Eclipse sees omc & OMEdit starts ok) but I now have no OMShell-terminal - I'm not sure if I need it - otherwise, any idea why or what I can do to find out why it's missing?

Dec-19-12 02:13:49
Are these errors my fault or a problem?
Category: Developer

I'm getting the following errors when trying to build OM trunk on OpenSuse 12.2. They mean nothing to me.
So is this something I've done wrong or is there a problem?

Code:

mkdir -p build/lib/omlibrary-modelica3d/blender2.59 build/lib/omlibrary-modelica3d/osg-gtk/

cp -p 3rdParty/modelica3d/examples/multibody/src/modelica/*.mo build/lib/omlibrary-modelica3d/
cp -p 3rdParty/modelica3d/backends/blender2.59/dbus-server.py build/lib/omlibrary-modelica3d/blender2.59/
cp -p 3rdParty/modelica3d/backends/osg-gtk/python/dbus-server.py build/lib/omlibrary-modelica3d/osg-gtk/
g++ -g -O2 -fPIC -Wall -DUSE_CORBA -DUSE_OMNIORB   -c -o omc_communication.o omc_communication.cc
In file included from ../MOVector.h:156:0,
                 from ../Variables.h:4,
                 from ../Variables.cpp:1:
../MOVector.cpp: In instantiation of ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = ScannedVariable]’:
../Variables.cpp:163:1:   required from here
../MOVector.cpp:667:13: error: ‘insertItem’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:667:13: note: declarations in dependent base ‘MOAVector<ScannedVariable>’ are not found by unqualified lookup
../MOVector.cpp:667:13: note: use ‘this->insertItem’ instead
../MOVector.cpp: In instantiation of ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = OptVariable]’:
../Variables.cpp:163:1:   required from here
../MOVector.cpp:667:13: error: ‘insertItem’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:667:13: note: declarations in dependent base ‘MOAVector<OptVariable>’ are not found by unqualified lookup
../MOVector.cpp:667:13: note: use ‘this->insertItem’ instead
../MOVector.cpp: In instantiation of ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = Variable]’:
../Variables.cpp:163:1:   required from here
../MOVector.cpp:667:13: error: ‘insertItem’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:667:13: note: declarations in dependent base ‘MOAVector<Variable>’ are not found by unqualified lookup
../MOVector.cpp:667:13: note: use ‘this->insertItem’ instead
../MOVector.cpp: In instantiation of ‘MOVector<ItemClass>::MOVector(QDomElement&, bool) [with ItemClass = ScannedVariable]’:
../MOVector.cpp:663:50:   required from ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = ScannedVariable]’
../Variables.cpp:163:1:   required from here
../MOVector.cpp:633:5: error: ‘connect’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:633:5: note: declarations in dependent base ‘QObject’ are not found by unqualified lookup
../MOVector.cpp:633:5: note: use ‘this->connect’ instead
../MOVector.cpp: In instantiation of ‘MOVector<ItemClass>::MOVector(QDomElement&, bool) [with ItemClass = OptVariable]’:
../MOVector.cpp:663:50:   required from ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = OptVariable]’
../Variables.cpp:163:1:   required from here
../MOVector.cpp:633:5: error: ‘connect’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:633:5: note: declarations in dependent base ‘QObject’ are not found by unqualified lookup
../MOVector.cpp:633:5: note: use ‘this->connect’ instead
../MOVector.cpp: In instantiation of ‘MOVector<ItemClass>::MOVector(QDomElement&, bool) [with ItemClass = Variable]’:
../MOVector.cpp:663:50:   required from ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = Variable]’
../Variables.cpp:163:1:   required from here
../MOVector.cpp:633:5: error: ‘connect’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:633:5: note: declarations in dependent base ‘QObject’ are not found by unqualified lookup
../MOVector.cpp:633:5: note: use ‘this->connect’ instead
../MOVector.cpp: In instantiation of ‘void MOVector<ItemClass>::setItems(QDomElement&) [with ItemClass = ScannedVariable]’:
../MOVector.cpp:632:5:   required from ‘MOVector<ItemClass>::MOVector(QDomElement&, bool) [with ItemClass = ScannedVariable]’
../MOVector.cpp:663:50:   required from ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = ScannedVariable]’
../Variables.cpp:163:1:   required from here
../MOVector.cpp:605:13: error: ‘addItem’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:605:13: note: declarations in dependent base ‘MOAVector<ScannedVariable>’ are not found by unqualified lookup
../MOVector.cpp:605:13: note: use ‘this->addItem’ instead
../MOVector.cpp: In instantiation of ‘void MOVector<ItemClass>::setItems(QDomElement&) [with ItemClass = OptVariable]’:
../MOVector.cpp:632:5:   required from ‘MOVector<ItemClass>::MOVector(QDomElement&, bool) [with ItemClass = OptVariable]’
../MOVector.cpp:663:50:   required from ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = OptVariable]’
../Variables.cpp:163:1:   required from here
../MOVector.cpp:605:13: error: ‘addItem’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:605:13: note: declarations in dependent base ‘MOAVector<OptVariable>’ are not found by unqualified lookup
../MOVector.cpp:605:13: note: use ‘this->addItem’ instead
../MOVector.cpp: In instantiation of ‘void MOVector<ItemClass>::setItems(QDomElement&) [with ItemClass = Variable]’:
../MOVector.cpp:632:5:   required from ‘MOVector<ItemClass>::MOVector(QDomElement&, bool) [with ItemClass = Variable]’
../MOVector.cpp:663:50:   required from ‘bool MOVector<ItemClass>::dropMimeData(const QMimeData*, Qt::DropAction, int, int, const QModelIndex&) [with ItemClass = Variable]’
../Variables.cpp:163:1:   required from here
../MOVector.cpp:605:13: error: ‘addItem’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../MOVector.cpp:605:13: note: declarations in dependent base ‘MOAVector<Variable>’ are not found by unqualified lookup
../MOVector.cpp:605:13: note: use ‘this->addItem’ instead
make[2]: *** [release/generatedfiles/Variables.o] Error 1
make[2]: Leaving directory `/opt/modelica/OMOptimBasis/build'
make[1]: *** [OMOptimBasis] Error 2
make[1]: Leaving directory `/opt/modelica/OMOptimBasis/build'
make: *** [omoptimbasis] Error 2

Dec-19-12 02:04:30
Unable to find OMEdit server

Have you got environment variable $OPENMODELICAHOME set?
Have you built the OM or installed binaries - if you built, was it from trunk and are you sure there were no errors?
Have you configured with --with-omniORB option?
Have you tried testing omc with command omc +d=interactiveCorba

I have tested the omc with with interactiveCorba option with the result shown:

Code:

mike@NEPTUNE:/opt/modelica/build/bin> omc +d=interactiveCorba

CORBA disabled. Configure with --with-omniORB (or --with-MICO) and recompile to enable.CORBA disabled. Configure with --with-omniORB (or --with-MICO) and recompile to enable.mike@

Thus I guess this problem must be caused by an error in the build of omc so I will try to rebuild as instructed.

I have built OM from the trunk on an OpenSuse-12.2 PC. OMShell-terminal works ok. Binaries such as OMShell-terminal & omc & OMEdit & OMPlot are in /opt/modelica/build/bin/

I have the following environment var:

Code:

mike@NEPTUNE:/opt/modelica/build/bin> echo $OPENMODELICAHOME

/opt/modelica/build/

I built OMEdit with:

Code:

sudo ./configure '--disable-rml-trace' 'CFLAGS=-O2' '--with-omniORB'

make -j4 omedit

I try to start OMEdit with :

Code:

mike@NEPTUNE:/opt/modelica/build/bin> ./OMEdit

and it shows the OMEdit flash panel for a while then fails with:

Code:

Unable to find OMEdit server, Object reference file /tmp/openmodelica.mike.objid.OMEdit10a3939554000135577009000000014790023184810350 not created.

OMEdit will close.

Any advice?
Thanks.

Dec-15-12 21:05:55
Struggling to build OM on OopenSuse
Category: Developer

AH yes! Thanks.
I wish they were all that easy.

Dec-14-12 22:27:16
Struggling to build OM on OopenSuse
Category: Developer

I have spent hours today downloading dependencies for OM. Every step has involved problems.
Now I come to build OM and the configure script is not there.
The README.Linux.txt file tells me to execute this:

Code:

./configure --with-omniORB=/path/to/omniORB

but this is bound to fail because there is no configure file.
I have downloaded OM versions trunk and 1.8.1; neither has the configure script.
Do I need to build it somehow?
Is it in a different dir?
Can someone please help?

  • Index
  • » Users
  • » MikeThomson
  • » Profile
You are here: