Skip to content

Commit

Permalink
Changed MOSHHOME to OPENMODELICAHOME which shuld point to what ${MOSH…
Browse files Browse the repository at this point in the history
…HOME}/.. used to be.

Also deleted some more (hopefully all) of the tornado stuff
Deleted the old modsim module.
Fixed Ctrl-C and Ctrl-V in WinMosh.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1711 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Håkan Lundvall committed Apr 21, 2005
1 parent f6dd723 commit debf121
Show file tree
Hide file tree
Showing 22 changed files with 350 additions and 1,831 deletions.
6 changes: 3 additions & 3 deletions README
Expand Up @@ -28,9 +28,9 @@ You need:
How to run
==========
To be able to use mosh (osm) you must
set the MOSHHOME environment variable
to point to the mosh directory e.g
setenv MOSHHOME ~/cvs/modelica/mosh
set the OPENMODELICAHOME environment variable
to point to the root directory of osm e.g
setenv OPENMODELICAHOME ~/cvs/modelica

For linking of external functions, use the environment variable MODELICAUSERCFLAGS, e.g.
setenv MODELICAUSERCFLAGS "~/src/myfunctions.o -L/usr/local/lib/ -llapack_CYGWIN -lg2c"
Expand Down
6 changes: 3 additions & 3 deletions c_runtime/build_mingw_libs.bat
@@ -1,11 +1,11 @@
@echo off

rem Use this script to build MinGW versions of the runtime libs
rem MOSHHOME must be set in order to find the mingw compilers which
rem are assumed to be in #MOSHHOME%\..\MinGW\bin
rem OPENMODELICAHOME must be set in order to find the mingw compilers which
rem are assumed to be in %OPENMODELICAHOME%\MinGW\bin

