Configuration #2252

Investigate the possibility to use different versions of shared libraries on Linux without recompilation of the code

Added by dmitry 6 months ago. Updated 4 months ago.

Status:RejectedStart date:10 Dec 2018
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Originally compiled BornAgain distribution contains rpath with paths to shared libraries, e.g. by typing

readelf -d _libBornAgainGUI.so

one can get

0x000000000000000f (RPATH) Library rpath: [/home/dmitry/Documents/Software/BornAgainAll/rel-2/build/lib:/home/dmitry/Qt/5.11.1/gcc_64/lib:]

However, even though the rpath disappears from the binary after installation, the code is still unable to use other versions of e.g. Qt. Messages like the following ones are thrown
on attempt to run the GUI:

./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.11' not found (required by ./BornAgain)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./BornAgain)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by ./BornAgain)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so.5: version `Qt_5' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5: version `Qt_5' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Network.so.5: version `Qt_5' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Designer.so.5: version `Qt_5' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.11' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)
./BornAgain: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by /home/dmitry/Documents/Software/BornAgainAll/rel-2/installed/lib/BornAgain-1.14/_libBornAgainGUI.so)

Tested on Qt 5.11.1 and Qt 5.5.1. The sonames of libQt5Core's do coincide.

History

#1 Updated by dmitry 6 months ago

  • Subject changed from Weird behavior of installed distribution dependencies under Linux to Investigate the possibility to use different versions of shared libraries on Linux withour recompilation of the code
  • Description updated (diff)

UPD: it proves that after compiling against older qt versions (tested on 5.5.1), it is still possible to use newer Qts (e.g. 5.11. The library sonames shall coincide). One need to check if this approach also works for other
shared libraries required by distribution. If it is the case, it seems possible to make a deb-package for our code without using rpaths or LD_LIBRARY_PATH at least for third party libraries.

#2 Updated by dmitry 6 months ago

  • Subject changed from Investigate the possibility to use different versions of shared libraries on Linux withour recompilation of the code to Investigate the possibility to use different versions of shared libraries on Linux without recompilation of the code

#3 Updated by wuttke 4 months ago

  • Status changed from Backlog to Rejected

Shared library versions with same major version number ought to be backwards compatible, see e.g. https://unix.stackexchange.com/a/293782/46841.

#4 Updated by dmitry 4 months ago

wuttke wrote:

Shared library versions with same major version number ought to be backwards compatible, see e.g. https://unix.stackexchange.com/a/293782/46841.

As I have written before, it works only if the compilation was done with older libraries. If the code is compiled with newer libraries, it will not run on older ones. At least it did not work for Qt.

Also available in: Atom PDF