From dbdf0f489db8bf6536d0c3ea7265b06a5bd14b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Fri, 19 Nov 2010 08:59:21 +0000 Subject: [PATCH] - Implemented libmodparomc.a (the stub version of modpar) git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7107 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/TaskGraphExt.mo | 36 +++--- Compiler/modpar/Makefile.in | 8 +- Compiler/modpar/TaskGraphExt_stub_omc.cpp | 130 ++++++++++++++++++++++ 3 files changed, 154 insertions(+), 20 deletions(-) create mode 100644 Compiler/modpar/TaskGraphExt_stub_omc.cpp diff --git a/Compiler/TaskGraphExt.mo b/Compiler/TaskGraphExt.mo index 4de17200bc8..60f25efe51e 100644 --- a/Compiler/TaskGraphExt.mo +++ b/Compiler/TaskGraphExt.mo @@ -42,7 +42,7 @@ public function newTask input String inString; output Integer outInteger; - external "C" ; + external "C" outInteger=TaskGraphExt_newTask(inString) annotation(Library = {"modparomc"}); end newTask; public function addEdge @@ -51,14 +51,14 @@ public function addEdge input String inString3; input Integer inInteger4; - external "C" ; + external "C" TaskGraphExt_addEdge(inInteger1,inInteger2,inString3,inInteger4) annotation(Library = {"modparomc"}); end addEdge; public function getTask input String inString; output Integer outInteger; - external "C" ; + external "C" outInteger=TaskGraphExt_getTask(inString) annotation(Library = {"modparomc"}); end getTask; public function storeResult @@ -67,51 +67,51 @@ public function storeResult input Boolean inBoolean3; input String inString4; - external "C" ; + external "C" TaskGraphExt_storeResult(inString1,inInteger2,inBoolean3,inString4) annotation(Library = {"modparomc"}); end storeResult; public function dumpGraph input String inString; - external "C" ; + external "C" TaskGraphExt_dumpGraph(inString) annotation(Library = {"modparomc"}); end dumpGraph; public function dumpMergedGraph input String inString; - external "C" ; + external "C" TaskGraphExt_dumpMergedGraph(inString) annotation(Library = {"modparomc"}); end dumpMergedGraph; public function registerStartStop input Integer inInteger1; input Integer inInteger2; - external "C" ; + external "C" TaskGraphExt_registerStartStop(inInteger1,inInteger2) annotation(Library = {"modparomc"}); end registerStartStop; public function getStartTask output Integer outInteger; - external "C" ; + external "C" outInteger=TaskGraphExt_getStartTask() annotation(Library = {"modparomc"}); end getStartTask; public function getStopTask output Integer outInteger; - external "C" ; + external "C" outInteger=TaskGraphExt_getStopTask() annotation(Library = {"modparomc"}); end getStopTask; public function mergeTasks input Real inReal1; input Real inReal2; - external "C" ; + external "C" TaskGraphExt_mergeTasks(inReal1,inReal2) annotation(Library = {"modparomc"}); end mergeTasks; public function schedule input Integer inInteger; - external "C" ; + external "C" TaskGraphExt_schedule(inInteger) annotation(Library = {"modparomc"}); end schedule; public function generateCode @@ -119,21 +119,21 @@ public function generateCode input Integer inInteger2; input Integer inInteger3; - external "C" ; + external "C" TaskGraphExt_generateCode(inInteger1,inInteger2,inInteger3) annotation(Library = {"modparomc"}); end generateCode; public function setExecCost input Integer inInteger; input Real inReal; - external "C" ; + external "C" TaskGraphExt_setExecCost(inInteger,inReal) annotation(Library = {"modparomc"}); end setExecCost; public function setTaskType input Integer inInteger1; input Integer inInteger2; - external "C" ; + external "C" TaskGraphExt_setTaskType(inInteger1,inInteger2) annotation(Library = {"modparomc"}); end setTaskType; public function setCommCost @@ -141,7 +141,7 @@ public function setCommCost input Integer inInteger2; input Integer inInteger3; - external "C" ; + external "C" TaskGraphExt_setCommCost(inInteger1,inInteger2,inInteger3) annotation(Library = {"modparomc"}); end setCommCost; public function addInitVar @@ -149,7 +149,7 @@ public function addInitVar input String inString2; input String inString3; - external "C" ; + external "C" TaskGraphExt_addInitVar(inInteger1,inString2,inString3) annotation(Library = {"modparomc"}); end addInitVar; public function addInitState @@ -157,7 +157,7 @@ public function addInitState input String inString2; input String inString3; - external "C" ; + external "C" TaskGraphExt_addInitState(inInteger1,inString2,inString3) annotation(Library = {"modparomc"}); end addInitState; public function addInitParam @@ -165,7 +165,7 @@ public function addInitParam input String inString2; input String inString3; - external "C" ; + external "C" TaskGraphExt_addInitParam(inInteger1,inString2,inString3) annotation(Library = {"modparomc"}); end addInitParam; end TaskGraphExt; diff --git a/Compiler/modpar/Makefile.in b/Compiler/modpar/Makefile.in index 268c23a3812..02c43f226dd 100644 --- a/Compiler/modpar/Makefile.in +++ b/Compiler/modpar/Makefile.in @@ -26,11 +26,15 @@ OBJECTS = Codegen.o \ else OBJECTS = TaskGraphExt_stub.o endif -all: libmodpar.a +all: libmodpar.a libmodparomc.a libmodpar.a: $(OBJECTS) ar -sr $@ $(OBJECTS) +libmodparomc.a: TaskGraphExt_stub_omc.o + ar -sr $@ $< + cp $@ $(builddir_lib)/omc + INCFLAGS =-I$(RMLINCLUDE) -I$(BOOST_HOME) -I$(top_builddir)/mosh/src CFLAGS = $(INCFLAGS) -g -Wall -DUNIX=1 @@ -56,4 +60,4 @@ reallyclean: clean .PRECIOUS: Makefile Makefile: Makefile.in - $(top_builddir)/config.status Makefile + (cd $(top_builddir); ./config.status) diff --git a/Compiler/modpar/TaskGraphExt_stub_omc.cpp b/Compiler/modpar/TaskGraphExt_stub_omc.cpp new file mode 100644 index 00000000000..3e1482e5285 --- /dev/null +++ b/Compiler/modpar/TaskGraphExt_stub_omc.cpp @@ -0,0 +1,130 @@ +#include +#include +#include +#include +#include +#include + + +using namespace std; + + +extern "C" +{ +#include + +static void errormsg() +{ +cerr << "MODPAR disabled. Configure with --with-BOOST=boostdir and --with-MODPAR and recompile for enabling." << endl; +} + +extern int TaskGraphExt_newTask(const char* _inString) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_addEdge(int _inInteger1, int _inInteger2, const char* _inString3, int _inInteger4) + +{ + errormsg(); + throw 1; +} + +extern int TaskGraphExt_getTask(const char* _inString) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_storeResult(const char* _inString1, int _inInteger2, int _inBoolean3, const char* _inString4) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_dumpGraph(const char* _inString) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_dumpMergedGraph(const char* _inString) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_registerStartStop(int _inInteger1, int _inInteger2) +{ + errormsg(); + throw 1; +} + +extern int TaskGraphExt__getStartTask() +{ + errormsg(); + throw 1; +} + +extern int TaskGraphExt__getStopTask() +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_mergeTasks(double _inReal1, double _inReal2) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_setExecCost(int _inInteger, double _inReal) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_setCommCost(int _inInteger, double _inReal) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_schedule(int _inInteger) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_generateCode(int _inInteger1, int _inInteger2, int _inInteger3) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_addInitState(int _inInteger1, const char* _inString2, const char* _inString3) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_addInitParam(int _inInteger1, const char* _inString2, const char* _inString3) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_addInitVar(int _inInteger1, const char* _inString2, const char* _inString3) +{ + errormsg(); + throw 1; +} + +extern void TaskGraphExt_setTaskType(int _inInteger1, int _inInteger2) +{ + errormsg(); + throw 1; +} + +} // extern "C"