set OLDPATH=%PATH%
pushd "%MOSHHOME%\..\MinGW\bin"
pushd "%OPENMODELICAHOME%\MinGW\bin"
set PATH=%CD%
popd
del ..\mosh\src\options.o *.o *.a
Expand Down
10 changes: 3 additions & 7 deletions modeq/.depend
@@ -1,8 +1,7 @@
absyn.o: absyn.rml debug.sig dump.sig util.sig print.sig
abb_come.o: abb_come.rml daelow.sig exp.sig
algorithm.o: algorithm.rml exp.sig types.sig explode.sig util.sig print.sig dump.sig debug.sig
builtin.o: builtin.rml absyn.sig explode.sig env.sig types.sig classinf.sig debug.sig print.sig
ceval.o: ceval.rml env.sig exp.sig interactive.sig values.sig daelow.sig simcodegen.sig staticexp.sig print.sig types.sig modutil.sig system.sig absyn.sig explode.sig inst.sig lookup.sig dump.sig dae.sig debug.sig util.sig modsim.sig classinf.sig rtopts.sig parse.sig prefix.sig codegen.sig classloader.sig derive.sig
ceval.o: ceval.rml env.sig exp.sig interactive.sig values.sig daelow.sig simcodegen.sig staticexp.sig print.sig types.sig modutil.sig system.sig absyn.sig explode.sig inst.sig lookup.sig dump.sig dae.sig debug.sig util.sig classinf.sig rtopts.sig parse.sig prefix.sig codegen.sig classloader.sig derive.sig
classinf.o: classinf.rml explode.sig print.sig absyn.sig
classloader.o: classloader.rml absyn.sig system.sig lookup.sig interactive.sig util.sig parse.sig print.sig env.sig dump.sig
codegen.o: codegen.rml dae.sig print.sig dump.sig debug.sig absyn.sig algorithm.sig classinf.sig exp.sig modutil.sig types.sig util.sig inst.sig
Expand All @@ -20,17 +19,14 @@ graphviz.o: graphviz.rml
inst.o: inst.rml classinf.sig connect.sig dae.sig env.sig exp.sig explode.sig mod.sig prefix.sig types.sig absyn.sig debug.sig interactive.sig util.sig algorithm.sig builtin.sig dump.sig lookup.sig modutil.sig rtopts.sig staticexp.sig values.sig print.sig system.sig ceval.sig
interactive.o: interactive.rml absyn.sig explode.sig dae.sig types.sig values.sig env.sig dump.sig debug.sig rtopts.sig util.sig parse.sig prefix.sig mod.sig lookup.sig classinf.sig exp.sig inst.sig staticexp.sig modutil.sig codegen.sig print.sig system.sig classloader.sig ceval.sig
lookup.o: lookup.rml classinf.sig types.sig absyn.sig exp.sig env.sig explode.sig parse.sig debug.sig dump.sig inst.sig mod.sig prefix.sig print.sig builtin.sig util.sig modutil.sig staticexp.sig
main.o: main.rml absyn.sig modutil.sig parse.sig dump.sig dumpgraphviz.sig explode.sig dae.sig daelow.sig inst.sig interactive.sig rtopts.sig debug.sig codegen.sig socket.sig print.sig corba.sig system.sig util.sig taskgraph.sig taskgraphext.sig tornado.sig simcodegen.sig
main.o: main.rml absyn.sig modutil.sig parse.sig dump.sig dumpgraphviz.sig explode.sig dae.sig daelow.sig inst.sig interactive.sig rtopts.sig debug.sig codegen.sig socket.sig print.sig corba.sig system.sig util.sig taskgraph.sig taskgraphext.sig simcodegen.sig
mod.o: mod.rml absyn.sig env.sig exp.sig prefix.sig explode.sig types.sig dump.sig debug.sig print.sig inst.sig staticexp.sig values.sig util.sig
modsim.o: modsim.rml system.sig util.sig
modutil.o: modutil.rml absyn.sig dae.sig exp.sig rtopts.sig util.sig print.sig
prefix.o: prefix.rml absyn.sig exp.sig env.sig lookup.sig util.sig print.sig
staticexp.o: staticexp.rml absyn.sig exp.sig explode.sig types.sig env.sig values.sig interactive.sig classinf.sig dump.sig print.sig system.sig lookup.sig debug.sig inst.sig codegen.sig modutil.sig dae.sig util.sig rtopts.sig parse.sig classloader.sig mod.sig prefix.sig ceval.sig
simcodegen.o: simcodegen.rml dae.sig daelow.sig absyn.sig exp.sig util.sig rtopts.sig debug.sig system.sig values.sig codegen.sig print.sig modutil.sig
types.o: types.rml classinf.sig absyn.sig exp.sig values.sig explode.sig dump.sig debug.sig print.sig util.sig staticexp.sig
taskgraph.o: taskgraph.rml exp.sig daelow.sig taskgraphext.sig util.sig absyn.sig dae.sig ceval.sig values.sig print.sig vartransform.sig
tornado.o: tornado.rml dae.sig absyn.sig interactive.sig util.sig system.sig daelow.sig exp.sig debug.sig rtopts.sig inst.sig values.sig tornadoext.sig explode.sig lookup.sig env.sig simcodegen.sig dump.sig tornadocodegen.sig
tornadocodegen.o: tornadocodegen.rml dae.sig absyn.sig daelow.sig exp.sig interactive.sig util.sig system.sig debug.sig rtopts.sig inst.sig values.sig tornadoext.sig tornado.sig explode.sig lookup.sig env.sig simcodegen.sig dump.sig
taskgraph.o: taskgraph.rml exp.sig daelow.sig taskgraphext.sig util.sig absyn.sig dae.sig ceval.sig values.sig print.sig
util.o: util.rml
values.o: values.rml exp.sig absyn.sig print.sig system.sig util.sig dump.sig
vartransform.o: vartransform.rml exp.sig daelow.sig system.sig util.sig algorithm.sig
1 change: 0 additions & 1 deletion modeq/Makefile.common
Expand Up @@ -46,7 +46,6 @@ SRCRML= absyn.rml \
lookup.rml \
main.rml \
mod.rml \
modsim.rml \
modutil.rml \
prefix.rml \
staticexp.rml \
Expand Down
5 changes: 1 addition & 4 deletions modeq/Makefile.common.w32
Expand Up @@ -21,19 +21,16 @@ SRCRML= absyn.rml \
lookup.rml \
main.rml \
mod.rml \
modsim.rml \
modutil.rml \
prefix.rml \
staticexp.rml \
simcodegen.rml \
types.rml \
taskgraph.rml \
tornado.rml \
tornadocodegen.rml \
util.rml \
values.rml \
vartransform.rml

