0

https://pgmodeler.io/support/installation says:

Resolving dependencies

After successfully compile the source code and install the binaries we need to copy some dependencies into the pgModeler's installation folder as well run some commands in order to make the binaries locate them properly.

GNU/Linux

1: cd $QT_ROOT/lib
2: cp libQt5DBus.so.5 libQt5PrintSupport.so.5 libQt5Widgets.so.5 libQt5Network.so.5 libQt5Gui.so.5 libQt5Core.so.5 libQt5XcbQpa.so.5 libQt5Svg.so.5 libicui18n.so.5* libicuuc.so.5* libicudata.so.5* $PGMODELER_ROOT/lib
3: cd $QT_ROOT/plugins
4: mkdir $PGMODELER_ROOT/lib/qtplugins
5: mkdir $PGMODELER_ROOT/lib/qtplugins/imageformats
6: mkdir $PGMODELER_ROOT/lib/qtplugins/printsupport
6: mkdir $PGMODELER_ROOT/lib/qtplugins/platforms
7: cp -r imageformats/libqgif.so imageformats/libqico.so imageformats/libqjpeg.so imageformats/libqsvg.so              imageformats/libqtga.so imageformats/libqtiff.so imageformats/libqwbmp.so $PGMODELER_ROOT/lib/qtplugins/imageformats
8: cp -r printsupport/libcupsprintersupport.so $PGMODELER_ROOT/lib/qtplugins/printsupport
9: cp -r platforms/libqxcb.so $PGMODELER_ROOT/lib/qtplugins/platforms
10: echo -e "[Paths]\nPrefix=.\nPlugins=lib/qtplugins\nLibraries=lib" > $PGMODELER_ROOT/qt.conf
11: cp $PGMODELER_SOURCE/start-pgmodeler.sh $PGMODELER_SOURCE/pgmodeler.vars $PGMODELER_ROOT
12: chmod +x $PGMODELER_ROOT/start-pgmodeler.sh

After make and make install, can the dependencies be resolved dynamically (dynamic linking) when the program runs? What is the purpose of doing the above?

If I run sudo checkinstall instead to create a deb file, do I still need to resolve dependencies like above?

Thanks!

blong
  • 2,815
  • 8
  • 44
  • 110
  • Note: it is frequent to build the program in one computer and install in an other computer (or just to build program in a special environment). You may also install on build path a library only to compile the code (because that library would conflict with one in the system). Especially now that we use packages, that assumptions need to be considered first. – Giacomo Catenazzi Jan 27 '19 at 14:28

1 Answers1

0

It looks like it is to create an install package for (potentially) deploying/installing on another machine.

I recall have this automated (in my own makefile) when I was writing Qt code (i.e. packaging up all the dependant libs/plugins). When a Qt program runs it often looks in the same directory with the exact structure lib/... and lib/plugins/... such that when you run the compiled executable (say on another machine) with the lib sub-folder it knows where the libraries are. I can't recall now if you still need to do anything like set LD_LIBRARY_PATH to ./lib - I think I recall adding a lib path as part of my linker command.

You can see my answer here from an old related question: how-to-deploy-qt-application - in this answer I have tried to automate this process that you see above using tools like ldd.

code_fodder
  • 15,263
  • 17
  • 90
  • 167
  • Thanks. If I run `sudo checkinstall` instead to create a deb file, do I still need to resolve dependencies like above? –  Jan 28 '19 at 22:50
  • Also where is the command to " create an install package"? I don't find it in the webpage. –  Jan 28 '19 at 22:59
  • @Ben I did not see where/what `sudo checkinstall` is/does. But from a brief read of the webpage link for pgmodeler I would have thought that any required installation actions would have been done during `make install`. However it looks like it only installs pgmodeler specific files and not the Qt libraries. For example - you may already have qt installed on your system (at the correct version) - in which case you would not need to copy the Qt libs. So in short - I believe the answer is yes, you need to copy the Qt libraries if you don't already have them. – code_fodder Jan 29 '19 at 06:53
  • Is there some way to automatically select dependency files and copy them, instead of manually doing so which is error prone? –  Jan 29 '19 at 13:12
  • Not really - (unless things have moved on since I last looked). If you take a look at the link I posted at the end of the answer it describes how to write your own automated script using tools like ldd.... – code_fodder Jan 29 '19 at 14:07