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

make files does not compile

make files does not compile

I have installed openmodelica & DrModelica in a 64bit linux machine (ubuntu 9.04).They work fine, but when I try to compile a model outside OMShell-terminal or DrModelica I get compilation errors.

For example, in DrModelica I simulate a model named MyModel. I get the c code and the make file, but when I try:

make -f MyModel.makefile

I get some warnings and the following errors:

/home/ogduartev/openmodelica/trunk/build/lib/libsim.a(simulation_result.o): In function `add_result(double*, long*)':
simulation_result.cpp:(.text+0x4c): undefined reference to `Static::enabled()'
simulation_result.cpp:(.text+0x5d7): undefined reference to `sendPacket'
/home/ogduartev/openmodelica/trunk/build/lib/libsim.a(simulation_result.o): In function `deinitializeResult(char const*)':
simulation_result.cpp:(.text+0x1589): undefined reference to `Static::enabled()'
simulation_result.cpp:(.text+0x159f): undefined reference to `closeSendData'
/home/ogduartev/openmodelica/trunk/build/lib/libsim.a(simulation_result.o): In function `initializeResult(long, long, long, long)':
simulation_result.cpp:(.text+0x17d7): undefined reference to `Static::enabled_'
simulation_result.cpp:(.text+0x17e1): undefined reference to `Static::enabled()'
simulation_result.cpp:(.text+0x1817): undefined reference to `initSendData'
collect2: ld devolvió el estado de salida 1

¿Any ideas?

Thanks in advance for your help...

Oscar Duarte

Re: make files does not compile

The environment variable SENDDATALIBS is probably not defined in your usual shell, and the paths are different if QT clients are used or not (and different on other OS's).

Compiler martin$ grep SENDDATALIBS runtime/systemimpl.c
    _putenv("SENDDATALIBS=-lsendData -lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32");
        "SENDDATALIBS=-L%s/lib -lsendData -framework QtNetwork -framework QtCore -framework QtGui -lz -framework Carbon",
        "SENDDATALIBS=-L%s/lib -lsendData -lQtNetwork -lQtCore -lQtGui",
        "SENDDATALIBS=-lsendData");

Re: make files does not compile

I've updated the trunk of OpenModelica to add the following to the generated Makefiles (with SENDDATALIBS set to the same as omc would normally use on your platform):

ifndef SENDDATALIBS
  SENDDATALIBS=-lsendData
endif

Re: make files does not compile

Thanks for the answer!

I have used:

export SENDDATALIBS="-lsendData -lQtNetwork -lQtCore -lQtGui -lz"

and now it compiles

I will try the updated trunk and inform...

Oscar Duarte

Re: make files does not compile

I have used the updated trunk version.

I have noticed a change in the c_runtime/Makefile about FFLAG.
If I use the flag -O the compilation process of my models give me some errors like this (try the BouncigBall3D of the Examples directory):

error: ‘REGREATER’ no se declaró en este ámbito

If I change the flag to -O3 the compilation is succesful.

Again, thanks for your help...

Re: make files does not compile

As far as I can tell, -O rather than -O3 is needed because of bugs in the g77 used on Windows. And we used to use -O way back as well (even back in 2006).
Could you post the code you load in the compiler and the error messages (I only compile the command-line tools)?

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