ALLRML = $(SRCRML) daeext.rml print.rml rtopts.rml system.rml parse.rml \
taskgraphext.rml corba.rml socket.rml tornadoext.rml
taskgraphext.rml corba.rml socket.rml

15 changes: 7 additions & 8 deletions modeq/Makefile.w32
Expand Up @@ -5,7 +5,7 @@
!INCLUDE Makefile.common.w32

RML=$(RMLHOME)bin\run.x86-win32.exe @SMLquiet @SMLload=$(RMLHOME)bin\rml.x86-win32
CFLAGS= /Od /I "./VC7/rmlRuntime/runtime/plain" /Fd"./VC7/Release/vc70.pdb" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /EHsc /MT /GS /W3 /nologo /c /Wp64 /Zi /TC /wd4311 /wd4312
CFLAGS= /O2 /I "./VC7/rmlRuntime/runtime/plain" /Zi /Fd"./VC7/Release/vc70.pdb" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /EHsc /MT /GS /W3 /nologo /c /Wp64 /TC /wd4311 /wd4312

SRCC= $(SRCRML:.rml=.c)
SRCH= $(SRCRML:.rml=.h)
Expand Down Expand Up @@ -33,17 +33,18 @@ clean:
del /Q /F $(OBJS) $(SRCC) $(SRCH) $(SIGS) VC7\Release\main.obj VC7\Release\modeqrml.lib



