- Index
- » Users
- » Steve_Petrie
- » Profile
Posts
Posts
Ahhh. Cringe... Squirm... Beg pardon of the OpenModelica Forum for my stupidly wasting your time with that last posting of mine.
Especially the time of sjoelund.se who has shown admirable restraint in not giving me, in his forum reply, the verbal cuff up the side of my head that I so richly deserve, for typing "loadModule" instead of "loadModel":
...
The command is loadModel(Modelica)
...
*** SUCCESS !! ***
This topic can now be closed.
* * *
I can now repeat the steps in the simple sample trial mosh session, described in file:
<README.Linux.md> in <~/OpenModelica/OMCompiler\>
These steps are detailed in the P.S. below.
Seems like I now have OpenModelica: 1. compiler, 2. text-mode shell and 3. standard library, all functioning on a Debian linux server.
* * *
* * *
Now I will go away and try to develop a first Modelica model -- a highly abstract reciprocating steam engine.
The engine consists of three working parts:
==> CYLINDER;
==> HEAD;
==> PISTON;
The engine head is fixed to the left end of the cylinder, which is of infinite length projecting in the rightwards direction.
The engine is surrounded by air at a given atmospheric pressure, and air and engine parts all start at a specified uniform ambient temperature.
* * *
The engine begins operation with the piston in the cylinder, displaced somewhat to the right from the cylinder head, and fixed in place, forming an initial working volume.
The initial working volume is filled with superheated steam of specified temperature and mass.
The piston is released and accelerates rightwards, under the net steam pressure force acting above the opposing force exerted on the other side of the piston, by atmospheric air pressure.
The Modelica model will simulate over time, the thermodynamic properties of the steam, and the mechanical motion of the piston, as the piston accelerates to the right, gaining kinetic energy, while the steam cools as it expands, doing work on the piston.
Eventually, as the steam cools, it will transition from superheated phase to liquid-vapour phase, and eventually all the way to pure liquid phase.
At some point in time, steam pressure will fall below atmospheric air pressure, and the net force on the piston will begin to act towards the left, decelerating the piston's rightward motion down to zero velocity.
The simulation will end at this point.
Refinements of the model will add e.g.:
==> loss of heat energy from the steam, through contact with cylinder walls head and piston.
==> friction between piston and cylinder walls;
==> simulate "return stroke" of piston, as it travels leftwards, back towards the cylinder head;
==> etc.
This abstract Modelica model of a reciprocating steam engine, will be the starting point for a Modelica model of an actual novel design for a practicable working reciprocating steam engine delivering rotating power. A novel design that I believe has extremely good dynamic balancing. So a small reciprocating steam engine with small moving mass, will be able to turn very fast (without-self-destructing vibration), and deliver a lot of power.
* * *
Many thanks to the Modelica Forum and especially to sjoelund.se, for helping me get to a working hands-on text-mode OpenModelica
Steve
P.S. Below are details of the simple sample trial mosh session, described in document <README.Linux.md> that I repeated, working with the newly-installed OpenModelica packages.
* * *
* * *
==> try loadModel(Modelica):
Code:
...
>>> loadModel(Modelica)
true
>>> getErrorString()
""
>>>
...
==> try instantiateModel(Modelica.Electrical.Analog.Basic.Resistor):
Code:
...
>>> instantiateModel(Modelica.Electrical.Analog.Basic.Resistor)
"class Modelica.Electrical.Analog.Basic.Resistor \"Ideal linear electrical resistor\"
Real v(quantity = \"ElectricPotential\", unit = \"V\") \"Voltage drop between the two pins (= p.v - n.v)\";
Real i(quantity = \"ElectricCurrent\", unit = \"A\") \"Current flowing from pin p to pin n\";
Real p.v(quantity = \"ElectricPotential\", unit = \"V\") \"Potential at the pin\";
Real p.i(quantity = \"ElectricCurrent\", unit = \"A\") \"Current flowing into the pin\";
Real n.v(quantity = \"ElectricPotential\", unit = \"V\") \"Potential at the pin\";
Real n.i(quantity = \"ElectricCurrent\", unit = \"A\") \"Current flowing into the pin\";
parameter Boolean useHeatPort = false \"=true, if HeatPort is enabled\";
parameter Real T(quantity = \"ThermodynamicTemperature\", unit = \"K\", displayUnit = \"degC\", min = 0.0, start = 288.15, nominal = 300.0) = T_ref \"Fixed device temperature if useHeatPort = false\";
Real LossPower(quantity = \"Power\", unit = \"W\") \"Loss power leaving component via HeatPort\";
Real T_heatPort(quantity = \"ThermodynamicTemperature\", unit = \"K\", displayUnit = \"degC\", min = 0.0, start = 288.15, nominal = 300.0) \"Temperature of HeatPort\";
parameter Real R(quantity = \"Resistance\", unit = \"Ohm\", start = 1.0) \"Resistance at temperature T_ref\";
parameter Real T_ref(quantity = \"ThermodynamicTemperature\", unit = \"K\", displayUnit = \"degC\", min = 0.0, start = 288.15, nominal = 300.0) = 300.15 \"Reference temperature\";
parameter Real alpha(quantity = \"LinearTemperatureCoefficient\", unit = \"1/K\") = 0.0 \"Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref))\";
Real R_actual(quantity = \"Resistance\", unit = \"Ohm\") \"Actual resistance = R*(1 + alpha*(T_heatPort - T_ref))\";
equation
assert(1.0 + alpha * (T_heatPort - T_ref) >= 1e-15, \"Temperature outside scope of model!\");
R_actual = R * (1.0 + alpha * (T_heatPort - T_ref));
v = R_actual * i;
LossPower = v * i;
v = p.v - n.v;
0.0 = p.i + n.i;
i = p.i;
T_heatPort = T;
p.i = 0.0;
n.i = 0.0;
end Modelica.Electrical.Analog.Basic.Resistor;
"
>>>
...
==> try erroneous variable set:
Code:
...
>>> a:=1:5;
>>> b:=3:8
{3,4,5,6,7,8}
>>> a*b
>>> getErrorString()
"[<interactive>:1:1-1:0:writable] Error: Incompatible argument types to operation scalar product in component <NO COMPONENT>, left type: Integer[5], right type: Integer[6]
[<interactive>:1:1-1:0:writable] Error: Incompatible argument types to operation scalar product in component <NO COMPONENT>, left type: Real[5], right type: Real[6]
[<interactive>:1:1-1:0:writable] Error: Cannot resolve type of expression a * b. The operands have types Integer[5], Integer[6] in component <NO COMPONENT>.
"
>>>
...
==> try correct variable set:
Code:
...
>>> b:=3:7;
>>> a*b
85
>>> listVariables()
{b,a}
>>>
...
Thanks to sjoelund.se (for the gentle hint about apt-get update...):
...
Yes, "deb http://build.openmodelica.org/apt wheezy nightly"
followed by apt-get update should work.
Precise does indeed depend on libc 2.15.
...
*** GOOD PROGRESS ***
Packages installed from "http://build.openmodelica.org/apt wheezy nightly":
...
omc
omshell-terminal
omlib-modelica-3.2.1
...
I am able to start both omc and OMshell-terminal.
But OMshell-terminal reports an error when I try to get to load the Modelica Standard Library:
Code:
...
omc@debian:~$ OMShell-terminal -noserv
Skip starting server, assumed to be running
OMShell Copyright 1997-2015, Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
To get help on using OMShell and OpenModelica, type "help()" and press enter
>>> loadModule(Modelica)
>>> getErrorString()
"[<interactive>:1:1-1:0:writable] Error: Class loadModule not found in scope <global scope> (looking for a function or record).
"
>>>
...
What do I need to do, to get (the) Modelica (Standard Library) in package omlib-modelica-3.2.1 to load at the OMshell-terminal prompt?
Any suggestions would be most appreciated.
Thanks
Steve
P.S. Below are details of package installation and tests.
* * *
* * *
==> try this:
==> revise <sources.list>;
==> aptitude update;
==> aptitude install omc;
==> revise <sources.list>:
Code:
...
root@debian:/etc/apt# vi sources.list.v08
root@debian:/etc/apt# cat sources.list.v08
# sources.list 30 May 2015
deb http://build.openmodelica.org/apt wheezy nightly
# previous <sources.list> contents follow...
deb http://ftp.uk.debian.org/debian wheezy main
deb http://security.debian.org wheezy/updates main
deb http://build.openmodelica.org/apt precise nightly
deb-src http://build.openmodelica.org/apt precise nightly
root@debian:/etc/apt# cp sources.list.v08 sources.list
root@debian:/etc/apt# ls --group-directories-first -al
total 68
drwxr-xr-x 6 root root 4096 May 31 00:48 .
drwxr-xr-x 75 root root 4096 May 31 00:30 ..
drwxr-xr-x 2 root root 4096 Feb 22 2014 apt.conf.d
drwxr-xr-x 2 root root 4096 Nov 16 2013 preferences.d
drwxr-xr-x 2 root root 4096 Nov 16 2013 sources.list.d
drwxr-xr-x 2 root root 4096 Feb 22 2014 trusted.gpg.d
-rw-r--r-- 1 root root 336 May 31 00:49 sources.list
-rw-r--r-- 1 root root 211 May 30 09:32 sources.list.v00
-rw-r--r-- 1 root root 152 May 30 10:00 sources.list.v01
-rw-r--r-- 1 root root 363 May 30 10:05 sources.list.v02
-rw-r--r-- 1 root root 348 May 30 10:40 sources.list.v03
-rw-r--r-- 1 root root 80 May 30 10:54 sources.list.v04
-rw-r--r-- 1 root root 232 May 30 11:30 sources.list.v05
-rw-r--r-- 1 root root 338 May 30 12:20 sources.list.v06
-rw-r--r-- 1 root root 363 May 31 00:36 sources.list.v07
-rw-r--r-- 1 root root 336 May 31 00:48 sources.list.v08
-rw------- 1 root root 1200 Feb 22 2014 trustdb.gpg
-rw------- 1 root root 0 Feb 22 2014 trusted.gpg
root@debian:/etc/apt#
...
==> aptitude update:
...
Code:
root@debian:/etc/apt# aptitude update
Hit http://security.debian.org wheezy/updates Release.gpg
Hit http://security.debian.org wheezy/updates Release
Hit http://security.debian.org wheezy/updates/main amd64 Packages
Hit http://ftp.uk.debian.org wheezy Release.gpg
Hit http://security.debian.org wheezy/updates/main Translation-en
Get: 1 http://build.openmodelica.org wheezy Release.gpg [473 B]
Hit http://ftp.uk.debian.org wheezy Release
Hit http://ftp.uk.debian.org wheezy/main amd64 Packages
Get: 2 http://build.openmodelica.org precise Release.gpg [473 B]
Hit http://ftp.uk.debian.org wheezy/main Translation-en
Get: 3 http://build.openmodelica.org wheezy Release [20.8 kB]
Ign http://build.openmodelica.org wheezy Release
Hit http://build.openmodelica.org precise Release
Ign http://build.openmodelica.org precise Release
Get: 4 http://build.openmodelica.org wheezy/nightly amd64 Packages [21.2 kB]
Ign http://build.openmodelica.org precise/nightly Sources/DiffIndex
Ign http://build.openmodelica.org precise/nightly amd64 Packages/DiffIndex
Hit http://build.openmodelica.org precise/nightly Sources
Hit http://build.openmodelica.org precise/nightly amd64 Packages
Ign http://build.openmodelica.org wheezy/nightly Translation-en
Ign http://build.openmodelica.org precise/nightly Translation-en
Fetched 43.0 kB in 2s (15.6 kB/s)
W: There is no public key available for the following key IDs:
9D6D8F6BC857C906
W: There is no public key available for the following key IDs:
7638D0442B90D010
W: GPG error: http://build.openmodelica.org wheezy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3A59B53664970947
W: GPG error: http://build.openmodelica.org precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3A59B53664970947
Current status: 111 new [+11].
root@debian:/etc/apt#
...
==> aptitude install omc:
Code:
...
root@debian:/etc/apt# ls --group-directories-first -al
total 68
drwxr-xr-x 6 root root 4096 May 31 00:48 .
drwxr-xr-x 75 root root 4096 May 31 00:30 ..
drwxr-xr-x 2 root root 4096 Feb 22 2014 apt.conf.d
drwxr-xr-x 2 root root 4096 Nov 16 2013 preferences.d
drwxr-xr-x 2 root root 4096 Nov 16 2013 sources.list.d
drwxr-xr-x 2 root root 4096 Feb 22 2014 trusted.gpg.d
-rw-r--r-- 1 root root 336 May 31 00:49 sources.list
-rw-r--r-- 1 root root 211 May 30 09:32 sources.list.v00
-rw-r--r-- 1 root root 152 May 30 10:00 sources.list.v01
-rw-r--r-- 1 root root 363 May 30 10:05 sources.list.v02
-rw-r--r-- 1 root root 348 May 30 10:40 sources.list.v03
-rw-r--r-- 1 root root 80 May 30 10:54 sources.list.v04
-rw-r--r-- 1 root root 232 May 30 11:30 sources.list.v05
-rw-r--r-- 1 root root 338 May 30 12:20 sources.list.v06
-rw-r--r-- 1 root root 363 May 31 00:36 sources.list.v07
-rw-r--r-- 1 root root 336 May 31 00:48 sources.list.v08
-rw------- 1 root root 1200 Feb 22 2014 trustdb.gpg
-rw------- 1 root root 0 Feb 22 2014 trusted.gpg
root@debian:/etc/apt# aptitude install omc
The following NEW packages will be installed:
libbackport-util-concurrent-java{a} libcommons-codec-java{a} libdom4j-java{a}
libjaxen-java{a} libjaxme-java{a} libjdom1-java{a} liblog4j1.2-java{a}
libomc{a} libomcsimulation{a} libomplot{a} libsaxonb-java{a} libxerces2-java{a}
libxml-commons-external-java{a} libxml-commons-resolver1.1-java{a}
libxom-java{a} libxpp2-java{a} libxpp3-java{a} omc omc-common{a} omplot{a}
python-beautifulsoup{a} python-chardet{a}
0 packages upgraded, 22 newly installed, 0 to remove and 49 not upgraded.
Need to get 17.3 MB of archives. After unpacking 46.0 MB will be used.
Do you want to continue? [Y/n/?] y
WARNING: untrusted versions of the following packages will be installed!
Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.
libomplot omplot omc libomc omc-common libomcsimulation
Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": y
Unrecognized input. Enter either "Yes" or "No".
Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": yes
Get: 1 http://ftp.uk.debian.org/debian/ wheezy/main libbackport-util-concurrent-java all 3.1-3 [294 kB]
Get: 2 http://build.openmodelica.org/apt/ wheezy/nightly omc-common all 25881-1 [208 kB]
Get: 3 http://ftp.uk.debian.org/debian/ wheezy/main libcommons-codec-java all 1.6-1 [194 kB]
Get: 4 http://ftp.uk.debian.org/debian/ wheezy/main libxml-commons-resolver1.1-java all 1.2-7 [91.9 kB]
Get: 5 http://build.openmodelica.org/apt/ wheezy/nightly libomcsimulation amd64 25881-1 [2073 kB]
Get: 6 http://ftp.uk.debian.org/debian/ wheezy/main libxml-commons-external-java all 1.4.01-2 [245 kB]
Get: 7 http://ftp.uk.debian.org/debian/ wheezy/main libxerces2-java all 2.11.0-6 [1365 kB]
Get: 8 http://ftp.uk.debian.org/debian/ wheezy/main libjaxen-java all 1.1.3-1 [203 kB]
Get: 9 http://ftp.uk.debian.org/debian/ wheezy/main liblog4j1.2-java all 1.2.16-3 [385 kB]
Get: 10 http://ftp.uk.debian.org/debian/ wheezy/main libjaxme-java all 0.5.2+dfsg-6 [1202 kB]
Get: 11 http://ftp.uk.debian.org/debian/ wheezy/main libxpp2-java all 2.1.10-7 [147 kB]
Get: 12 http://ftp.uk.debian.org/debian/ wheezy/main libxpp3-java all 1.1.4c-2 [349 kB]
Get: 13 http://ftp.uk.debian.org/debian/ wheezy/main libdom4j-java all 1.6.1+dfsg.2-6 [334 kB]
Get: 14 http://ftp.uk.debian.org/debian/ wheezy/main libjdom1-java all 1.1.2+dfsg-2 [151 kB]
Get: 15 http://ftp.uk.debian.org/debian/ wheezy/main libxom-java all 1.2.1-3 [389 kB]
Get: 16 http://ftp.uk.debian.org/debian/ wheezy/main libsaxonb-java all 9.1.0.8-1 [3986 kB]
Get: 17 http://ftp.uk.debian.org/debian/ wheezy/main python-beautifulsoup all 3.2.1-1 [35.2 kB]
Get: 18 http://ftp.uk.debian.org/debian/ wheezy/main python-chardet all 2.0.1-2 [177 kB]
Get: 19 http://build.openmodelica.org/apt/ wheezy/nightly libomc amd64 25881-1 [4706 kB]
Get: 20 http://build.openmodelica.org/apt/ wheezy/nightly libomplot amd64 25881-1 [534 kB]
Get: 21 http://build.openmodelica.org/apt/ wheezy/nightly omc amd64 25881-1 [219 kB]
Get: 22 http://build.openmodelica.org/apt/ wheezy/nightly omplot amd64 25881-1 [39.8 kB]
Fetched 17.3 MB in 6s (2512 kB/s)
Selecting previously unselected package libbackport-util-concurrent-java.
(Reading database ... 59252 files and directories currently installed.)
Unpacking libbackport-util-concurrent-java (from .../libbackport-util-concurrent-java_3.1-3_all.deb) ...
Selecting previously unselected package libcommons-codec-java.
Unpacking libcommons-codec-java (from .../libcommons-codec-java_1.6-1_all.deb) ...
Selecting previously unselected package libxml-commons-resolver1.1-java.
Unpacking libxml-commons-resolver1.1-java (from .../libxml-commons-resolver1.1-java_1.2-7_all.deb) ...
Selecting previously unselected package libxml-commons-external-java.
Unpacking libxml-commons-external-java (from .../libxml-commons-external-java_1.4.01-2_all.deb) ...
Selecting previously unselected package libxerces2-java.
Unpacking libxerces2-java (from .../libxerces2-java_2.11.0-6_all.deb) ...
Selecting previously unselected package libjaxen-java.
Unpacking libjaxen-java (from .../libjaxen-java_1.1.3-1_all.deb) ...
Selecting previously unselected package liblog4j1.2-java.
Unpacking liblog4j1.2-java (from .../liblog4j1.2-java_1.2.16-3_all.deb) ...
Selecting previously unselected package libjaxme-java.
Unpacking libjaxme-java (from .../libjaxme-java_0.5.2+dfsg-6_all.deb) ...
Selecting previously unselected package libxpp2-java.
Unpacking libxpp2-java (from .../libxpp2-java_2.1.10-7_all.deb) ...
Selecting previously unselected package libxpp3-java.
Unpacking libxpp3-java (from .../libxpp3-java_1.1.4c-2_all.deb) ...
Selecting previously unselected package libdom4j-java.
Unpacking libdom4j-java (from .../libdom4j-java_1.6.1+dfsg.2-6_all.deb) ...
Selecting previously unselected package libjdom1-java.
Unpacking libjdom1-java (from .../libjdom1-java_1.1.2+dfsg-2_all.deb) ...
Selecting previously unselected package omc-common.
Unpacking omc-common (from .../omc-common_25881-1_all.deb) ...
Selecting previously unselected package libomcsimulation:amd64.
Unpacking libomcsimulation:amd64 (from .../libomcsimulation_25881-1_amd64.deb) ...
Selecting previously unselected package libomc:amd64.
Unpacking libomc:amd64 (from .../libomc_25881-1_amd64.deb) ...
Selecting previously unselected package libomplot:amd64.
Unpacking libomplot:amd64 (from .../libomplot_25881-1_amd64.deb) ...
Selecting previously unselected package libxom-java.
Unpacking libxom-java (from .../libxom-java_1.2.1-3_all.deb) ...
Selecting previously unselected package libsaxonb-java.
Unpacking libsaxonb-java (from .../libsaxonb-java_9.1.0.8-1_all.deb) ...
Selecting previously unselected package omc.
Unpacking omc (from .../archives/omc_25881-1_amd64.deb) ...
Selecting previously unselected package omplot.
Unpacking omplot (from .../omplot_25881-1_amd64.deb) ...
Selecting previously unselected package python-beautifulsoup.
Unpacking python-beautifulsoup (from .../python-beautifulsoup_3.2.1-1_all.deb) ...
Selecting previously unselected package python-chardet.
Unpacking python-chardet (from .../python-chardet_2.0.1-2_all.deb) ...
Processing triggers for man-db ...
Setting up libbackport-util-concurrent-java (3.1-3) ...
Setting up libcommons-codec-java (1.6-1) ...
Setting up libxml-commons-resolver1.1-java (1.2-7) ...
Setting up libxml-commons-external-java (1.4.01-2) ...
Setting up libxerces2-java (2.11.0-6) ...
Setting up libjaxen-java (1.1.3-1) ...
Setting up liblog4j1.2-java (1.2.16-3) ...
Setting up libjaxme-java (0.5.2+dfsg-6) ...
Setting up libxpp2-java (2.1.10-7) ...
Setting up libxpp3-java (1.1.4c-2) ...
Setting up libdom4j-java (1.6.1+dfsg.2-6) ...
Setting up libjdom1-java (1.1.2+dfsg-2) ...
Setting up omc-common (25881-1) ...
Setting up libomcsimulation:amd64 (25881-1) ...
Setting up libomc:amd64 (25881-1) ...
Setting up libomplot:amd64 (25881-1) ...
Setting up libxom-java (1.2.1-3) ...
Setting up libsaxonb-java (9.1.0.8-1) ...
Setting up omc (25881-1) ...
Setting up omplot (25881-1) ...
Setting up python-beautifulsoup (3.2.1-1) ...
Setting up python-chardet (2.0.1-2) ...
root@debian:/etc/apt# omc --help
OpenModelica Compiler 1.9.3+dev (r25881)
Copyright © 2014 Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
Usage: omc [Options] (Model.mo | Script.mos) [Libraries | .mo-files]
* Libraries: Fully qualified names of libraries to load before processing Model or Script.
The libraries should be separated by spaces: Lib1 Lib2 ... LibN.
* Options:
-d, --debug Sets debug flags. Use --help=debug to see available
flags.
-h, --help Displays the help text. Use --help=topics for more
information.
--v, --version Print the version and exit.
--target Sets the target compiler to use.
Valid options: gcc, msvc, vxworks69
-g, --grammar Sets the grammar and semantics to accept.
Valid options: Modelica, MetaModelica, ParModelica,
Optimica
...
...
For available simulation flags, use --help=simulation.
Documentation is available in the built-in package OpenModelica.Scripting or
online <https://build.openmodelica.org/Documentation/OpenModelica.Scripting.html>.
root@debian:/etc/apt#
...
==> aptitude install omshell-terminal:
Code:
...
root@debian:/etc/apt# aptitude install omshell-terminal
The following NEW packages will be installed:
omshell-terminal
0 packages upgraded, 1 newly installed, 0 to remove and 49 not upgraded.
Need to get 24.1 kB of archives. After unpacking 134 kB will be used.
WARNING: untrusted versions of the following packages will be installed!
Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.
omshell-terminal
Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": yes
Get: 1 http://build.openmodelica.org/apt/ wheezy/nightly omshell-terminal amd64 25881-1 [24.1 kB]
Fetched 24.1 kB in 0s (54.1 kB/s)
Selecting previously unselected package omshell-terminal.
(Reading database ... 60154 files and directories currently installed.)
Unpacking omshell-terminal (from .../omshell-terminal_25881-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up omshell-terminal (25881-1) ...
root@debian:/etc/apt#
...
==> try omshell-terminal:
Code:
...
root@debian:/etc/apt# omshell-terminal
-bash: omshell-terminal: command not found
root@debian:/etc/apt# ^C
root@debian:/etc/apt#
...
root@debian:/etc/apt# man omshell-terminal
...
OMShell-terminal
...
root@debian:/etc/apt# OMShell-terminal -noserv
Skip starting server, assumed to be running
OMShell Copyright 1997-2015, Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
To get help on using OMShell and OpenModelica, type "help()" and press enter
help()
Error connecting to omc server in interactive mode.
: Connection refused
root@debian:/etc/apt# help()
> help()
-bash: syntax error near unexpected token `help'
root@debian:/etc/apt#
...
==> start omc:
Code:
...
root@debian:/etc/apt# omc +d=interactive
Error: You are trying to run OpenModelica as a server using the root user.
This is a very bad idea:
* The socket interface does not authenticate the user.
* OpenModelica allows execution of arbitrary commands.
Execution failed!
root@debian:/etc/apt#
...
==> login as user omc & start omc:
...
login as: omc
omc@76.74.203.73's password:
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat May 30 09:02:20 2015 from pool1-210.dial.user.start.ca
omc@debian:~$ omc +d=interactive
Opening a socket on port 29500
...
==> login as user omc & start OMShell-terminal:
Code:
...
login as: omc
omc@76.74.203.73's password:
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun May 31 01:20:46 2015 from pool1-210.dial.user.start.ca
omc@debian:~$ OMShell-terminal -noserv
Skip starting server, assumed to be running
OMShell Copyright 1997-2015, Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
To get help on using OMShell and OpenModelica, type "help()" and press enter
>>> help()
"The available topics (help(\"topics\")) are as follows:
omc The command-line options available for omc.
debug Flags that enable debugging, diagnostics, and research prototypes.
optmodules Flags that determine which symbolic methods are used to produce the
causalized equation system.
simulation The command-line options available for simulation executables generated
by OpenModelica.
<flagname> Displays option descriptions for multi-option flag <flagname>.
topics This help-text.
"
>>> ^C
omc@debian:~$
...
==> aptitude install omlib-modelica-3.2.1:
Code:
...
root@debian:/etc/apt# aptitude install omlib-modelica-3.2.1
The following NEW packages will be installed:
omlib-complex-3.2.1{a} omlib-modelica-3.2.1 omlib-modelicaservices-3.2.1{a}
0 packages upgraded, 3 newly installed, 0 to remove and 49 not upgraded.
Need to get 12.2 MB of archives. After unpacking 32.9 MB will be used.
Do you want to continue? [Y/n/?] y
WARNING: untrusted versions of the following packages will be installed!
Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.
omlib-complex-3.2.1 omlib-modelicaservices-3.2.1 omlib-modelica-3.2.1
Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": yes
Get: 1 http://build.openmodelica.org/apt/ precise/nightly omlib-complex-3.2.1 all 6931-om1-1 [11.2 kB]
Get: 2 http://build.openmodelica.org/apt/ precise/nightly omlib-modelicaservices-3.2.1 all 6931-om1-1 [19.2 kB]
Get: 3 http://build.openmodelica.org/apt/ precise/nightly omlib-modelica-3.2.1 all 8183-om1-1 [12.2 MB]
Fetched 12.2 MB in 6s (1752 kB/s)
Selecting previously unselected package omlib-complex-3.2.1.
(Reading database ... 60162 files and directories currently installed.)
Unpacking omlib-complex-3.2.1 (from .../omlib-complex-3.2.1_6931-om1-1_all.deb) ...
Selecting previously unselected package omlib-modelicaservices-3.2.1.
Unpacking omlib-modelicaservices-3.2.1 (from .../omlib-modelicaservices-3.2.1_6931-om1-1_all.deb) ...
Selecting previously unselected package omlib-modelica-3.2.1.
Unpacking omlib-modelica-3.2.1 (from .../omlib-modelica-3.2.1_8183-om1-1_all.deb) ...
Setting up omlib-complex-3.2.1 (6931-om1-1) ...
Setting up omlib-modelicaservices-3.2.1 (6931-om1-1) ...
Setting up omlib-modelica-3.2.1 (8183-om1-1) ...
root@debian:/etc/apt#
...
==> aptitude install -- summary:
==> as root user at the eh debian command line shell:
...
VVV aptitude install omc
vvv aptitude install omc-common (automatic -- dependency)
VVV aptitude install omshell-terminal
vvv aptitude install libomc (automatic -- dependency)
vvv aptitude install libomcsimulation (automatic -- dependency)
XXX aptitude install libomccpp (not automatic -- not needed ???)
VVV aptitude install omlib-modelica-3.2.1 (??? does this integrate with the omc??? -- yes !!!)
XXX aptitude install omc-doc
...
* * *
==> try loadModel(Modelica):
Code:
...
omc@debian:~$ OMShell-terminal -noserv
Skip starting server, assumed to be running
OMShell Copyright 1997-2015, Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
To get help on using OMShell and OpenModelica, type "help()" and press enter
>>> loadModule(Modelica)
>>> getErrorString()
"[<interactive>:1:1-1:0:writable] Error: Class loadModule not found in scope <global scope> (looking for a function or record).
"
>>>
...
Following the hint from sjoelund.se:
...
Did you try using the Jessie packages on Wheezy?
https://build.openmodelica.org/apt/dist … 4/Packages
says OMC only depends on libc6 >2.2.5.
...
I am trying to install the omc package from an alternate distribution, but with no success. Probably because I am a package newbie.
Below are details of various attempts.
What do I need to do to the </etc/apt/sources.list> file to get aptitude to recognize the alternate repository? e.g.:
==> deb http://build.openmodelica.org/apt wheezy nightly
Any suggestions would be most appreciated.
Thanks
Steve
* * *
* * *
==> The original </etc/apt/sources.list> file was as follows:
Code:
...
root@debian:/# cd /etc/apt
root@debian:/etc/apt# cat sources.list.v00
deb http://ftp.uk.debian.org/debian wheezy main
deb http://security.debian.org wheezy/updates main
deb http://build.openmodelica.org/apt precise nightly
deb-src http://build.openmodelica.org/apt precise nightly
root@debian:/etc/apt#
...
==> With this original </etc/apt/sources.list> file, I get dependency conflicts:
Code:
...
root@debian:/etc/apt# cat sources.list
deb http://ftp.uk.debian.org/debian wheezy main
deb http://security.debian.org wheezy/updates main
deb http://build.openmodelica.org/apt precise nightly
deb-src http://build.openmodelica.org/apt precise nightly
root@debian:/etc/apt# cd /
root@debian:/# aptitude install omc
The following NEW packages will be installed:
omc{b}
The following packages are RECOMMENDED but will NOT be installed:
libsaxonb-java omplot python-beautifulsoup
0 packages upgraded, 1 newly installed, 0 to remove and 48 not upgraded.
Need to get 7156 kB of archives. After unpacking 32.4 MB will be used.
The following packages have unmet dependencies:
omc : Depends: libc6 (>= 2.15) but 2.13-38+deb7u8 is installed.
Depends: libhdf5-serial-1.8.4 which is a virtual package. or
libhdf5-1.8.4 which is a virtual package.
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) omc [Not Installed]
Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.
root@debian:/#
...
* * *
==> I tried various modified versions of the </etc/apt/sources.list> file, putting the alternate repository first:
==> deb http://build.openmodelica.org/apt/dists … ry-amd64/:
==> fails on "Malformed line":
Code:
...
root@debian:/etc/apt# cat sources.list
# sources.list 30 May 2015
deb http://build.openmodelica.org/apt/dists/wheezy/nightly/binary-amd64/
# previous <sources.list> contents follow...
deb http://ftp.uk.debian.org/debian wheezy main
deb http://security.debian.org wheezy/updates main
deb http://build.openmodelica.org/apt precise nightly
deb-src http://build.openmodelica.org/apt precise nightly
root@debian:/etc/apt# cd /
root@debian:/# aptitude install omc
E: Malformed line 2 in source list /etc/apt/sources.list (dist)
E: Malformed line 2 in source list /etc/apt/sources.list (dist)
E: The list of sources could not be read.
E: Malformed line 2 in source list /etc/apt/sources.list (dist)
E: The list of sources could not be read.
root@debian:/#
...
==> deb http://build.openmodelica.org/apt/dists/wheezy/nightly/
==> fails on "Malformed line":
Code:
...
root@debian:/etc/apt# cat sources.list
# sources.list 30 May 2015
deb http://build.openmodelica.org/apt/dists/wheezy/nightly/
# previous <sources.list> contents follow...
deb http://ftp.uk.debian.org/debian wheezy main
deb http://security.debian.org wheezy/updates main
deb http://build.openmodelica.org/apt precise nightly
deb-src http://build.openmodelica.org/apt precise nightly
root@debian:/etc/apt# cd /
root@debian:/# aptitude install omc
E: Malformed line 2 in source list /etc/apt/sources.list (dist)
E: Malformed line 2 in source list /etc/apt/sources.list (dist)
E: The list of sources could not be read.
E: Malformed line 2 in source list /etc/apt/sources.list (dist)
E: The list of sources could not be read.
root@debian:/#
...
==> deb http://build.openmodelica.org/apt wheezy nightly
==> fails on "unmet dependencies":
Code:
...
root@debian:/etc/apt# cat sources.list
# sources.list 30 May 2015
deb http://build.openmodelica.org/apt wheezy nightly
# previous <sources.list> contents follow...
deb http://ftp.uk.debian.org/debian wheezy main
deb http://security.debian.org wheezy/updates main
deb http://build.openmodelica.org/apt precise nightly
deb-src http://build.openmodelica.org/apt precise nightly
root@debian:/etc/apt# cd /
root@debian:/# aptitude install omc
The following NEW packages will be installed:
omc{b}
The following packages are RECOMMENDED but will NOT be installed:
libsaxonb-java omplot python-beautifulsoup
0 packages upgraded, 1 newly installed, 0 to remove and 48 not upgraded.
Need to get 7156 kB of archives. After unpacking 32.4 MB will be used.
The following packages have unmet dependencies:
omc : Depends: libc6 (>= 2.15) but 2.13-38+deb7u8 is installed.
Depends: libhdf5-serial-1.8.4 which is a virtual package. or
libhdf5-1.8.4 which is a virtual package.
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) omc [Not Installed]
Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.
root@debian:/#
...
==> comment out other openmodelica.org repositories:
==> is not recognizing the alternate repository in the </etc/apt/sources.list> file:
==> deb http://build.openmodelica.org/apt wheezy nightly
Code:
...
root@debian:/etc/apt# cat sources.list
# sources.list 30 May 2015
deb http://build.openmodelica.org/apt wheezy nightly
# previous <sources.list> contents follow...
deb http://ftp.uk.debian.org/debian wheezy main
deb http://security.debian.org wheezy/updates main
#deb http://build.openmodelica.org/apt precise nightly
#deb-src http://build.openmodelica.org/apt precise nightly
root@debian:/etc/apt#
root@debian:/etc/apt# cd /
root@debian:/# aptitude install omc
Couldn't find package "omc". However, the following
packages contain "omc" in their name:
libtomcat7-java tomcat7-common tomcat6-docs tomcat6 tomcat7 tomcat6-user
guacamole-tomcat tomcat7-admin libtomcrypt-dev tomcat7-examples
libtomcat-maven-plugin-java libtomcat6-java tomcat7-docs tomcat7-user
tomcat6-examples libclass-dbi-fromcgi-perl solr-tomcat libtomcatjss-java
libtomcrypt0 tomcat6-common r-cran-domc tomcat6-admin tomcat6-extras
Couldn't find package "omc". However, the following
packages contain "omc" in their name:
libtomcat7-java tomcat7-common tomcat6-docs tomcat6 tomcat7 tomcat6-user
guacamole-tomcat tomcat7-admin libtomcrypt-dev tomcat7-examples
libtomcat-maven-plugin-java libtomcat6-java tomcat7-docs tomcat7-user
tomcat6-examples libclass-dbi-fromcgi-perl solr-tomcat libtomcatjss-java
libtomcrypt0 tomcat6-common r-cran-domc tomcat6-admin tomcat6-extras
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 48 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
root@debian:/#
...
* * *
* * *
Many thanks to sjoelund.se for the two near-instantaneous 22 May 2015 responses to my previous post
* * *
* * *
I tried to install the OpenModelica pre-built Debian packages, but ran into package dependency conflicts:
Code:
...
root@debian:~# aptitude install omc omshell-terminal
The following NEW packages will be installed:
omc{b} omshell-terminal
The following packages are RECOMMENDED but will NOT be installed:
libsaxonb-java omplot python-beautifulsoup
0 packages upgraded, 2 newly installed, 0 to remove and 48 not upgraded.
Need to get 7180 kB of archives. After unpacking 32.5 MB will be used.
The following packages have unmet dependencies:
omc : Depends: libc6 (>= 2.15) but 2.13-38+deb7u8 is installed.
Depends: libhdf5-serial-1.8.4 which is a virtual package. or
libhdf5-1.8.4 which is a virtual package.
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) omc [Not Installed]
2) omshell-terminal [Not Installed]
Accept this solution? [Y/n/q/?]Accept this solution? [Y/n/q/?] y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 48 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
root@debian:~#
...
I did not want to risk breaking something else, by forcing the conflicting package versions (e.g. by using the "fake package" package equivs).
So, I have built from clones of the git repositories: OMCompiler + OMShell (text-mode) on the Debian linux server.
I have also cloned the Modelica Standard Library from the git repository.
The OMCompiler and OMShell-terminal both start ok, and seem to be working
==> start omc:
Code:
...
omc@debian:~/OpenModelica/OMCompiler/build/bin$ ./omc +d=interactive
Opening a socket on port 29500
...
==> start OMShell-terminal
Code:
...
omc@debian:~/OpenModelica/OMShell/build/bin$ ./OMShell-terminal -noserv
Skip starting server, assumed to be running
OMShell Copyright 1997-2015, Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
To get help on using OMShell and OpenModelica, type "help()" and press enter
>>>
>>> help()
"The available topics (help(\"topics\")) are as follows:
omc The command-line options available for omc.
debug Flags that enable debugging, diagnostics, and research prototypes.
optmodules Flags that determine which symbolic methods are used to produce the
causalized equation system.
simulation The command-line options available for simulation executables generated
by OpenModelica.
<flagname> Displays option descriptions for multi-option flag <flagname>.
topics This help-text.
"
>>>
...
But I am stuck at trying to loadModel(Modelica):
Code:
...
>>> loadModel(Modelica)
false
>>> getErrorString()
"Error: Failed to load package Modelica (default) using MODELICAPATH /_omc/OpenModelica/OMCompiler/build/lib/omlibrary:/_omc/.openmodelica/libraries/.
"
>>>
...
Before I mess about with environment variables, or anything else, I thought I should return to the forum to ask for advice.
What do I need to do, to get the Modelica Standard Library properly installed from github, for use with OMCompiler and OMShell-terminal?
Any suggestions would be most appreciated.
Thanks
Steve
* * *
* * *
P.S.
Below are some details of the steps I used to:
==> build an OMCompiler + OMShell (text-mode);
==> fetch the Modelica Standard Library;
==> start omc & mosh;
==> test loading the Modelica Standard Library;
* * *
==> clone OMCompiler and OMShell into /_omc/OpenModelica/:
Code:
...
omc@debian:~/OpenModelica$ git clone --depth 0 https://github.com/OpenModelica/OMCompiler
Cloning into 'OMCompiler'...
remote: Counting objects: 127037, done.
remote: Compressing objects: 100% (358/358), done.
remote: Total 127037 (delta 142), reused 2 (delta 0), pack-reused 126673
Receiving objects: 100% (127037/127037), 46.65 MiB | 9.85 MiB/s, done.
Resolving deltas: 100% (105533/105533), done.
omc@debian:~/OpenModelica$
...
omc@debian:~/OpenModelica$ git clone --depth 0 https://github.com/OpenModelica/OMShell
Cloning into 'OMShell'...
remote: Counting objects: 1428, done.
Receiving objects: 100% (1428/1428), 563.82 KiB, done.
remote: Total 1428 (delta 0), reused 0 (delta 0), pack-reused 1428
Resolving deltas: 100% (842/842), done.
omc@debian:~/OpenModelica$ du -chs .
86M .
86M total
omc@debian:~/OpenModelica$
...
==> fetch the necessary git sub-modules:
Code:
...
omc@debian:~/OpenModelica/OMCompiler$ git submodule update --init 3rdParty
Submodule '3rdParty' (https://github.com/OpenModelica/OMCompiler-3rdParty) registered for path '3rdParty'
Cloning into '3rdParty'...
remote: Counting objects: 4975, done.
remote: Compressing objects: 100% (151/151), done.
remote: Total 4975 (delta 35), reused 0 (delta 0), pack-reused 4818
Receiving objects: 100% (4975/4975), 13.95 MiB | 9.16 MiB/s, done.
Resolving deltas: 100% (2235/2235), done.
Submodule path '3rdParty': checked out 'e92b16ce8844c8d00530f55af5a5050934716333'
omc@debian:~/OpenModelica/OMCompiler$
...
omc@debian:~/OpenModelica/OMCompiler$ git submodule update --init common
Submodule 'common' (https://github.com/OpenModelica/OpenModelica-common) registered for path 'common'
Cloning into 'common'...
remote: Counting objects: 68, done.
remote: Total 68 (delta 0), reused 0 (delta 0), pack-reused 68
Unpacking objects: 100% (68/68), done.
Submodule path 'common': checked out '00c80dcd01a2ad92460b807db98637dcaec683ce'
omc@debian:~/OpenModelica/OMCompiler$
...
omc@debian:~/OpenModelica/OMShell$ git submodule update --init common
Submodule 'common' (https://github.com/OpenModelica/OpenModelica-common.git) registered for path 'common'
Cloning into 'common'...
remote: Counting objects: 68, done.
remote: Total 68 (delta 0), reused 0 (delta 0), pack-reused 68
Unpacking objects: 100% (68/68), done.
Submodule path 'common': checked out 'ec62513e656d2a50bf7e1b5ac8a49ea926d8e41e'
omc@debian:~/OpenModelica/OMShell$
...
* * *
==> build OMCompiler:
==> autoconf:
Code:
...
omc@debian:~/OpenModelica/OMCompiler$ autoconf
omc@debian:~/OpenModelica/OMCompiler$
...
==> configure:
...
Code:
omc@debian:~/OpenModelica/OMCompiler$ ./configure --without-CORBA --without-paradiseo --enable-modelica3d=no --enable-omnotebook=no
configure: WARNING: unrecognized options: --without-CORBA, --without-paradiseo, --enable-modelica3d, --enable-omnotebook
configure: OpenModelica pre-commit hook has been installed
...
configure: creating ./config.status
config.status: creating Makefile
...
config.status: executing config.unix.h.fix commands
configure: WARNING: unrecognized options: --without-CORBA, --without-paradiseo, --enable-modelica3d, --enable-omnotebook
...
Configured OpenModelica successfully using the following options:
Simulations may use sundials suite: Yes
Simulations may use IPOPT: Yes
Simulations may use UMFPACK: Yes
ParModelica: No
omc@debian:~/OpenModelica/OMCompiler$
...
==> make:
Code:
...
omc@debian:~/OpenModelica/OMCompiler$ make -j1 omc > _omc-make.log
loading initial cache file /_omc/OpenModelica/OMCompiler/3rdParty/FMIL/build/ExpatEx/tmp/expatex-cache.cmake
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS
/_omc/OpenModelica/OMCompiler/3rdParty/FMIL/ThirdParty/Expat/expat-2.1.0/lib/xmltok_impl.c:1783:0: warning: ISO C forbids an empty translation unit [-pedantic]
/_omc/OpenModelica/OMCompiler/3rdParty/FMIL/ThirdParty/Expat/expat-2.1.0/lib/xmltok_ns.c:115:0: warning: ISO C forbids an empty translation unit [-pedantic]
/_omc/OpenModelica/OMCompiler/3rdParty/FMIL/ThirdParty/c99_snprintf/c99-snprintf_1.1/snprintf.c: In function 'rpl_vsnprintf':
/_omc/OpenModelica/OMCompiler/3rdParty/FMIL/ThirdParty/c99_snprintf/c99-snprintf_1.1/snprintf.c:537:2: warning: ISO C90 does not support 'long long' [-Wlong-long]
...
In file included from Settings_omc.cpp:41:0:
settingsimpl.c: In function 'char* Settings_getHomeDir(int)':
settingsimpl.c:203:12: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ar: creating libomcruntime.a
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
./configure: line 19707: #include: command not found
...
Warning: Element of assumed-shaped or pointer array passed to array dummy argument 'ptrist' at (1)
MUMPS/src/dmumps_part8.F:1764.32:
& id%MYID_NODES, id%PTLUST_S(1),
...
Warning: Type mismatch in argument 's' at (1); passed INTEGER(4) to REAL(8)
libtool: install: warning: relinking `libipopt.la'
<command-line>:0:6: warning: missing whitespace after the macro name [enabled by default]
<command-line>:0:6: warning: missing whitespace after the macro name [enabled by default]
...
optimization/DataManagement/MoveData.c: In function 'pickUpDim':
optimization/DataManagement/MoveData.c:157:3: warning: passing argument 2 of 'data->callback->getTimeGrid' from incompatible pointer type [enabled by default]
optimization/DataManagement/MoveData.c:157:3: note: expected 'modelica_integer *' but argument is of type 'int *'
build/StateMachineFeatures.c: In function 'closure0_ExpressionDump_dumpExpStr':
build/StateMachineFeatures.c:550:1: warning: return makes pointer from integer without a cast [enabled by default]
/_omc/OpenModelica/OMCompiler/Compiler/boot/build/tmp/StateMachineFeatures.c: In function 'closure0_ExpressionDump_dumpExpStr':
/_omc/OpenModelica/OMCompiler/Compiler/boot/build/tmp/StateMachineFeatures.c:579:3: warning: return makes pointer from integer without a cast [enabled by default]
omc@debian:~/OpenModelica/OMCompiler$
...
==> the omc executable works:
Code:
...
omc@debian:~/OpenModelica/OMCompiler/build/bin$ ./omc --help
OpenModelica Compiler v1.9.3-dev-677-gdff6c83
Copyright © 2014 Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
Usage: omc [Options] (Model.mo | Script.mos) [Libraries | .mo-files]
* Libraries: Fully qualified names of libraries to load before processing Model or Script.
The libraries should be separated by spaces: Lib1 Lib2 ... LibN.
...
* * *
==> build OMShell:
==> autoconf:
Code:
...
omc@debian:~/OpenModelica/OMShell$ autoconf
omc@debian:~/OpenModelica/OMShell$
...
==> configure:
Code:
...
omc@debian:~/OpenModelica/OMShell$ ./configure --prefix=/_omc/OpenModelica/OMCompiler/build CXX=clang++
configure: OpenModelica pre-commit hook has been installed
...
configure: creating ./config.status
config.status: creating Makefile
...
config.status: creating OMShell/OMShellGUI/omc_config.h
omc@debian:~/OpenModelica/OMShell$
...
==> make:
Code:
...omc@debian:~/OpenModelica/OMShell$ make mosh
mkdir -p /_omc/OpenModelica/OMShell/build/bin /_omc/OpenModelica/OMShell/build/lib/x86_64-linux-gnu/omc
make -C mosh/src
make[1]: Entering directory `/_omc/OpenModelica/OMShell/mosh/src'
/usr/bin/omniidl -bcxx -Wbh=.h -Wbs=.cc /_omc/OpenModelica/OMCompiler/build/share/omc/omc_communication.idl
clang++ -g -O2 -Wall -DUSE_CORBA -DUSE_OMNIORB -c -o mosh.o mosh.cpp
clang++ -g -O2 -Wall -DUSE_CORBA -DUSE_OMNIORB -c -o options.o options.cpp
clang++ -g -O2 -Wall -DUSE_CORBA -DUSE_OMNIORB -c -o omc_communication.o omc_communication.cc
omc_communication.cc:13:20: warning: unused variable '_0RL_library_version'
[-Wunused-variable]
static const char* _0RL_library_version = omniORB_4_1;
^
1 warning generated.
clang++ -o OMShell-terminal mosh.o options.o omc_communication.o -lreadline -lncurses -lomniORB4 -lomnithread -lpthread -lm -lpthread
cp OMShell-terminal /_omc/OpenModelica/OMShell/build/bin
make[1]: Leaving directory `/_omc/OpenModelica/OMShell/mosh/src'
omc@debian:~/OpenModelica/OMShell$
...
* * *
==> start omc & OMShell-terminal in different linux logins:
==> start omc:
...
Code:
omc@debian:~/OpenModelica/OMCompiler/build/bin$ ./omc +d=interactive
Opening a socket on port 29500
...
==> start OMShell-terminal
Code:
...
omc@debian:~/OpenModelica/OMShell/build/bin$ ./OMShell-terminal -noserv
Skip starting server, assumed to be running
OMShell Copyright 1997-2015, Open Source Modelica Consortium (OSMC)
Distributed under OMSC-PL and GPL, see www.openmodelica.org
To get help on using OMShell and OpenModelica, type "help()" and press enter
>>>
>>> help()
"The available topics (help(\"topics\")) are as follows:
omc The command-line options available for omc.
debug Flags that enable debugging, diagnostics, and research prototypes.
optmodules Flags that determine which symbolic methods are used to produce the
causalized equation system.
simulation The command-line options available for simulation executables generated
by OpenModelica.
<flagname> Displays option descriptions for multi-option flag <flagname>.
topics This help-text.
"
>>>
...
* * *
* * *
==> git clone the Modelica Standard Library:
Code:
...
omc@debian:~/modelica.org/Modelica-3.2.1$ git clone --depth 0 https://github.com/modelica/Modelica
Cloning into 'Modelica'...
remote: Counting objects: 52937, done.
Receiving objects: 100% (52937/52937), 113.40 MiB | 13.50 MiB/s, done.
remote: Total 52937 (delta 0), reused 0 (delta 0), pack-reused 52937
Resolving deltas: 100% (28978/28978), done.
omc@debian:~/modelica.org/Modelica-3.2.1$
...
omc@debian:~/modelica.org/Modelica-3.2.1/Modelica/Modelica 3.2.1$ ls --group-directories-first -al
total 844
drwxr-xr-x 12 omc omc 4096 May 28 09:20 .
drwxr-xr-x 6 omc omc 4096 May 28 09:20 ..
drwxr-xr-x 2 omc omc 4096 May 28 09:20 Blocks
drwxr-xr-x 4 omc omc 4096 May 28 09:20 Electrical
drwxr-xr-x 3 omc omc 4096 May 28 09:20 Fluid
drwxr-xr-x 2 omc omc 4096 May 28 09:20 Magnetic
drwxr-xr-x 2 omc omc 4096 May 28 09:20 Math
drwxr-xr-x 3 omc omc 4096 May 28 09:20 Mechanics
drwxr-xr-x 5 omc omc 4096 May 28 09:20 Media
drwxr-xr-x 9 omc omc 4096 May 28 09:20 Resources
drwxr-xr-x 2 omc omc 4096 May 28 09:20 Thermal
drwxr-xr-x 2 omc omc 4096 May 28 09:20 Utilities
-rw-r--r-- 1 omc omc 89940 May 28 09:20 ComplexBlocks.mo
-rw-r--r-- 1 omc omc 22458 May 28 09:20 ComplexMath.mo
-rw-r--r-- 1 omc omc 5980 May 28 09:20 Constants.mo
-rw-r--r-- 1 omc omc 41183 May 28 09:20 Icons.mo
-rw-r--r-- 1 omc omc 93731 May 28 09:20 SIunits.mo
-rw-r--r-- 1 omc omc 141090 May 28 09:20 StateGraph.mo
-rw-r--r-- 1 omc omc 381203 May 28 09:20 package.mo
-rw-r--r-- 1 omc omc 144 May 28 09:20 package.order
-rw-r--r-- 1 omc omc 1105 May 28 09:20 readme.txt
omc@debian:~/modelica.org/Modelica-3.2.1/Modelica/Modelica 3.2.1$
...
==> try to loadModel(Modelica):
Code:
...
>>> loadModel(Modelica)
false
>>> getErrorString()
"Error: Failed to load package Modelica (default) using MODELICAPATH /_omc/OpenModelica/OMCompiler/build/lib/omlibrary:/_omc/.openmodelica/libraries/.
"
>>>
...
==> I tried various other ways at OMShell-terminal to loadModel(Modelica) but none worked;
* * *
* * *
I'm trying to build (on Debian Linux) a minimal OMC that requires no GUI support, and can be used from a text-mode console via SSH over a slow Internet connection.
* * *
* * *
Here is a directory listing of the base OpenModelica directory I have set up:
Code:
omc@debian:~/OpenModelica$ ls --group-directories-first -al
total 984
drwxr-xr-x 22 omc omc 4096 May 22 19:17 .
drwxr-xr-x 5 omc omc 4096 May 22 16:50 ..
drwxr-xr-x 2 omc omc 4096 May 20 09:23 .externalToolBuilders
drwxr-xr-x 2 omc omc 4096 May 20 09:23 .settings
drwxr-xr-x 3 omc omc 4096 May 22 15:17 3rdParty
drwxr-xr-x 17 omc omc 4096 May 22 19:17 Compiler
drwxr-xr-x 2 omc omc 4096 May 20 09:24 Examples
drwxr-xr-x 3 omc omc 4096 May 20 09:25 OMEdit
drwxr-xr-x 7 omc omc 4096 May 20 09:25 OMNotebook
drwxr-xr-x 7 omc omc 4096 May 20 09:25 OMOptim
drwxr-xr-x 10 omc omc 4096 May 20 09:25 OMOptimBasis
drwxr-xr-x 3 omc omc 4096 May 20 09:26 OMPlot
drwxr-xr-x 3 omc omc 4096 May 20 09:26 OMShell
drwxr-xr-x 3 omc omc 4096 May 20 09:26 OMVisualize
drwxr-xr-x 2 omc omc 4096 May 22 19:17 Parser
drwxr-xr-x 8 omc omc 4096 May 20 09:26 SimulationRuntime
drwxr-xr-x 2 omc omc 4096 May 22 13:24 autom4te.cache
drwxr-xr-x 3 omc omc 4096 May 22 13:28 build
drwxr-xr-x 18 omc omc 4096 May 20 09:23 doc
drwxr-xr-x 7 omc omc 4096 May 20 09:24 libraries
drwxr-xr-x 4 omc omc 4096 May 20 09:25 mosh
drwxr-xr-x 5 omc omc 4096 May 20 09:26 tools
-rw-r--r-- 1 omc omc 3638 Nov 2 2008 .cdtproject-sample-cdt
-rw-r--r-- 1 omc omc 347 Oct 31 2014 .openmodelica.aspell
-rw-r--r-- 1 omc omc 601 Apr 6 2006 .project-sample
-rw-r--r-- 1 omc omc 3329 Nov 2 2008 .project-sample-cdt
-rw-r--r-- 1 omc omc 2605 Apr 30 2013 .svnprops
-rw-r--r-- 1 omc omc 1586 Apr 30 2013 CMakeLists.txt
-rw-r--r-- 1 omc omc 14931 Dec 5 2013 COPYING
-rwxr-xr-x 1 omc omc 1490 Oct 4 2013 INSTALL.mingw.crosscompile.sh
-rw-r--r-- 1 omc omc 12088 May 22 19:17 Makefile
-rw-r--r-- 1 omc omc 23838 May 3 09:41 Makefile.common
-rw-r--r-- 1 omc omc 11137 May 3 09:24 Makefile.in
-rw-r--r-- 1 omc omc 9955 May 3 09:06 Makefile.libraries
-rw-r--r-- 1 omc omc 22675 Apr 30 10:40 Makefile.omdev.mingw
-rw-r--r-- 1 omc omc 13156 Jun 19 2012 OSMC-License.txt
-rw-r--r-- 1 omc omc 4395 Nov 23 2013 README-BUILD-RELEASE-NSIS.txt
-rw-r--r-- 1 omc omc 8065 Apr 15 2014 README-BUILD-RELEASE.txt
-rw-r--r-- 1 omc omc 8597 Oct 3 2013 README-BUILD-WINDOWS.txt
-rw-r--r-- 1 omc omc 7107 Feb 24 08:33 README-OMDev-MINGW.txt
-rw-r--r-- 1 omc omc 8813 Oct 30 2014 README.Linux.txt
-rwxr-xr-x 1 omc omc 45297 Oct 28 2014 config.guess
-rw-r--r-- 1 omc omc 53468 May 22 19:17 config.log
-rwxr-xr-x 1 omc omc 31221 May 22 19:17 config.status
-rwxr-xr-x 1 omc omc 35564 Oct 28 2014 config.sub
-rwxr-xr-x 1 omc omc 229575 May 22 16:47 configure
-rwxr-xr-x 1 omc omc 245 Apr 30 2013 configure-post.sh
-rw-r--r-- 1 omc omc 30329 May 3 07:43 configure.ac
-rwxr-xr-x 1 omc omc 229410 May 22 16:46 configure.voo
-rw-r--r-- 1 omc omc 2894 Apr 27 14:40 corba.m4
-rwxr-xr-x 1 omc omc 13997 Oct 28 2014 install-sh
-rw-r--r-- 1 omc omc 1018 Apr 30 14:22 qmake.m4
-rwxr-xr-x 1 omc omc 712 Jan 30 2014 svn-clean.py
omc@debian:~/OpenModelica$
The only content I have placed in directory ~/OpenModelica/3rdParty/ is:
~/OpenModelica/3rdParty/antlr/3.2/tool/antlr-3.2.jar
* * *
* * *
The autoconf works and produces a configure file.
However, no matter what options I pass to configure, it seems to require qwt.
Example 1:
Code:
.omc@debian:~/OpenModelica$ ./configure --without-paradiseo --enable-modelica3d=no --enable-omnotebook=no --without-qwt
configure: WARNING: unrecognized options: --without-qwt
...
config.status: creating Parser/Makefile
config.status: error: cannot find input file: `3rdParty/qwt/Makefile.unix.in'
omc@debian:~/OpenModelica$
Example 2:
Code:
omc@debian:~/OpenModelica$ ./configure --without-paradiseo --enable-modelica3d=no --enable-omnotebook=no --disable-omshell-terminal
...
config.status: creating Parser/Makefile
config.status: error: cannot find input file: `3rdParty/qwt/Makefile.unix.in'
omc@debian:~/OpenModelica$
Example 3:
Code:
omc@debian:~/OpenModelica$ ./configure --without-paradiseo --enable-modelica3d=no --enable-omnotebook=no --disable-omshell-terminal --without-omniORB
...
config.status: creating Parser/Makefile
config.status: error: cannot find input file: `3rdParty/qwt/Makefile.unix.in'
omc@debian:~/OpenModelica$
...
Any suggestions would be most appreciated, as to what options I should pass to configure.
Thanks
- Index
- » Users
- » Steve_Petrie
- » Profile