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

Posts

Posts

Hi,
my FMUmodel build with OpenModelica failed to be loaded inside pyfmi from jmodelica.

I get this error :

assert            | assert  | Failed to open file example_info.xml: No such file or directory

|                 | |       |

It works exporting BouncingBall.mo (see link below) with OpenModelica and importing with load_fmu function in pyfmi.

http://www.robotic.de/fileadmin/control … ingBall.mo 

I can't reproduce this error on a simple example and unfortunately can't send you the model for confidentiality reason.


Some questions :

Where am I supposed to see example_info.xml ? I only have a modelDescription.xml file inside my FMU file.

Why do we need this file ?

I can run my model inside Openmodelica, i.e. directly from source .mo or importing it in OpenModelica.

I already ask jModelica for support.
If you have any ideas, even if it lacks some info...
Regards,
Thomas

Hi,
I try to compile with omc +target=msvc file.mos

This command generates C-file in with a static function :

Code:


static void (*functionAlg_systems[0])(DATA *, int) = {
};

It fails to compile

Code:


error C2466: cannot allocate an array of constant size 0

with the command line :

Code:

cl /Od /ZI /EHa /fp:except /I\"C:/Programfiles/OpenModelica//include/omc\" /I. /DNOMINMAX /TP /DNO_INTERACTIVE_DEPENDENCY /c Test.Global.c 

which refers to the array :

Code:

functionAlg_systems[0]

.

I try with omc file.mos command and it compiles and works with the same code generated...

Any ideas ?

Hi,
thanks for all your answers. I was not able to test your suggestions but I will !

So far, I will post any findings/mistakes I made to contribute to this forum.

Thanks again.

Thanks for your answers. I begin to understand how OpenModelica tries to facilitates things.
Indeed for me it's a bit tricky for my purpose current/smile

So, removing the letter "a" from the library name doesn't work.

I manage to launch the compilation process with Netbeans directly using the makefile generated. I remove some compilation problems by setting the right compiler.
sjoelund.se you were right when you said that we should care of runtime. Some links where not statisfied since Netbeans use by default Cygwin runtime on windows.
I had linking error like the one mentionned here. I configured Netbeans so it can use MSVCRT runtime. Where I would be able to find those information directly ?

Then, I wanted to add all corba libs (dynamic) :

Code:

LDFLAGS=-L"C:/Programfiles/OpenModelica//lib/omc" -Wl,--stack,0x2000000,-rpath,'C:/Programfiles/OpenModelica//lib/omc' $(LIBSIMULATIONRUNTIMEC) -linteractive  -lregex -lexpat -lgc  -static-libgcc -luuid -lole32 -lws2_32 -lsundials_kinsol -lsundials_nvecserial -llapack-mingw -ltmglib-mingw -lblas-mingw -Wl,-Bstatic -lf2c -Wl,-Bdynamic

I put manually -llibname after

Code:

-Bdynamic

but environnement variable are still not good... I should add

Code:

-L=C:/path/to/my/lib/

Both of your solution suggest that It can be done by mos-script. I look at it and be sure that CORBA lib is compiled with mingw/msys.

Hi everybody,
I am a new user of OModelica and I want my model to communicate with an inhouse code.
My first goal is to make my model communicate through CORBA protocol. My OpenModelica can be look as a client of my application.

This how I want to built it.

First, I start with ExternalLibraries example found in /share/doc/omc/testmodels where I plug CORBA calls. I built my library libmylib.a with netbeans (not sure that we can make it dynamic ?) where mylib contains functions that need to use CORBA libraries.

Here is my OpenModelica model (unchanged) :

Code:

function ExternalFunc2

  input Real x;
  output Real y;
  external "C" annotation(Library="libmylib.a",Include="#include \"ExternalFunc2.h\"");
end ExternalFunc2;

model ExternalLibraries
  Real y(start=2.0);
equation
der(y)=-ExternalFunc2(y);
end ExternalLibraries;

Then, I launch this mos file :

Code:

loadFile("ExternalLibraries.mo");

#Compilation of static libraries is done in Netbeans, so I remove the compilation of object and librarie part : system("gcc -******" );
simulate(ExternalLibraries);

It fails with this error :

Code:


    messages = "Simulation failed for model: ExternalLibraries
Error: Error building simulator. Buildlog: gcc   -falign-functions -msse2 -mfpmath=sse   -I\"C:/Programfiles/OpenModelica//include
/omc\" -I.    -c -o ExternalLibraries.o ExternalLibraries.c
gcc   -falign-functions -msse2 -mfpmath=sse   -I\"C:/Programfiles/OpenModelica//include/omc\" -I.    -c -o ExternalLibraries_recor
ds.o ExternalLibraries_records.c
g++ -I. -o ExternalLibraries.exe ExternalLibraries.o ExternalLibraries_records.o -I\"C:/Programfiles/OpenModelica//include/omc\" -
I.    libmylib.a    -falign-functions -msse2 -mfpmath=sse   -L\"C:/Programfiles/OpenModelica//lib/omc\" -Wl,--stack,0x20
00000,-rpath,'C:/Programfiles/OpenModelica//lib/omc' -lSimulationRuntimeC   -linteractive  -lregex -lexpat -lgc  -static-libgcc -l
uuid -lole32 -lws2_32 -lsundials_kinsol -lsundials_nvecserial -llapack-mingw -ltmglib-mingw -lblas-mingw -Wl,-Bstatic -lf2c -Wl,-B
dynamic
libmylib.a(ExternalFunc2.o): In function `_static_initialization_and_destruction_0':
/cygdrive/C/omniORB-4.1.6/include/omnithread.h:674: undefined reference to `omni_thread::init_t::init_t()'
libmylib.a(ExternalFunc2.o): In function `_static_initialization_and_destruction_0':
/cygdrive/C/omniORB-4.1.6/include/omniORB4/finalCleanup.h:41: undefined reference to `_omniFinalCleanup::_omniFinalCleanup()'
/cygdrive/C/omniORB-4.1.6/include/omniORB4/finalCleanup.h:41: undefined reference to `_omniFinalCleanup::~_omniFinalCleanup()'
...

and many more.

For what I understand :
- Simulate launch g++
- g++ fails to find CORBA libraries

Questions :
1 - How can export all environment variables so simulate function/g++ can locate CORBA lib
1Bis - How to add compilation option to g++

2 - Could Netbeans replace simulate function, i.e. compile libs, exe and launch ? It would be easier for C-debugging. I am not using Eclipse since I don't want to use to many different IDE in this project.

3 - Is OModelica able to "use" dll ?

(4 - Can CORBA calls be made directly ? I know that OM use CORBA so more efficient ideas are welcome.)

Thanks in advance for your precious help
Thomas

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