absyn.obj: absyn.rml debug.sig dump.sig util.sig print.sig
algorithm.obj: algorithm.rml exp.sig types.sig explode.sig util.sig print.sig dump.sig debug.sig
builtin.obj: builtin.rml absyn.sig explode.sig env.sig types.sig classinf.sig debug.sig print.sig
ceval.obj: ceval.rml env.sig exp.sig interactive.sig values.sig daelow.sig simcodegen.sig staticexp.sig print.sig types.sig modutil.sig system.sig absyn.sig explode.sig inst.sig lookup.sig dump.sig dae.sig debug.sig util.sig modsim.sig classinf.sig rtopts.sig parse.sig prefix.sig codegen.sig classloader.sig
ceval.obj: ceval.rml env.sig exp.sig interactive.sig values.sig daelow.sig simcodegen.sig staticexp.sig print.sig types.sig modutil.sig system.sig absyn.sig explode.sig inst.sig lookup.sig dump.sig dae.sig debug.sig util.sig classinf.sig rtopts.sig parse.sig prefix.sig codegen.sig classloader.sig derive.sig
classinf.obj: classinf.rml explode.sig print.sig absyn.sig
classloader.obj: classloader.rml absyn.sig system.sig lookup.sig interactive.sig util.sig parse.sig print.sig env.sig dump.sig
codegen.obj: codegen.rml dae.sig print.sig dump.sig debug.sig absyn.sig algorithm.sig classinf.sig exp.sig modutil.sig types.sig util.sig inst.sig
connect.obj: connect.rml exp.sig staticexp.sig dae.sig env.sig dump.sig print.sig util.sig debug.sig
dae.obj: dae.rml absyn.sig exp.sig algorithm.sig types.sig values.sig rtopts.sig graphviz.sig dump.sig print.sig util.sig ceval.sig modutil.sig debug.sig
daelow.obj: daelow.rml dae.sig exp.sig values.sig absyn.sig algorithm.sig util.sig daeext.sig print.sig derive.sig debug.sig env.sig builtin.sig ceval.sig types.sig explode.sig dump.sig system.sig vartransform.sig rtopts.sig
derive.obj: derive.rml daelow.sig exp.sig absyn.sig util.sig print.sig
derive.obj: derive.rml daelow.sig exp.sig absyn.sig util.sig print.sig graphviz.sig
debug.obj: debug.rml rtopts.sig print.sig
dump.obj: dump.rml absyn.sig interactive.sig classinf.sig rtopts.sig print.sig util.sig debug.sig
dumpgraphviz.obj: dumpgraphviz.rml absyn.sig debug.sig graphviz.sig classinf.sig dump.sig
Expand All @@ -54,17 +55,15 @@ graphviz.obj: graphviz.rml
inst.obj: inst.rml classinf.sig connect.sig dae.sig env.sig exp.sig explode.sig mod.sig prefix.sig types.sig absyn.sig debug.sig interactive.sig util.sig algorithm.sig builtin.sig dump.sig lookup.sig modutil.sig rtopts.sig staticexp.sig values.sig print.sig system.sig ceval.sig
interactive.obj: interactive.rml absyn.sig explode.sig dae.sig types.sig values.sig env.sig dump.sig debug.sig rtopts.sig util.sig parse.sig prefix.sig mod.sig lookup.sig classinf.sig exp.sig inst.sig staticexp.sig modutil.sig codegen.sig print.sig system.sig classloader.sig ceval.sig
lookup.obj: lookup.rml classinf.sig types.sig absyn.sig exp.sig env.sig explode.sig parse.sig debug.sig dump.sig inst.sig mod.sig prefix.sig print.sig builtin.sig util.sig modutil.sig staticexp.sig
main.obj: main.rml absyn.sig modutil.sig parse.sig dump.sig dumpgraphviz.sig explode.sig dae.sig daelow.sig inst.sig interactive.sig rtopts.sig debug.sig codegen.sig socket.sig print.sig corba.sig system.sig util.sig taskgraph.sig taskgraphext.sig tornado.sig simcodegen.sig
main.obj: main.rml absyn.sig modutil.sig parse.sig dump.sig dumpgraphviz.sig explode.sig dae.sig daelow.sig inst.sig interactive.sig rtopts.sig debug.sig codegen.sig socket.sig print.sig corba.sig system.sig util.sig taskgraph.sig taskgraphext.sig simcodegen.sig
mod.obj: mod.rml absyn.sig env.sig exp.sig prefix.sig explode.sig types.sig dump.sig debug.sig print.sig inst.sig staticexp.sig values.sig util.sig
modsim.obj: modsim.rml system.sig util.sig
modutil.obj: modutil.rml absyn.sig dae.sig exp.sig rtopts.sig util.sig print.sig
prefix.obj: prefix.rml absyn.sig exp.sig env.sig lookup.sig util.sig print.sig
staticexp.obj: staticexp.rml absyn.sig exp.sig explode.sig types.sig env.sig values.sig interactive.sig classinf.sig dump.sig print.sig system.sig lookup.sig debug.sig inst.sig codegen.sig modutil.sig dae.sig util.sig rtopts.sig parse.sig classloader.sig mod.sig prefix.sig ceval.sig
simcodegen.obj: simcodegen.rml dae.sig daelow.sig absyn.sig exp.sig util.sig rtopts.sig debug.sig system.sig values.sig codegen.sig print.sig modutil.sig
types.obj: types.rml classinf.sig absyn.sig exp.sig values.sig explode.sig dump.sig debug.sig print.sig util.sig
types.obj: types.rml classinf.sig absyn.sig exp.sig values.sig explode.sig dump.sig debug.sig print.sig util.sig staticexp.sig
taskgraph.obj: taskgraph.rml exp.sig daelow.sig taskgraphext.sig util.sig absyn.sig dae.sig ceval.sig values.sig print.sig
tornado.obj: tornado.rml dae.sig absyn.sig interactive.sig util.sig system.sig daelow.sig exp.sig debug.sig rtopts.sig inst.sig values.sig tornadoext.sig explode.sig lookup.sig env.sig simcodegen.sig dump.sig tornadocodegen.sig
tornadocodegen.obj: tornadocodegen.rml dae.sig absyn.sig daelow.sig exp.sig interactive.sig util.sig system.sig debug.sig rtopts.sig inst.sig values.sig tornadoext.sig tornado.sig explode.sig lookup.sig env.sig simcodegen.sig dump.sig
util.obj: util.rml
values.obj: values.rml exp.sig absyn.sig print.sig system.sig util.sig dump.sig
vartransform.obj: vartransform.rml exp.sig daelow.sig system.sig util.sig algorithm.sig

