Opened 7 years ago

Last modified 3 years ago

#4605 accepted defect

rpath issues in runtime libraries on Ubuntu 17.10

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone:
Component: Run-time Version:
Keywords: Cc: Rüdiger Franke

Description

Tests such as Crane_FMU2_CPP.mos currently fail on Ubuntu 17.10:

messages = "Simulation execution failed for model: cranes_crane_me_FMU
Cannot open library: libomcgc.so.1: cannot open shared object file: No such file or directory
Simulation stopped with error in model factory: Failed loading System library!
/home/marsj/OpenModelica/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/OMCppcranes_crane_me_FMU.so

If simCodeTarget is changed to C when compiling the model generated by importFMU, the code works fine. There is something preventing the C++ runtime from working correctly using this code.

Change History (12)

comment:1 by Rüdiger Franke, 7 years ago

This must be a dependency of something linked in from the C runtime.

$ ldd OMCppcranes_crane_me_FMU.so | grep omc
gives under Jessie:

	libOpenModelicaFMIRuntimeC.so => ... /lib/x86_64-linux-gnu/omc/libOpenModelicaFMIRuntimeC.so (0x00007f1704374000)
        ...

$ ldd libOpenModelicaFMIRuntimeC.so
gives:

	linux-vdso.so.1 (0x00007ffd2337f000)
	libomcgc.so.1 => not found
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0d99406000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0d99105000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0d98f01000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0d98bf6000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0d9884b000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f0d99829000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0d98635000)

Maybe a missing rpath of libOpenModelicaFMIRuntimeC.so that is not critical under Jessie but under Ubuntu 17.10?

comment:2 by Rüdiger Franke, 7 years ago

Component: Cpp Run-timeRun-time
Milestone: Future1.13.0
Priority: normalhigh

comment:3 by Rüdiger Franke, 7 years ago

This should be fixed asap because otherwise FMI import does not work with the Cpp runtime anymore.

comment:4 by Martin Sjölund, 7 years ago

Owner: changed from somebody to Martin Sjölund
Status: newaccepted

I guess because when generating code for the C-runtime, we add rpaths of all library directories that we find, but the Cpp runtime doesn't (?) when it is linking against the C-runtime.

comment:5 by Martin Sjölund, 7 years ago

See PR1967 (which I guess will resolve the issue; I am not on a 17.10 system at the moment).

comment:6 by Martin Sjölund, 7 years ago

Component: Run-timeCpp Run-time
Priority: highnormal
Summary: CppRuntime with importFMU fails on Ubuntu 17.10rpath issues in runtime libraries on Ubuntu 17.10

That fixed the issues with libgc, but there still remains one issue:

+ Modelica.Electrical.Analog.Examples.CauerLowPassSC_staticLinking                  ... execution failed

==== Log /tmp/omc-rtest-hudson/openmodelica/cppruntime/staticLinking/Modelica.Electrical.Analog.Examples.CauerLowPassSC_cpp_static.mos_temp7592/log-Modelica.Electrical.Analog.Examples.CauerLowPassSC_cpp_static.mos
"true
"
""
OpenModelicaModelTesting.SimulationRuntime.Cpp
OpenModelicaModelTesting.Kind.VerifiedSimulation
Modelica.Electrical.Analog.Examples.CauerLowPassSC
600
"mat"
{"R4.Capacitor1.v","R5.Capacitor1.v","R8.Capacitor1.v","R9.Capacitor1.v","R1.Capacitor1.v","R2.Capacitor1.v","R3.Capacitor1.v","Rp1.Capacitor1.v","R7.Capacitor1.v","R10.Capacitor1.v","R11.Capacitor1.v","C3.v","C7.v","C1.v","C4.v","C8.v"}
true
""
Simulation options: startTime = 0.0, stopTime = 60.0, numberOfIntervals = 1500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Modelica.Electrical.Analog.Examples.CauerLowPassSC', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''
Error: Simulation did not produce a result-file
Errors: Simulation execution failed for model: Modelica.Electrical.Analog.Examples.CauerLowPassSC
/var/lib/hudson/workspace/TEMP_RIPPER_TEST_PR/OpenModelica/testsuite/openmodelica/cppruntime/staticLinking/Modelica.Electrical.Analog.Examples.CauerLowPassSC_cpp_static.mos_temp7592/Modelica.Electrical.Analog.Examples.CauerLowPassSC: error while loading shared libraries: libsundials_nvecserial.so.0: cannot open shared object file: No such file or directory

And nvecserial is not linked in any C-runtime library

comment:7 by Martin Sjölund, 7 years ago

Component: Cpp Run-timeRun-time
Priority: normalhigh

comment:8 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:9 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:10 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:11 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:12 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.