How to compile?

5 posts / 0 new
Last post
Zoex666
Offline
Joined: 2011-03-16
How to compile?

Hello there...I'm totally newbye..i read the Jmodelica.org tutorial,but i still not understand how to compile.I've created the source code named SimplePendulum.mo, then i put this in a directory (for example c:\ ).Then I launched Jmodelica.org-1.4/Ipython ...(I checked all the packages..all ok)...,then I did so:

from jmodelica.jmi import compile_jmu
model_name = 'SimplePendulum'
mo_file = 'SimplePendulum.mo'
compile_jmu(model_name, mo_file,compiler_options={'extra_lib_dirs':['c:\']})

But it cannot find the file SimplePendulum.mo....
Please,Could anyone tell me what I'm doing wrong?
Can u tell me a simple example to compile a file.mo located in c:\ .
Thanks!

Zoex666
Offline
Joined: 2011-03-16
Any idea?

Any idea?

niklasa
Offline
Joined: 2009-10-05
Are you sure that you run it

Are you sure that you run it from the directory where the file is located (type pwd)? I think that you can skip the option extra_lib_dirs if the file SimplePendulum.mo contains the whole model. Try to add the whole directory name in mo_file,

from jmodelica.jmi import compile_jmu
model_name = 'SimplePendulum'
mo_file = r'c:\SimplePendulum.mo'
compile_jmu(model_name, mo_file)

Best regards
Niklas

Zoex666
Offline
Joined: 2011-03-16
Thank you Nicklasa !!! Now

Thank you niklasa !!! Now it's ok! Compiled and simulated...today it's my birthday ...thank you for your present ;) .
Best regards.
Zoex666

niklasa
Offline
Joined: 2009-10-05
You're welcome. Happy

You're welcome. Happy birthday!

Best
Niklas

Login or register to post comments