60 changes: 11 additions & 49 deletions modeq/ceval.rml
Expand Up @@ -164,7 +164,6 @@ with "dump.rml"
with "dae.rml"
with "debug.rml"
with "util.rml"
with "modsim.rml"
with "classinf.rml"
with "rtopts.rml"
with "parse.rml"
Expand Down Expand Up @@ -1058,43 +1057,6 @@ end
-------------------
ceval_interactive_functions (env, Exp.CALL(Absyn.IDENT("list"),[Exp.CREF(cr,_)],_,_),st as Interactive.SYMBOLTABLE(p,sp,ic,iv,cf)) => (Values.STRING(str),st)


rule Static.component_ref_to_path(cr) => path &
SCode.elaborate(p) => p' &
Inst.instantiate_class(p',path) => (dae as DAE.DAE(dael),env) &
Interactive.add_instantiated_class(ic,Interactive.INSTCLASS(path,dael,env)) => ic' &
DAE.dump_str (dae) => str &


(* get rid of f in fclass so that old modsimpack works.
Get rid of this when modsimpack understands fclass. *)
string_list(str) => charlist &
list_delete(charlist, 0) => charlist' &
list_string(charlist') => str' &

Debug.fcall ("daedump", DAE.dump, dae) &
Debug.fcall ("daedump2", DAE.dump2, dae) &
Debug.fcall ("daedumpdebug", DAE.dump_debug, dae) &
Debug.fcall ("daedumpgraphv", DAE.dump_graphviz, dae) &

Print.get_string() => s2 &
print s2 &
Print.print_error_buf s2 &
Exp.cref_modelica_str(cr) => modelname &
string_append(modelname,".mof") => filename &
System.pwd => pwd &
System.path_delimiter => pd &
Util.string_append_list([pwd,pd,filename]) => filename' &
System.write_file(filename',str') &
print "wrote flat file: " &
print str & print "\n" &
ModSim.compile_flat_class(filename',modelname) => exefile &

let record = Values.RECORD(Absyn.IDENT("SimulationResult"),[Values.STRING(str),Values.STRING(exefile)],["flatClass","exefile"])
-------------------------
ceval_interactive_functions (env, Exp.CALL(Absyn.IDENT("translateModel"),[Exp.CREF(cr,_)],_,_),st as Interactive.SYMBOLTABLE(p,sp,ic,iv,cf))
=> (record,Interactive.SYMBOLTABLE(p,sp,ic',iv,cf))

rule Static.component_ref_to_path(cr) => path &
SCode.elaborate(p) => p' &
Inst.instantiate_class(p',path) => (dae as DAE.DAE(dael),env) &
Expand All @@ -1108,7 +1070,7 @@ end
ceval_interactive_functions (env, Exp.CALL(Absyn.IDENT("jacobian"),[Exp.CREF(cr,_)],_,_),st as Interactive.SYMBOLTABLE(p,sp,ic,iv,cf))
=> (Values.STRING(res),Interactive.SYMBOLTABLE(p,sp,ic',iv,cf))

rule System.read_env("MOSHHOME") => moshhome &
rule System.read_env("OPENMODELICAHOME") => omhome &
Static.component_ref_to_path(cr) => path &
Absyn.path_string path => pathstr &
Print.print_error_buf "#Failed to instantiate " &
Expand All @@ -1119,7 +1081,7 @@ end

axiom
ceval_interactive_functions (env, Exp.CALL(Absyn.IDENT("translateModel"),[Exp.CREF(cr,_)],_,_),st as Interactive.SYMBOLTABLE(p,sp,ic,iv,cf))
=> (Values.STRING("The environment variable MOSHHOME was not set"),st)
=> (Values.STRING("The environment variable OPENMODELICAHOME was not set"),st)


(* FIXME: Should ceval be called with impl=true here? *)
Expand Down Expand Up @@ -1158,8 +1120,8 @@ end
(* Util.string_append_list(["make -f ",cname_str, ".makefile\n"]) => s_call &
*)
System.path_delimiter => pd &
System.read_env("MOSHHOME") => moshhome &
Util.string_append_list([moshhome, pd, "..", pd, "modeq", pd, "scripts", pd, "Compile ", makefilename]) => s_call &
System.read_env("OPENMODELICAHOME") => omhome &
Util.string_append_list([omhome, pd, "modeq", pd, "scripts", pd, "Compile ", makefilename]) => s_call &

System.system_call(s_call) => 0 &
Util.string_append_list([".", pd, cname_str]) => sim_call &
Expand All @@ -1183,8 +1145,8 @@ end
=> (simValue,newst)

rule
(* simulation fail for som other reason than MOSHOME not being set.*)
System.read_env("MOSHHOME") => moshhome &
(* simulation fail for som other reason than OPENMODELICAHOME not being set.*)
System.read_env("OPENMODELICAHOME") => omhome &
Print.get_error_string() => str &
Util.string_append_list(["Simulation failed.\n",str,"\n"]) => res &
let simValue = Values.RECORD(Absyn.IDENT("SimulationResult"),[Values.STRING(res)],["resultFile"])
Expand All @@ -1193,7 +1155,7 @@ end
=> (simValue,st)

rule
let simValue = Values.RECORD(Absyn.IDENT("SimulationResult"),[Values.STRING("Simulation Failed. Environment variable MOSHHOME not set.")],["resultFile"])
let simValue = Values.RECORD(Absyn.IDENT("SimulationResult"),[Values.STRING("Simulation Failed. Environment variable OPENMODELICAHOME not set.")],["resultFile"])
------------------------------------------------------------------
ceval_interactive_functions (env, Exp.CALL(Absyn.IDENT("simulate"),[Exp.CREF(cr,_),starttime,stoptime,interval],_,_),st as Interactive.SYMBOLTABLE(p,sp,ic,iv,cf))
=> (simValue,st)
Expand Down Expand Up @@ -1240,9 +1202,9 @@ end
=> (Values.RECORD(_,[Values.STRING(filename)],_),_) &
System.read_ptolemyplot_dataset(filename,vars'',0) => value &
System.pwd() => pwd &
System.read_env("MOSHHOME") => moshhome &
System.read_env("OPENMODELICAHOME") => omhome &
System.path_delimiter => pd &
Util.string_append_list([moshhome,pd,"..",pd,"modeq",pd,"scripts",pd,"doPlot"]) => plotCmd &
Util.string_append_list([omhome,pd,"modeq",pd,"scripts",pd,"doPlot"]) => plotCmd &
Util.string_append_list([pwd,pd,"tmpPlot.plt"]) => tmpPlotFile &
Values.write_ptolemyplot_dataset(tmpPlotFile,value,vars'',"Plot by OpenModelica")
=> res &
Expand Down Expand Up @@ -1403,9 +1365,9 @@ end
ceval_interactive_functions (env, Exp.CALL(Absyn.IDENT("saveModel"),[Exp.SCONST(name),Exp.CREF(cr,_)],_,_),st as Interactive.SYMBOLTABLE(p,sp,ic,iv,cf))
=> (Values.BOOL(false),st)

rule System.read_env("MOSHHOME") => moshhome &
rule System.read_env("OPENMODELICAHOME") => omhome &
System.path_delimiter => pd &
Util.string_append_list([moshhome,pd,"..",pd,"modeq",pd,"helptext.txt"]) => filename &
Util.string_append_list([omhome,pd,"modeq",pd,"helptext.txt"]) => filename &
print filename &
System.read_file(filename) => str
--------------------------
Expand Down
6 changes: 3 additions & 3 deletions modeq/doc/manual.tex
Expand Up @@ -44,9 +44,9 @@ \chapter{Introduction}
\item{{\tt MODELICAPATH}} - has to be set to a directory containg Modelica
models according to the specification, e.g. \\ {\tt export
MODELICAPATH=<instdir>/ModelicaLibrary/ }
\item{{\tt MOSHHOME}} - has to be set to the mosh directory in the
installation directory, e.g. {\tt export
MODELICAPATH=<instdir>/mosh/ }
\item{{\tt OPENMODELICAHOME}} - has to be set to the root directory of the
installation, e.g. {\tt export
OPENMODELICAHOME=<instdir> }
\item{{\tt MODELICAUSERCFLAGS}} - can be set to additional libraries
that should be linked when complining external functions, e.g. \\
{\tt export MODELICAUSERCFLAGS="<instdir>/modeq/lib/blas\_cygwin.a \\
Expand Down

0 comments on commit debf121

Please sign in to comment.