Opened 13 years ago

Last modified 13 years ago

#1685 closed defect (fixed)

linkage error for combitable1D

Reported by: chenouard-r Owned by: chenouard-r
Priority: high Milestone:
Component: Version:
Keywords: Cc: chenouard-r,

Description

I test the following model and i get an error after compilation during linkage with ld command while referencing libModelicaExternalC.a:
{{{    model TestCT

import Modelica.Blocks.Sources.*;
Modelica.Blocks.Tables.CombiTable1D ct1(table=[25, 236.2; 50, 208.2; 75, 199.6; 85, 199.4; 100, 200.2; 110, 205.4]);
Ramp rp (offset=3000,startTime=0,duration=10,height=8000);

equation

ct1.u[1]=100*rp.y/11200;

end TestCT; }}}

I got the following error:

{{{ ld: duplicate symbol _inline_isinff in /opt/local/lib/omc/libModelicaExternalC.a(tables.o) and /opt/local/lib/omc/libModelicaExternalC.a(ModelicaTablesImpl.o)
collect2: ld returned 1 exit status
}}}

The same function seems to be defined two times in tables.o and in ModelicaTablesImpl.o.

I'm using one of the last development version of omc: OpenModelica Compiler 1.8.1 (r11034)

Change History (8)

comment:1 Changed 13 years ago by sjoelund.se

Before I ask what OS and compiler you are running, I will just say that the default gcc in OSX sucks because it doesn't inline functions declared as inline in the system headers :(

comment:2 Changed 13 years ago by chenouard-r

I am under macos X 10.6.

I tried with default gcc 4.2 and with gcc-4.6 from macports and both give the same error.

I also tried to compile with clang 3.1 and i get the same error:
ld: duplicate symbol _inline_isinff in /opt/local/lib/omc/libModelicaExternalC.a(tables.o) and /opt/local/lib/omc/libModelicaExternalC.a(ModelicaTablesImpl.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

comment:3 Changed 13 years ago by sjoelund.se

Did you recompile the whole thing using these compilers or were the .a-files compiled with a for you unknown compiler?

comment:4 Changed 13 years ago by chenouard-r

I just compile the generated code with these compilers. The lib files were compiled during the macports installation and i didn't check which compiler were used.

I'll see how to compile openmodelica with gcc4.6 instead of default one.

I remember that i previously checked combitable1D and combitable2D with openmodelica and it worked. I think it was a few months ago, but i don't remember precisely.

comment:5 Changed 13 years ago by chenouard-r

I tried to compile with gcc46 variant, but there is an error. I modify the portfile so that the gcc46 variant is similarly defined as others (configure.compiler macports-gcc-4.6).

Then I get an error on the following command:

"cd /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica/openmodelica/work/openmodelica_10967 && /usr/bin/make -j2 -w all omlibrary"


With gcc44 variant it compiles out of the box, but i  get same error when launching the simulation of my model.

comment:6 Changed 13 years ago by sjoelund.se

I'm fairly sure this should be working in r11051+. Reopen the bug if it does not work.

comment:7 Changed 13 years ago by chenouard-r

Thanks, it works well now!

Please, could you change the portfile definition for gcc46 variant, because it can't be used as it is defined now and it is defined differently than other compiler variants.

comment:8 Changed 13 years ago by sjoelund.se

I'll try changing it to the same as the others. But last I checked (admittedly several months ago), macports did not support 4.6 in this manner yet...

Note: See TracTickets for help on using tickets.