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
  • » cxbrooks
  • » Profile

Posts

Posts

I'm new to OpenModelica and MacPorts, so I'm not sure if this is a bug in my installation or a general OpenModelica bug on the Mac.

The problem is that I can't export Bouncing Ball to a FMU under Mac OS X 10.7.3

The bug does *not* occur under OpenModelica 1.8.1 under Windows Server 2008 R2, I was able to export Bouncing Ball.

I downloaded openmodelica-devel-11449.dmg and installed it.

I tried creating an BouncingBall.mo file from
http://proactive.inria.fr/trunk/Schedul … elica.html
and then exporting and FMU and received the following:

Translation    18:09:03        0:0-0:0    Error building simulator. Buildlog: /opt/openmodelica/bin/gcc-mp-4.4  -I"/opt/openmodelica/include/omc" -O2 -falign-functions -msse2 -mfpmath=sse   -I"/opt/openmodelica/include/omc" -I. -L"/Users/cxh/src/fmu/openmodelica"   -c -o BouncingBall_FMU.o BouncingBall_FMU.c
In file included from BouncingBall_FMU.c:64:
/opt/openmodelica/include/omc/fmu_model_interface.c: In function 'BouncingBall_fmiInitialize':
/opt/openmodelica/include/omc/fmu_model_interface.c:559: error: too few arguments to function 'initialization'
gmake: *** [BouncingBall_FMU.o] Error 1



Looking at the code, I can see that there is a problem.

BouncingBall_FMU.c contains:

#include "initialization.h"
#include "events.h"
#include "fmu_model_interface.h"



/opt/openmodelica/include/omc/fmu_model_interface.c line 559 is

if (initialization(comp->fmuData, "state", "nelder_mead_ex")){



/opt/openmodelica/include/omc/initialization.h has a different declaration:

extern int initialization(DATA *data, const char* pInitMethod,
    const char* pOptiMethod, const char* pInitFile, double initTime);



I deleted /opt/openmodelica and reinstalled the prebuilt dmg and the same problem occurred, so I don't think it is my MacPorts set up, but I'm not sure.

Also, when I created a FMU file with darwin64 binaries from my port of the FMUSDK at http://github.com/cxbrooks/fmusdk, it failed to import:

Following Error has occurred.
date Mar 16 2012, time 12:37:23, file moGenerator.c, line 1467]: #### parsing model description xml file occurred error: md = NULL
while importing /Users/cxh/src/fmu/fmusdk/fmu/cs/bouncingBall.fmu



Here, I suspect that the problem might be the platform name, which should be darwin64.  I vaguely remember seeing that one of the Modelica tools had a different platform name for the binaries under Mac OS X.

_Christopher

I just installed OpenModelica 1.8.1 under Windows Server 2008 R2 (very similar to Windows 7).  It looks like the OpenModelica 1.8.1 installer sets %PTII% to
C:\OpenModelica1.8.1\bin/ptplot.jar.  The problem is that this will conflict with anyone who has Ptolemy II installed because Ptolemy II uses $PTII.
I'm one of the developers of Ptolemy II and Ptplot.  I'm not sure why PTII would be set to the ptplot.jar file.  In Ptolemy II, $PTII is set to the directory that contains the Ptolemy II release.

http://www.mail-archive.com/openmodelic … 00869.html
says

Admin privileges are needed *only* for
"Install for all users" option. If you
just install for yourself then it should
add the environment variables in the user
environment (and hopefully not complain).

If only PTII doesn't get set and the others:
- OPENMODELICAHOME
- OPENMODELICALIBRARY
- DRMODELICAHOME
are set correctly then only the Java based
plotting (via plot2, plotParametric2) will
not work. However, you can edit the script:
$OPENMODELICAHOME/bin/doPlot.bat
to give the full path to ptplot.jar



I don't seem to have $OPENMODELICAHOME/bin/doPlot.bat?
So perhaps PTII does not need to be set at all?

Also, if you Ptplot is being used, you could update from Ptplot 5.5 to 5.8.  One of the changes is a performance improvement for plots with many points.  The changes are:

The changes between ptplot5.7 and ptplot5.8

Tom Peachey, Christopher Brooks: Added support for line styles, captions and big dots.
Peter Reutemann: Additions to Query class including some new classes in ptolemy.gui.
Bert Rodiers: performance improvements for plotting plot with many points.
Bert Rodiers: use generic types in several places.
Bert Rodiers: added feature to automatically rescale plots while running the model.
Christopher Brooks: support for -printPDF, which will print a plot to a PDF file.
Bert Rodiers: If no marking style has been selected unconnected points are now always marked with a dot, unless the point is already marked. The first and last point of a line segment is also marked with a dot if the point is not already marked.
Bert Rodiers: Fixed bugs related to avoiding plotting or erasing the same point multiple times.
The changes between ptplot5.6 and ptplot5.7

Christopher Brooks: Clean up warnings reported by FindBugs.
Christopher Brooks, Haiyang Zheng: Fix problem surrounding plotting only one stem.
The changes between ptplot5.5 and ptplot5.6

Christopher Brooks: pxgraph now takes a "-" argument, which indicates that data should be read from standard input.



Thanks,
_Christopher

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