Results 1 to 3 of 3

Thread: Deploy on Ubuntu without root

  1. #1
    Join Date
    Oct 2015
    Posts
    33
    Thanks
    14
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Deploy on Ubuntu without root

    hey guys,

    i want to deploy my program onto a university server where i don't have root. I am using the Opensource Version of Qt so i cant statically link.

    The manual says there are 3 ways to accomplish deployment (http://doc.qt.io/qt-5/linux-deployment.html)

    - putting all needed libs int user/lib/
    ->cant write to there because no root access, so not an option

    - passing a prefered path where to look for libs -rpath command
    ->doing this i manage to get the application to find the qt libraries i shipped with the app. e.g:

    libs reside in the sub folder "qtlibs_5.6._64bit"

    adding this line to the .pro file
    Qt Code:
    1. QMAKE_LFLAGS += -Wl,-rpath,"'\$$ORIGIN/qtlibs_5.6_64bit'"
    To copy to clipboard, switch view to plain text mode 

    running ldd on my app showes:

    Qt Code:
    1. asdfasdf@asdfasdf:~/Gordon_backup/imex$ ldd imex
    2. linux-vdso.so.1 => (0x00007ffe24df6000)
    3. libQt5PrintSupport.so.5 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libQt5PrintSupport.so.5 (0x00007ff4c608b000)
    4. libQt5Widgets.so.5 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libQt5Widgets.so.5 (0x00007ff4c5818000)
    5. libQt5Gui.so.5 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libQt5Gui.so.5 (0x00007ff4c5021000)
    6. libQt5Core.so.5 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libQt5Core.so.5 (0x00007ff4c4906000)
    7. libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff4c46d0000)
    8. libstdc++.so.6 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libstdc++.so.6 (0x00007ff4c434e000)
    9. libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff4c4045000)
    10. libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007ff4c3e22000)
    11. libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff4c3c0c000)
    12. libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff4c3843000)
    13. libGL.so.1 => /usr/lib/nvidia-340/libGL.so.1 (0x00007ff4c34f6000)
    14. libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007ff4c32a3000)
    15. libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007ff4c30a1000)
    16. librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff4c2e98000)
    17. libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ff4c2b87000)
    18. libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007ff4c2975000)
    19. libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007ff4c263a000)
    20. libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff4c2420000)
    21. libicui18n.so.56 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libicui18n.so.56 (0x00007ff4c1f85000)
    22. libicuuc.so.56 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libicuuc.so.56 (0x00007ff4c1bcd000)
    23. libicudata.so.56 => /home/gordon/Gordon_backup/imex/./qtlibs_5.6_64bit/libicudata.so.56 (0x00007ff4c01ea000)
    24. libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff4bffe5000)
    25. /lib64/ld-linux-x86-64.so.2 (0x000055f39e6f9000)
    26. libnvidia-tls.so.340.96 => /usr/lib/nvidia-340/tls/libnvidia-tls.so.340.96 (0x00007ff4bfde2000)
    27. libnvidia-glcore.so.340.96 => /usr/lib/nvidia-340/libnvidia-glcore.so.340.96 (0x00007ff4bd1cd000)
    28. libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007ff4bcfc5000)
    29. libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff4bcd55000)
    30. libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ff4bcb32000)
    31. libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007ff4bc92e000)
    32. libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ff4bc727000)
    To copy to clipboard, switch view to plain text mode 

    so i think passing the libs worked, i think ?!

    but if i run the program i get this:

    Qt Code:
    1. asdfasdf@hasdfasdfas:~/Gordon_backup/imex$ ./imex
    2. This application failed to start because it could not find or load the Qt platform plugin "xcb"
    3. in "".
    4.  
    5. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
    6.  
    7. Reinstalling the application may fix this problem.
    8. Aborted (core dumped)
    To copy to clipboard, switch view to plain text mode 

    as i understand i need to copy the folder plugins/platforms and its content to my application folder for this to work (http://doc.qt.io/qt-5/linux-deployment.html)

    this does not seem to work for even if i run this on the development platform where withought passing the -rpath everything works.

    i also tried prerunning a bash script like also suggested in the documentation:
    ./imex.sh
    Qt Code:
    1. #!/bin/sh
    2. appname=`basename $0 | sed s,\.sh$,,`
    3.  
    4. dirname=`dirname $0`
    5. tmp="${dirname#?}"
    6.  
    7. if [ "${dirname%$tmp}" != "/" ]; then
    8. dirname=$PWD/$dirname
    9. fi
    10. LD_LIBRARY_PATH=$dirname
    11. export LD_LIBRARY_PATH
    12. export QT_QPA_PLATFORM_PLUGIN_PATH=$PWD/plugins/platforms
    13. $dirname/$appname "$@"
    To copy to clipboard, switch view to plain text mode 

    i also specifically added the QT_QPA_PLATFORM_PLUGIN_PATH since to me it looked like it was not found. this gives me a slightly different output.

    Qt Code:
    1. asdfsdf@asdfsfd:~/Gordon_backup/imex$ ./imex.sh
    2. This application failed to start because it could not find or load the Qt platform plugin "xcb"
    3. in "/home/gordon/Gordon_backup/imex/plugins/platforms".
    4.  
    5. Available platform plugins are: eglfs (from /home/gordon/Gordon_backup/imex/plugins/platforms), linuxfb (from /home/gordon/Gordon_backup/imex/plugins/platforms), minimal (from /home/gordon/Gordon_backup/imex/plugins/platforms), minimalegl (from /home/gordon/Gordon_backup/imex/plugins/platforms), offscreen (from /home/gordon/Gordon_backup/imex/plugins/platforms), xcb (from /home/gordon/Gordon_backup/imex/plugins/platforms), eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
    6.  
    7. Reinstalling the application may fix this problem.
    8. Aborted (core dumped)
    To copy to clipboard, switch view to plain text mode 

    to me this looks like if found the platforms folder and its content but still was not happy with that...

    if i run ldd on imex/plugins/platforms/

    Qt Code:
    1. asdfasdf@asdfasdfas:~/Gordon_backup/imex/plugins/platforms$ ldd libqxcb.so
    2. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: version `Qt_5_PRIVATE_API' not found (required by ./libqxcb.so)
    3. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./libqxcb.so)
    4. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./libqxcb.so)
    5. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by ./libqxcb.so)
    6. linux-vdso.so.1 => (0x00007ffca21a3000)
    7. libQt5XcbQpa.so.5 => /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 (0x00007fc6b8faf000)
    8. libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fc6b8dad000)
    9. libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007fc6b8b9c000)
    10. libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007fc6b8994000)
    11. libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007fc6b877a000)
    12. libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fc6b852d000)
    13. //..cropped for readablity
    To copy to clipboard, switch view to plain text mode 

    to me it looks like the platform libs are trying to access the Qt libraries again? is there a way to resolve this? Did i not read the Documentation properly? What did i miss? Help would be very appriciated! Thx in advance. Sorry for so much writing

  2. #2
    Join Date
    Oct 2015
    Posts
    33
    Thanks
    14
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Deploy on Ubuntu without root

    Update:

    this error comes from copying symbolic links. Replacing the specific version library with the general library linking to the specific lib solves this problem

    libQt5XcbQpa.so.5.4 -> libQt5XcbQpa.so.5

    Qt Code:
    1. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: version `Qt_5_PRIVATE_API' not found (required by ./libqxcb.so)
    2. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./libqxcb.so)
    3. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./libqxcb.so)
    4. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by ./libqxcb.so)
    To copy to clipboard, switch view to plain text mode 

    Also after checking how the qt libs were referenced in "libqxcb.so" i saw it was looking for the qt libraries in the /libs folder 2 folders upwards:

    qt_5.6_64bit/libs/qtlibraries....so.5
    qt_5.6_64bid/plugins/platforms/libqxcb.so

    this resolved all ldd issues for that lib....but sadly it will still not run.

    So now I am getting the admin to run the qt installer. Thx for the ppl who read this anyway. Cheers!

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deploy on Ubuntu without root

    Quote Originally Posted by Lumbricus View Post
    i want to deploy my program onto a university server where i don't have root. I am using the Opensource Version of Qt so i cant statically link.
    Not sure what you mean, Qt can be statically or dynamically linked independent of the which "version" you downloaded.
    It is always the same code and has the same capabilities.

    Quote Originally Posted by Lumbricus View Post
    but if i run the program i get this:

    Qt Code:
    1. asdfasdf@hasdfasdfas:~/Gordon_backup/imex$ ./imex
    2. This application failed to start because it could not find or load the Qt platform plugin "xcb"
    3. in "".
    4.  
    5. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
    6.  
    7. Reinstalling the application may fix this problem.
    8. Aborted (core dumped)
    To copy to clipboard, switch view to plain text mode 
    As you can see in the available platforms list, Qt is aware of the XCB plugin, so its file is found.
    But since it can't be loaded it is likely that one of its dependencies is not in place.
    Try running ldd on the xcb plugin's .so

    Quote Originally Posted by Lumbricus View Post
    if i run ldd on imex/plugins/platforms/

    Qt Code:
    1. asdfasdf@asdfasdfas:~/Gordon_backup/imex/plugins/platforms$ ldd libqxcb.so
    2. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: version `Qt_5_PRIVATE_API' not found (required by ./libqxcb.so)
    3. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./libqxcb.so)
    4. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./libqxcb.so)
    5. ./libqxcb.so: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by ./libqxcb.so)
    6. linux-vdso.so.1 => (0x00007ffca21a3000)
    7. libQt5XcbQpa.so.5 => /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 (0x00007fc6b8faf000)
    8. libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fc6b8dad000)
    9. libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007fc6b8b9c000)
    10. libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007fc6b8994000)
    11. libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007fc6b877a000)
    12. libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fc6b852d000)
    13. //..cropped for readablity
    To copy to clipboard, switch view to plain text mode 
    So dependencies of th XCB plugin are not satisfied.
    It finds the Qt libraries installed by the system instead of the ones it is looking for.

    Cheers,
    _

Similar Threads

  1. Getting issue in making .deb package of QT 5.2.1 app to deploy on Ubuntu 14.04
    By manojpatidar in forum Installation and Deployment
    Replies: 1
    Last Post: 17th June 2014, 08:14
  2. Replies: 4
    Last Post: 26th May 2014, 15:48
  3. How to deploy android app on a real device from Qt under ubuntu ?
    By fly-fish in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 16th October 2013, 07:14
  4. Replies: 6
    Last Post: 16th June 2011, 14:20
  5. Deploy from ubuntu QT to any PC statically?
    By SkylineBob in forum Installation and Deployment
    Replies: 7
    Last Post: 7th August 2010, 22:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.