Results 1 to 9 of 9

Thread: Which Linux distribution is best for building compatible apps?

  1. #1
    Join Date
    Jun 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Which Linux distribution is best for building compatible apps?

    I'm trying to build my application so that it can be run on as many linux distributions as possible without any additional dependencies. For that, I build Qt statically and link my app against it. Now I can run the app on any linux that uses the same gcc and glibc ABIs.

    Since I'm using Gentoo on my box, I always have the latest versions on my system. As a result, the apps I build are also dependent on the latest gcc/glibc. That's definitely not what I want. I can for example not run my app on a distribution which is two years old.

    I did some research on my options:
    • Linking gcc and glibc statically: this doesn't seem to be an option according to http://www.trilithium.com/johan/2005/06/static-libstdc/
    • statifier: doesn't work reliable. On some distributions, this will silently crash the app.
    • LSB: basically a great idea, especially the possibility to run a test to see on which distributions the app will run/not run. However, this only covers very popular or enterprise distributions. A good example that this doesn't suit me: Gentoo has no LSB support at all! No way to run such an app on my system. So that's not an option for me either.
    • Building with a very old version of gcc/glibc: the ABIs should be backward compatible. So if I build with gcc 3.4.6 and glibc 2.3.2, the app should run on any sytem that uses the same version or above. I've looked into creating a cross-compiling environment for those old libs, but that's acutally pretty nasty thing todo. It appears to be easier to simply build my app on an old linux distribution that has the suitable versions.


    So here is my question: what's the best linux distribution regarding gcc/glibc compatibility? My guess is it should an old distribution, maybe something from 2005 or before. I've tried building on CentOS 4.7 (RHEL4-based, gcc 3.4.6, glibc 2.3.4 and an quite pleased by the result: the resulting executable runs fine on my gentoo, on Knoppix 5.2 and Debian Sarge 3.1. Does anyone around here have any experience on the subject or can recommend a better option/distribution?

  2. #2
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Which Linux distribution is best for building compatible apps?

    Well what you can do is get a list of all the popular distros, write deb files for ubuntu, debian, write an ebuild for Gentoo, write an rpm for Suse. But first check and see what comes out of the box for those distros and compile against those.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  3. #3
    Join Date
    Jun 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Which Linux distribution is best for building compatible apps?

    That would require to build the app on all those distributions seperatly, no?

  4. #4
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Which Linux distribution is best for building compatible apps?

    Well since me and you use Gentoo (we have to compile ourself using ebuilds). I don't know much about Debian. But usually when creating a deb file, you compile yourself and what not, same with rpm. But that's what i'd do. Create package manager's package. And for the ones you have to compile yourself. Go with what they ship with their distro out of the box. But more usually it's GCC-4.2.x to GCC-4.3.x.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Which Linux distribution is best for building compatible apps?

    Quote Originally Posted by Oxidative View Post
    That would require to build the app on all those distributions seperatly, no?
    No, you can create the packages for all distros on your own machine. And only once. The executable is only packed in a different way in deb or rpm, but the executable is the same using gcc***. The distros find the needed libraries themselves.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Which Linux distribution is best for building compatible apps?

    The best way is to provide source code of your application. This is compatible with every linux distro. You can even provide a .spec file for your package that will build the package by calling qmake, make and make install on every possible rpm-based distro.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jun 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Which Linux distribution is best for building compatible apps?

    Quote Originally Posted by Lykurg View Post
    No, you can create the packages for all distros on your own machine. And only once. The executable is only packed in a different way in deb or rpm, but the executable is the same using gcc***. The distros find the needed libraries themselves.
    I'd have to figure out the required dependencies for every distribution. I don't want to write a specific package for every possible distribution out there. Providing distribution specific packages is a job for the packaging community, not for me as a developer.

    The best way is to provide source code of your application. This is compatible with every linux distro. You can even provide a .spec file for your package that will build the package by calling qmake, make and make install on every possible rpm-based distro.
    I totally agree with you, offering the source package is a must. But those packages are for more advanced users or package builders. I want to offer a package for the convenient users, who don't care about installing the software a "proper way", who just wants to be able to run the software somehow. As far as I can see, a .spec file will always be for a specific distribution because of the dependencies. And then again, not every distribution is using rpm or deb...

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Which Linux distribution is best for building compatible apps?

    Quote Originally Posted by Oxidative View Post
    I'd have to figure out the required dependencies for every distribution. I don't want to write a specific package for every possible distribution out there. Providing distribution specific packages is a job for the packaging community, not for me as a developer.
    That's why sticking to LSB is the best choice if you want to distribute your application in a binary form.


    I totally agree with you, offering the source package is a must. But those packages are for more advanced users or package builders. I want to offer a package for the convenient users, who don't care about installing the software a "proper way", who just wants to be able to run the software somehow. As far as I can see, a .spec file will always be for a specific distribution because of the dependencies. And then again, not every distribution is using rpm or deb...
    You can't satisfy them all. You can provide an installer script that will call qmake (or cmake), make and optionally make install and will build the application in the background. If your application only depends on Qt, this shouldn't be a problem (even if you want to distribute a .spec file). But in general unless you build your application statically, there is a chance your application won't work on some of the distros. And even that won't make your application run on different architectures. Sometimes people tend to forget the world is something more than just x86.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Nov 2007
    Posts
    53
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Which Linux distribution is best for building compatible apps?

    Hello,

    I asked (and still think about it) myself the same questions.

    You are right and I already posted about it on this forum, the best Linux distro to build an app is CentOS / RHEL because this is the only one that is maintained for 7 years so you can run a security updated OS with old libs.

    So, you can be sure that all the other Linux distros maintained will use fresher libs.

    I used until recently CentOS 3 but with Qt 4.5, it began to be a pain to compile Qt so I switched to CentOS 4. CentOS 3 will expire next year so it was not so important to stick with it.

    Next, how to distribute your app. If you don't use exotic libs, I think all dependencies will be met if someone install a popular Linux distro in a standard way (without stream-lined it too much).

    So the bash wrapper script with LD_LIBRARY_PATH could be the best (if you need to link dynamically, it's required if you want to use the LGPL release of Qt) and it will be simple for users to untar and unzip it and use it without the need to be root to install the software.

    But in case of explicit needs when you really need dependencies or doing some stuffs on the system when installing, I have wrapped binary and Qt libs (all build on the CentOS 4) in a deb file on the latest Debian (it run fine both on Debian & Ubuntu) and on a RPM that seems to be generic enough to run both on Red Hat / Mandriva & SuSE systems

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.