Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Problems getting started

Problems getting started

Hi,
i wanted to try out OpenModelica but so far had no luck getting it to work.

First, i tried to build it from source under Linux (openSuse 11.2 64 Bit). Something seems to be wrong with the makefiles, when making omc it always fails with

Makefile:20: *** missing separator.

The first Makefile with the problem is Compiler/runtime/Makefile, but there are some more. They all contain invalid lines like the following:

RMLINCLUDE = /usr/local/src/mmc/x86_64-linux-gcc/include/plain
/usr/local/include/plain

So, i went for the Windows binary (Win7 64 Bit). Unfortunately, this has a different problem. Models load fine, but when actually simulating them, i get many linker errors like this:

record SimulationResult
    resultFile = "Simulation failed.
Error: Error building simulator. Buildlog: g++ -I"C:\OpenModelica1.5.0/include" -msse2 -mfpmath=sse  -I. -I"C:/Users/maximAL/Desktop/tiller" -o Tiller.TestCubic.exe Tiller.TestCubic.cpp -L"C:/Users/maximAL/Desktop/tiller" -lsim -L"C:\OpenModelica1.5.0/lib" -lc_runtime -lf2c -lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x1d4): undefined reference to `_PeekMessageW@20'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x204): undefined reference to `_PeekMessageA@20'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x24c): undefined reference to `_PostMessageW@16'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x270): undefined reference to `_PostMessageA@16'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x2bc): undefined reference to `_GetMessageW@16'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x2e0): undefined reference to `_GetMessageA@16'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x3b2): undefined reference to `_SetTimer@16'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x4b1): undefined reference to `_KillTimer@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x93b): undefined reference to `_DefWindowProcW@16'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0xa15): undefined reference to `_GetWindowLongA@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0xb40): undefined reference to `_KillTimer@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0xca6): undefined reference to `_UnregisterClassA@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0xd84): undefined reference to `_DestroyWindow@4'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0xee6): undefined reference to `_UnregisterClassA@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0xfbc): undefined reference to `_DestroyWindow@4'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x1146): undefined reference to `_UnregisterClassA@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x121c): undefined reference to `_DestroyWindow@4'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x21ee): undefined reference to `_RegisterClassA@4'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x2242): undefined reference to `_CreateWindowExA@48'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x2257): undefined reference to `_SetWindowLongA@12'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x2c8e): undefined reference to `_MsgWaitForMultipleObjectsEx@20'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x2f84): undefined reference to `_MsgWaitForMultipleObjectsEx@20'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x3088): undefined reference to `_TranslateMessage@4'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x309c): undefined reference to `_DispatchMessageW@4'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x30ac): undefined reference to `_DispatchMessageA@4'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qprocess_win.o):qprocess_win.cpp:(.text+0x109c): undefined reference to `_GetWindowThreadProcessId@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qprocess_win.o):qprocess_win.cpp:(.text+0x10d0): undefined reference to `_PostMessageW@16'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qprocess_win.o):qprocess_win.cpp:(.text+0x111f): undefined reference to `_EnumWindows@8'
C:\OpenModelica1.5.0/lib/libQtCore-mingw.a(qprocess_win.o):qprocess_win.cpp:(.text+0x1148): undefined reference to `_PostThreadMessageW@16'
collect2: ld returned 1 exit status
mingw32-make: *** [Tiller.TestCubic] Error 1

Error: Error building simulator. Buildlog: command g++ not found. Check $OPENMODELICAHOME
Error: Error building simulator. Buildlog: command "C:\OpenModelica1.5.0/bin/Compile" not found. Check $OPENMODELICAHOME
"
end SimulationResult;

Edited by: maximAL - Apr-05-10 01:08:49

Re: Problems getting started

Hi,

The Makefile.in in trunk/Compiler/runtime uses the macro:
RMLINCLUDE = @rmlinc@

The configure script uses the $RMLHOME environment variable, and if that contains several directories, I suppose it is possible to get these weird lines in the Makfile that the configure script generates (it uses "find $RMLHONE [...]" to find the directory).

I can't help you with the Windows errors, however.

Re: Problems getting started

Hello,
RMLHOME is set to /usr/local and nothing else current/sad

Re: Problems getting started

And `find $RMLHOME -follow -type d -name plain |grep include/plain` returns what? If it just returns one line, re-run ./configure and it should work.

Edit: I think I see why. The find command someone thought was good to use will break if you can find two rml installations in the same path... Anywhere in the same path... Should be fixed in the subversion trunk.

Re: Problems getting started

Ah, i see. That of course returns two paths, as I built RML from source and still have it available - actually to be able to do a make uninstall, but i just realize RML doesn't have an uninstall target, oh my current/roll

Re: Problems getting started

Now, the compilation gets a bit further, but still fails with a myriad of errors beginning with that one:

unitparserext.cpp:152: error: ‘mk_scon’ was not declared in this scope   

My configure call looked like that:

./configure --prefix=/usr/local --with-MODPAR --with-BOOST=/usr --with-CORBA=/usr/local

Re: Problems getting started

What g++ line did it use? And did you get a "Warning: Could not find rml.h" at the top of the line?

Re: Problems getting started

g++ line is as follows

g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DYYTEXT_POINTER=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_VPRINTF=1 -DHAVE_GETCWD=1 -DHAVE_SELECT=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_SCANDIR=1 -DUSE_CORBA -O3 -I/usr/local/include/plain -I../../c_runtime  -I../../c_runtime/superlu/include -I../ -I. -I/usr/local/include -I../ -Ilpsolve   -c -o unitparserext.o unitparserext.cpp

I couldn't grep any rml.h-related warning out of the output.

Re: Problems getting started

And rml.h exists in /usr/local/include/plain, right?

Re: Problems getting started

Yes, it's the only file there.

Re: Problems getting started

I'll assume it contains the line "extern void *mk_scon(char*);", which just leaves... g++ version?

Try to run the command verbose (g++ -v) and post the log.

Code:

g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DYYTEXT_POINTER=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_VPRINTF=1 -DHAVE_GETCWD=1 -DHAVE_SELECT=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_SCANDIR=1 -DUSE_CORBA -O3 -I/usr/local/include/plain -I../../c_runtime  -I../../c_runtime/superlu/include -I../ -I. -I/usr/local/include -I../ -Ilpsolve   -c -o unitparserext.o unitparserext.cpp -v

Re: Problems getting started

sjoelund.se wrote:

I'll assume it contains the line "extern void *mk_scon(char*);"

No - it didn't. Obviously i had a wrong version of RML.
Now i get one step further to the next problem:

TaskMerging.cpp:121: error: cast from ‘void*’ to ‘int’ loses precision 

(and more alike)
Probably because void* is 64Bit while int still is 32Bit and my gcc is stricter on that kind of stuff.

My gcc:

Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.4 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.4 --enable-linux-futex --without-system-libunwind --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.4.1 [gcc-4_4-branch revision 150839] (SUSE Linux)

Re: Problems getting started

If you are not going to use MODPAR, you could just disable it in the configure script. I never enabled it, and so I haven't fixed warnings on 64-bit platforms for those files... I did however fix some warnings on 64-bit OSX for trunk/Compiler/runtime now. Maybe that will help some.

The problem is (of course) that RML uses (void*) in order to store an integer (shifted 1 bit, so 31 or 63-bit integers in OpenModelica).

Re: Problems getting started

Ok, i updated (didn't help though) and then reconfigured without modpar and so far it seems to be running OK.

Thanks a lot for the quick service current/cool

There are 0 guests and 0 other users also viewing this topic