(keeping on-list, might be interesting for others, too) Here's the output:
[choe...@eurybates oscillator]$ omc test.mos Es werden eingebaute Spezifikationen verwendet. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.5.1/lto-wrapper Ziel: x86_64-redhat-linux Konfiguriert mit: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread-Modell: posix gcc-Version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC) record OpenModelica.Diagnostics.ImportantValues OPENMODELICAHOME = "/opt/openmodelica/", OPENMODELICALIBRARY = "/opt/openmodelica/share/omc/libraries/msl32", OMC_PATH = "/opt/openmodelica//bin/omc", OMC_FOUND = true, MODELICAUSERCFLAGS = "", WORKING_DIRECTORY = "/home/choeger/dev/omc_tests/oscillator", CREATE_FILE_WORKS = true, REMOVE_FILE_WORKS = true, OS = "linux", SYSTEM_INFO = "Linux eurybates.uebb.cs.tu-berlin.de 2.6.35.10-74.fc14.x86_64 #1 SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux ", SENDDATALIBS = " -lsendData -lQtNetwork -lQtCore -lQtGui -lpthread", C_COMPILER = "g++", C_COMPILER_RESPONDING = true, CONFIGURE_CMDLINE = "Configured 2011-01-03 13:49:33 using arguments: '--prefix=/opt/openmodelica/ --with-omniORB=/opt/openmodelica/ RMLHOME=/opt/openmodelica/ --with-sendData-Qt'" end OpenModelica.Diagnostics.ImportantValues; Am Dienstag, den 04.01.2011, 16:05 +0100 schrieb Martin Sjölund: > What's the output of checkSettings() ? > > Mine says: > Using built-in specs. > Target: x86_64-linux-gnu > Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro > 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs > --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr > --program-suffix=-4.4 --enable-shared --enable-multiarch > --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib > --without-included-gettext --enable-threads=posix > --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib > --enable-nls --with-sysroot=/ --enable-clocale=gnu > --enable-libstdcxx-debug --enable-objc-gc --disable-werror > --with-arch-32=i686 --with-tune=generic --enable-checking=release > --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu > Thread model: posix > gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) > record OpenModelica.Diagnostics.ImportantValues > OPENMODELICAHOME = "/home/marsj/dev/trunk/build/", > OPENMODELICALIBRARY = > "/usr/lib/omlibrary/msl31/:/usr/lib/omlibrary/common/", > OMC_PATH = "/home/marsj/dev/trunk/build//bin/omc", > OMC_FOUND = true, > MODELICAUSERCFLAGS = "", > WORKING_DIRECTORY = "/home/marsj/tmp", > CREATE_FILE_WORKS = true, > REMOVE_FILE_WORKS = true, > OS = "linux", > SYSTEM_INFO = "Linux marsj-laptop 2.6.35-23-generic #41-Ubuntu SMP > Wed Nov 24 11:55:36 UTC 2010 x86_64 GNU/Linux > ", > SENDDATALIBS = " -lpthread", > C_COMPILER = "g++", > C_COMPILER_RESPONDING = true, > CONFIGURE_CMDLINE = "Configured 2010-12-22 18:45:25 using > arguments: '--with-omniORB --prefix=/home/marsj/dev/trunk/build/'" > end OpenModelica.Diagnostics.ImportantValues; > > > On 2011-01-04 16:02, Christoph Höger wrote: > > Ah, this makes the g++ complains comprehensible. Mine looks like that: > > > > #ifndef oscillator__H > > #define oscillator__H > > #include "modelica.h" > > #include<stdio.h> > > #include<stdlib.h> > > #include<errno.h> > > > > #if defined(_MSC_VER) > > #define DLLExport __declspec( dllexport ) > > #else > > #define DLLExport /* nothing */ > > #endif > > #include "simulation_runtime.h" > > extern "C" { > > } > > #endif > > > > Any ideas? > > > > Am Dienstag, den 04.01.2011, 15:54 +0100 schrieb Martin Sjölund: > >> Yes, I have it. It's part of oscillator_functions.h (attached; it should > >> be included by oscillator_functions.cpp). > >> > >> -- > >> Martin Sjölund > >> > >> On 2011-01-04 15:24, Christoph Höger wrote: > >>> does your omc create C++ code containing "Modelica_Math_sin_rettype"? If > >>> so, where is it defined? > >>> > >>> Am Montag, den 03.01.2011, 19:06 +0100 schrieb Martin Sjölund: > >>>> Yes, there are special rules in the flattening that handles certain > >>>> external "C" functions in the standard library because they need to be > >>>> evaluated quickly (launching gcc to compile and load a dll just to > >>>> compute Modelica.Math.sin() is silly). > >>>> > >>>> However, these all work for me (they are just declared external "C", so > >>>> nothing special should be needed to make them run): > >>>> $ omc a.mos > >>>> true > >>>> true > >>>> record SimulationResult > >>>> resultFile = "oscillator_res.plt", > >>>> simulationOptions = "startTime = 0.0, stopTime = 1.0, > >>>> numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', > >>>> fileNamePrefix = 'oscillator', storeInTemp = false, noClean = false, > >>>> options = '', outputFormat = 'plt'", > >>>> messages = "", > >>>> timeFrontend = 0.082646233, > >>>> timeBackend = 0.004297787, > >>>> timeSimCode = 0.001765213, > >>>> timeTemplates = 0.003413401, > >>>> timeCompile = 0.811047671, > >>>> timeSimulation = 0.020562325, > >>>> timeTotal = 0.923819948 > >>>> end SimulationResult; > >>>> > >>>> -- > >>>> Martin Sjölund > >>>> > >>>> On 2011-01-03 15:51, Christoph Höger wrote: > >>>>> -----BEGIN PGP SIGNED MESSAGE----- > >>>>> Hash: SHA1 > >>>>> > >>>>> addendum: The following model > >>>>> > >>>>> model mathtest > >>>>> parameter Real x = Modelica.Math.sin(1.0); > >>>>> Real y; > >>>>> equation > >>>>> y = Modelica.Math.cos(time) + x; > >>>>> end mathtest; > >>>>> > >>>>> gives the following omc output: > >>>>> > >>>>> class mathtest > >>>>> parameter Real x = 0.841470984807897; > >>>>> Real y; > >>>>> equation > >>>>> y = Modelica.Math.cos(time) + x; > >>>>> end mathtest; > >>>>> > >>>>> So the compiler was able to invoke sin(), even if the runtime system > >>>>> does not know it? > >>>>> > >>>>> Am 03.01.2011 15:34, schrieb Christoph Höger: > >>>>>> Thanks for the fast fix. The lookup problem is indeed solved now. > >>>>>> > >>>>>> Unfortunately I get a C++ error now: > >>>>>> > >>>>>> [choe...@eurybates oscillator]$ LC_ALL=C omc oscillator.mos > >>>>>> true > >>>>>> true > >>>>>> record SimulationResult > >>>>>> resultFile = "", > >>>>>> simulationOptions = "startTime = 0.0, stopTime = 10.0, > >>>>>> numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', > >>>>>> fileNamePrefix = 'oscillator', storeInTemp = false, noClean = false, > >>>>>> options = '', outputFormat = 'plt'", > >>>>>> messages = "Simulation failed for model: oscillator > >>>>>> Error: Error building simulator. Buildlog: g++ -I. -o oscillator > >>>>>> oscillator.cpp oscillator_functions.cpp -lsim -linteractive > >>>>>> -I"/opt/openmodelica//include/omc" -march=native -mfpmath=sse > >>>>>> -lsendData -lQtNetwork -lQtCore -lQtGui -lpthread > >>>>>> -L"/opt/openmodelica//lib/omc" -lc_runtime -lf2c oscillator_records.c > >>>>>> oscillator.cpp: In function 'int function_updateDependents()': > >>>>>> oscillator.cpp:918:3: error: 'Modelica_Math_sin_rettype' was not > >>>>>> declared in this scope > >>>>>> > >>>>>> Since Modelica.Math.sin is a stdlib function, is there something I need > >>>>>> to do, to get it working? > >>>>>> > >>>>>> Am 02.01.2011 16:48, schrieb Martin Sjölund: > >>>>>>> This seems to be an issue with evaluation of parameters without > >>>>>>> eq-bindings (it should look at start=binding and give a warning). It's > >>>>>>> easy to fix it in the model, but thanks for reporting this; I'll look > >>>>>>> into the compiler and see if I can make this work quickly. > >>>>>> > >>>>>>> sinevoltage1(freqHz=50,V=240); // works > >>>>>> > >>>>>>> -- > >>>>>>> Martin Sjölund > >>>>>> > >>>>>>> On 2010-12-29 13:20, Christoph Höger wrote: > >>>>>>>> Hi all, > >>>>>>>> > >>>>>>>> the following code > >>>>>>>> > >>>>>>>> model oscillator > >>>>>>>> Modelica.Electrical.Analog.Basic.Capacitor capacitor1; > >>>>>>>> Modelica.Electrical.Analog.Sources.SineVoltage sinevoltage1; > >>>>>>>> Modelica.Electrical.Analog.Basic.Inductor inductor1; > >>>>>>>> Modelica.Electrical.Analog.Basic.Ground ground1; > >>>>>>>> > >>>>>>>> equation > >>>>>>>> connect(inductor1.n,ground1.p); > >>>>>>>> connect(capacitor1.p,inductor1.p); > >>>>>>>> connect(sinevoltage1.p,capacitor1.p); > >>>>>>>> connect(capacitor1.n,sinevoltage1.n); > >>>>>>>> connect(capacitor1.n,inductor1.n); > >>>>>>>> end oscillator; > >>>>>>>> > >>>>>>>> throws a lookup error (sinevoltage1.freqHz, sineVoltage1.V) with omc > >>>>>>>> (current trunk) although the flattened output contains the lines: > >>>>>>>> > >>>>>>>> parameter Real sinevoltage1.V(quantity = "ElectricPotential", > >>>>>>>> unit = > >>>>>>>> "V", start = 1.0) "Amplitude of sine wave"; > >>>>>>>> parameter Real sinevoltage1.phase(quantity = "Angle", unit = > >>>>>>>> "rad", > >>>>>>>> displayUnit = "deg") = 0.0 "Phase of sine wave"; > >>>>>>>> parameter Real sinevoltage1.freqHz(quantity = "Frequency", > >>>>>>>> unit = > >>>>>>>> "Hz", start = 1.0) "Frequency of sine wave"; > >>>>>>>> > >>>>>>>> Any ideas how to circumvent? > >>>>>>>> > >>>>>>>> best regards, > >>>>>>>> > >>>>>>>> Christoph > >>>>>> > >>>>>> > >>>>> > >>>>> - -- > >>>>> Christoph Höger > >>>>> > >>>>> Technische Universität Berlin > >>>>> Fakultät IV - Elektrotechnik und Informatik > >>>>> Übersetzerbau und Programmiersprachen > >>>>> > >>>>> Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin > >>>>> > >>>>> Tel.: +49 (30) 314-24890 > >>>>> E-Mail: [email protected] > >>>>> -----BEGIN PGP SIGNATURE----- > >>>>> Version: GnuPG v1.4.11 (GNU/Linux) > >>>>> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ > >>>>> > >>>>> iEYEARECAAYFAk0h4nkACgkQhMBO4cVSGS9ZhgCfUgaOST9SizEM9p3ZIXVqW837 > >>>>> YXMAn3iuBMrdQ7sYnHgaQ89goAQQ93uQ > >>>>> =cXHV > >>>>> -----END PGP SIGNATURE----- > >>>> > >>> > >
signature.asc
Description: This is a digitally signed message part
