Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Licensing for Qt Embedded - Static build
Forum Updated to NodeBB v4.3 + New Features

Licensing for Qt Embedded - Static build

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
19 Posts 5 Posters 2.4k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hariprasasth
    wrote on 30 Oct 2018, 14:19 last edited by Hariprasasth
    #1

    Hello,

    I am planning to use Qt4.8.6 and I would like to create commercial application. Below are my case:

    1. Developing software for lower end embedded hardware (64 MB RAM, Arm PXA270 hardware which runs on 620 MHz processor speed) so I cannot go for latest version of Qt
    2. I would use Qt as a 'Static' build not 'Shared'. This is mainly for performance enhancement.

    I have read internet about Qt using a LGPL license.

    I understand that to develop commercial Qt application using 'Static' build, I should share my source code (or) Object code of my source files.

    Is that correct?

    Thanks.

    J 1 Reply Last reply 30 Oct 2018, 18:44
    0
    • H Hariprasasth
      30 Oct 2018, 14:19

      Hello,

      I am planning to use Qt4.8.6 and I would like to create commercial application. Below are my case:

      1. Developing software for lower end embedded hardware (64 MB RAM, Arm PXA270 hardware which runs on 620 MHz processor speed) so I cannot go for latest version of Qt
      2. I would use Qt as a 'Static' build not 'Shared'. This is mainly for performance enhancement.

      I have read internet about Qt using a LGPL license.

      I understand that to develop commercial Qt application using 'Static' build, I should share my source code (or) Object code of my source files.

      Is that correct?

      Thanks.

      J Online
      J Online
      JonB
      wrote on 30 Oct 2018, 18:44 last edited by
      #2

      @Hariprasasth

      I understand that to develop commercial Qt application using 'Static' build, I should share my source code (or) Object code of my source files.

      My understanding: essentially, yes (source code, not object code), or you can purchase commercial licensing from Qt company and then still be allowed to maintain your own code confidential.

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 30 Oct 2018, 21:11 last edited by
        #3

        Hi and welcome to devnet,

        WARNING I AM NOT A LAWYER

        Under LGPL, no you don't have to share your source code, you have to share the modifications you make to Qt if any and you have to provide the build objects of your application so people wanting to can re-build your application using their own version of Qt.

        If you want a definite answer, ask a lawyer.

        On a side note, the latest of the Qt 4 series is Qt 4.8.7.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        J 1 Reply Last reply 30 Oct 2018, 21:17
        2
        • S SGaist
          30 Oct 2018, 21:11

          Hi and welcome to devnet,

          WARNING I AM NOT A LAWYER

          Under LGPL, no you don't have to share your source code, you have to share the modifications you make to Qt if any and you have to provide the build objects of your application so people wanting to can re-build your application using their own version of Qt.

          If you want a definite answer, ask a lawyer.

          On a side note, the latest of the Qt 4 series is Qt 4.8.7.

          J Online
          J Online
          JonB
          wrote on 30 Oct 2018, 21:17 last edited by JonB
          #4

          @SGaist
          To be clear: if the OP opts for Qt static build as he says then it is not available under LGPL, that's why the rules about his own source code would differ from if he goes for dynamic Qt build. Right?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 30 Oct 2018, 21:24 last edited by
            #5

            LPGL doesn't dictate that you can't have static build. What you have to provide is the means to re-build your application with a different version of the library, therefore you have to provide the build objects.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            J 1 Reply Last reply 30 Oct 2018, 21:37
            3
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 30 Oct 2018, 21:36 last edited by
              #6

              @Hariprasasth said in Licensing for Qt Embedded - Static build:

              Developing software for lower end embedded hardware (64 MB RAM, Arm PXA270 hardware which runs on 620 MHz processor speed) so I cannot go for latest version of Qt

              That assumption is utterly wrong. See this blog post https://blog.qt.io/blog/2018/05/03/qt-microncontrollers-mcu/

              I would use Qt as a 'Static' build not 'Shared'. This is mainly for performance enhancement.

              Better measure the impact first. And analyse your software for bottlenecks - you are far more likely to write suboptimal code than shared vs. static difference would buy you. And that's not me being judgemental in any way about your expertise - I don't question that. I just know that when it comes to performance, the problems are usually not where one would suspect. I've been bitten by this many times :-)

              (Z(:^

              H 1 Reply Last reply 31 Oct 2018, 09:48
              2
              • S SGaist
                30 Oct 2018, 21:24

                LPGL doesn't dictate that you can't have static build. What you have to provide is the means to re-build your application with a different version of the library, therefore you have to provide the build objects.

                J Online
                J Online
                JonB
                wrote on 30 Oct 2018, 21:37 last edited by JonB
                #7

                @SGaist
                That is interesting. I was under the distinct impression that when I first read up on this the Qt company's terms specifically said something about static linking of Qt libraries not being allowed if using LGPL license. But I admit I am unable to find the reference.

                S 1 Reply Last reply 30 Oct 2018, 21:42
                0
                • J JonB
                  30 Oct 2018, 21:37

                  @SGaist
                  That is interesting. I was under the distinct impression that when I first read up on this the Qt company's terms specifically said something about static linking of Qt libraries not being allowed if using LGPL license. But I admit I am unable to find the reference.

                  S Offline
                  S Offline
                  sierdzio
                  Moderators
                  wrote on 30 Oct 2018, 21:42 last edited by sierdzio
                  #8

                  @JonB said in Licensing for Qt Embedded - Static build:

                  @SGaist
                  That is interesting. I was under the distinct impression that when I first read up on this the Qt company's terms specifically said something about static linking of Qt libraries not being allowed if using LGPL license. But I admit I am unable to find the reference.

                  QtC has vested interest in making people believe that static linking is a no go. The LGPL license does not prohibit it, though (it does, however, make it very hard to satisfy the license when using static linking. On some platforms, like iOS in the past, it was indeed impossible to use LGPL. It is also at least highly questionable on embedded devices, where users have no means of tweaking the software).

                  So, in very general terms it is OK to say that static linking is not allowed under LGPL, but such sentence should be followed with some star * and explanation in small print at the bottom of a page ;-)

                  (Z(:^

                  S 1 Reply Last reply 30 Oct 2018, 21:49
                  1
                  • S sierdzio
                    30 Oct 2018, 21:42

                    @JonB said in Licensing for Qt Embedded - Static build:

                    @SGaist
                    That is interesting. I was under the distinct impression that when I first read up on this the Qt company's terms specifically said something about static linking of Qt libraries not being allowed if using LGPL license. But I admit I am unable to find the reference.

                    QtC has vested interest in making people believe that static linking is a no go. The LGPL license does not prohibit it, though (it does, however, make it very hard to satisfy the license when using static linking. On some platforms, like iOS in the past, it was indeed impossible to use LGPL. It is also at least highly questionable on embedded devices, where users have no means of tweaking the software).

                    So, in very general terms it is OK to say that static linking is not allowed under LGPL, but such sentence should be followed with some star * and explanation in small print at the bottom of a page ;-)

                    S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 30 Oct 2018, 21:49 last edited by
                    #9

                    @sierdzio said in Licensing for Qt Embedded - Static build:

                    So, in very general terms it is OK to say that static linking is not allowed under LGPL, but such sentence should be followed with some star * and explanation in small print at the bottom of a page ;-)

                    It is allowed. See the GNU GPL faq about static linking and LGPL.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    S 1 Reply Last reply 30 Oct 2018, 21:57
                    0
                    • S SGaist
                      30 Oct 2018, 21:49

                      @sierdzio said in Licensing for Qt Embedded - Static build:

                      So, in very general terms it is OK to say that static linking is not allowed under LGPL, but such sentence should be followed with some star * and explanation in small print at the bottom of a page ;-)

                      It is allowed. See the GNU GPL faq about static linking and LGPL.

                      S Offline
                      S Offline
                      sierdzio
                      Moderators
                      wrote on 30 Oct 2018, 21:57 last edited by
                      #10

                      @SGaist said in Licensing for Qt Embedded - Static build:

                      @sierdzio said in Licensing for Qt Embedded - Static build:

                      So, in very general terms it is OK to say that static linking is not allowed under LGPL, but such sentence should be followed with some star * and explanation in small print at the bottom of a page ;-)

                      It is allowed. See the GNU GPL faq about static linking and LGPL.

                      Yes, I know and I hope I explained it ;-) I just meant that a TL;DR summary could state that it is not allowed, simply because it requires big effort to pull it off. Anyway, that's just my opinion. I'm pretty sure the reference OP is mentioning came from Qt Company back when iOS really was not compatible with LGPL at all.

                      (Z(:^

                      1 Reply Last reply
                      0
                      • S sierdzio
                        30 Oct 2018, 21:36

                        @Hariprasasth said in Licensing for Qt Embedded - Static build:

                        Developing software for lower end embedded hardware (64 MB RAM, Arm PXA270 hardware which runs on 620 MHz processor speed) so I cannot go for latest version of Qt

                        That assumption is utterly wrong. See this blog post https://blog.qt.io/blog/2018/05/03/qt-microncontrollers-mcu/

                        I would use Qt as a 'Static' build not 'Shared'. This is mainly for performance enhancement.

                        Better measure the impact first. And analyse your software for bottlenecks - you are far more likely to write suboptimal code than shared vs. static difference would buy you. And that's not me being judgemental in any way about your expertise - I don't question that. I just know that when it comes to performance, the problems are usually not where one would suspect. I've been bitten by this many times :-)

                        H Offline
                        H Offline
                        Hariprasasth
                        wrote on 31 Oct 2018, 09:48 last edited by Hariprasasth
                        #11

                        @sierdzio I just created simple application to verify performance between static vs shared build:

                        Test application creates screen which contains 60 controls (30 - QPushbutton Icon+Text, 30 - QLabel).

                        Timing:
                        Static build - 1.1 seconds
                        Shared build - 1.5 seconds

                        https://doc.qt.io/archives/qtextended4.4/qt-embedded-performance.html#static-vs-dynamic-linking

                        Thanks,
                        Hari

                        J kshegunovK 2 Replies Last reply 31 Oct 2018, 20:35
                        1
                        • S Offline
                          S Offline
                          sierdzio
                          Moderators
                          wrote on 31 Oct 2018, 10:03 last edited by
                          #12

                          OK, so here the results (both) are pretty decent. I mean 60 controls in less than 2s - that seems good to me. And you have not enabled Link Time Optimizations (right?) which might change the results considerably. It's still just a test app. Results for the final app may vary.

                          Anyway, I'm not saying this to discourage static builds, they are a fine solution, sure.

                          (Z(:^

                          1 Reply Last reply
                          0
                          • H Hariprasasth
                            31 Oct 2018, 09:48

                            @sierdzio I just created simple application to verify performance between static vs shared build:

                            Test application creates screen which contains 60 controls (30 - QPushbutton Icon+Text, 30 - QLabel).

                            Timing:
                            Static build - 1.1 seconds
                            Shared build - 1.5 seconds

                            https://doc.qt.io/archives/qtextended4.4/qt-embedded-performance.html#static-vs-dynamic-linking

                            Thanks,
                            Hari

                            J Online
                            J Online
                            JonB
                            wrote on 31 Oct 2018, 20:35 last edited by
                            #13

                            @Hariprasasth
                            I don't get this. I have read the link you included.

                            So far as I understood it, the time difference in application execution between a dynamically linked vs statically linked would just be a (modest) difference in start-up time. You have one application. Once it's taken 0.4 seconds longer to start-up initially, it shouldn't make any difference whether you create 3 controls, 30 or 300, the code being executed will run at the same speed between the two. Unless there is something special about embedded which I understand nothing about.

                            Am I wrong, or is this a one-time half a second improvement you're talking about?

                            H 1 Reply Last reply 1 Nov 2018, 15:01
                            0
                            • J JonB
                              31 Oct 2018, 20:35

                              @Hariprasasth
                              I don't get this. I have read the link you included.

                              So far as I understood it, the time difference in application execution between a dynamically linked vs statically linked would just be a (modest) difference in start-up time. You have one application. Once it's taken 0.4 seconds longer to start-up initially, it shouldn't make any difference whether you create 3 controls, 30 or 300, the code being executed will run at the same speed between the two. Unless there is something special about embedded which I understand nothing about.

                              Am I wrong, or is this a one-time half a second improvement you're talking about?

                              H Offline
                              H Offline
                              Hariprasasth
                              wrote on 1 Nov 2018, 15:01 last edited by
                              #14

                              @JonB
                              Its not only about start-up. After starting-up, I tried to redraw all the controls on clicking one button. And, still I see the timing difference between static and shared (0.4 sec).

                              Thanks,
                              Hari

                              J 1 Reply Last reply 1 Nov 2018, 15:42
                              0
                              • H Hariprasasth
                                1 Nov 2018, 15:01

                                @JonB
                                Its not only about start-up. After starting-up, I tried to redraw all the controls on clicking one button. And, still I see the timing difference between static and shared (0.4 sec).

                                Thanks,
                                Hari

                                J Online
                                J Online
                                JonB
                                wrote on 1 Nov 2018, 15:42 last edited by
                                #15

                                @Hariprasasth
                                And how would that come about? Would a Qt expert care to comment on how a statically vs dynamically linked set of Qt libraries can perform at different runtime speeds, after start-up?

                                1 Reply Last reply
                                0
                                • H Hariprasasth
                                  31 Oct 2018, 09:48

                                  @sierdzio I just created simple application to verify performance between static vs shared build:

                                  Test application creates screen which contains 60 controls (30 - QPushbutton Icon+Text, 30 - QLabel).

                                  Timing:
                                  Static build - 1.1 seconds
                                  Shared build - 1.5 seconds

                                  https://doc.qt.io/archives/qtextended4.4/qt-embedded-performance.html#static-vs-dynamic-linking

                                  Thanks,
                                  Hari

                                  kshegunovK Offline
                                  kshegunovK Offline
                                  kshegunov
                                  Moderators
                                  wrote on 1 Nov 2018, 16:05 last edited by
                                  #16

                                  @Hariprasasth said in Licensing for Qt Embedded - Static build:

                                  Timing:
                                  Static build - 1.1 seconds
                                  Shared build - 1.5 seconds

                                  Unless you care to provide actual statistics this has no meaning. The uncertainty of one sample is just the square root of the value of said sample, meaning for all intents of purposes those two numbers are equal.

                                  @JonB said in Licensing for Qt Embedded - Static build:

                                  And how would that come about?

                                  It shouldn't.

                                  Would a Qt expert care to comment on how a statically vs dynamically linked set of Qt libraries can perform at different runtime speeds, after start-up?

                                  I'm no expert, but I wouldn't even hazard a guess.

                                  @sierdzio said in Licensing for Qt Embedded - Static build:

                                  Anyway, I'm not saying this to discourage static builds, they are a fine solution, sure.

                                  Maybe in some specific situations, which doesn't seem to be the case here. I'd rather all the KDE apps of the Plasma desktop I'm running link dynamically (and to the same library), instead of each bundling a copy of the same thing. Also the OS's loader can optimize loading dynamic libraries (i.e. they may already be in memory), which it can never do when you link statically.
                                  So a "fine solution" is already pushing it a bit.

                                  Read and abide by the Qt Code of Conduct

                                  J 1 Reply Last reply 1 Nov 2018, 16:09
                                  1
                                  • kshegunovK kshegunov
                                    1 Nov 2018, 16:05

                                    @Hariprasasth said in Licensing for Qt Embedded - Static build:

                                    Timing:
                                    Static build - 1.1 seconds
                                    Shared build - 1.5 seconds

                                    Unless you care to provide actual statistics this has no meaning. The uncertainty of one sample is just the square root of the value of said sample, meaning for all intents of purposes those two numbers are equal.

                                    @JonB said in Licensing for Qt Embedded - Static build:

                                    And how would that come about?

                                    It shouldn't.

                                    Would a Qt expert care to comment on how a statically vs dynamically linked set of Qt libraries can perform at different runtime speeds, after start-up?

                                    I'm no expert, but I wouldn't even hazard a guess.

                                    @sierdzio said in Licensing for Qt Embedded - Static build:

                                    Anyway, I'm not saying this to discourage static builds, they are a fine solution, sure.

                                    Maybe in some specific situations, which doesn't seem to be the case here. I'd rather all the KDE apps of the Plasma desktop I'm running link dynamically (and to the same library), instead of each bundling a copy of the same thing. Also the OS's loader can optimize loading dynamic libraries (i.e. they may already be in memory), which it can never do when you link statically.
                                    So a "fine solution" is already pushing it a bit.

                                    J Online
                                    J Online
                                    JonB
                                    wrote on 1 Nov 2018, 16:09 last edited by JonB 11 Jan 2018, 16:09
                                    #17

                                    @kshegunov said in Licensing for Qt Embedded - Static build:

                                    @JonB said in Licensing for Qt Embedded - Static build:

                                    And how would that come about?

                                    It shouldn't.

                                    Thank you! My point being, from my understanding and usage of static vs dynamic, there should only be a difference at start-up time, once it's in memory there should not be any difference at runtime. And if the OP's statistics of 50%-odd difference is true/replicated, I would expect everyone to have abandoned/complained about dynamic a long time ago!

                                    kshegunovK 1 Reply Last reply 1 Nov 2018, 16:12
                                    0
                                    • J JonB
                                      1 Nov 2018, 16:09

                                      @kshegunov said in Licensing for Qt Embedded - Static build:

                                      @JonB said in Licensing for Qt Embedded - Static build:

                                      And how would that come about?

                                      It shouldn't.

                                      Thank you! My point being, from my understanding and usage of static vs dynamic, there should only be a difference at start-up time, once it's in memory there should not be any difference at runtime. And if the OP's statistics of 50%-odd difference is true/replicated, I would expect everyone to have abandoned/complained about dynamic a long time ago!

                                      kshegunovK Offline
                                      kshegunovK Offline
                                      kshegunov
                                      Moderators
                                      wrote on 1 Nov 2018, 16:12 last edited by kshegunov 11 Jan 2018, 16:16
                                      #18

                                      @JonB said in Licensing for Qt Embedded - Static build:

                                      My point being, from my understanding and usage of static vs dynamic, there should only be a difference at start-up time, once it's in memory there should not be any difference at runtime.

                                      No not only, but the difference should be negligible to non-existent. Probably the "major" hit comes from generating cache misses (due to indirect references) when the CPU is executing the code. I'm going to say it again, though, this should be so insignificant in this kind of code that I wouldn't even venture into considering it.

                                      PS.
                                      Some related resources if you're feeling curious.

                                      Read and abide by the Qt Code of Conduct

                                      S 1 Reply Last reply 2 Nov 2018, 05:48
                                      0
                                      • kshegunovK kshegunov
                                        1 Nov 2018, 16:12

                                        @JonB said in Licensing for Qt Embedded - Static build:

                                        My point being, from my understanding and usage of static vs dynamic, there should only be a difference at start-up time, once it's in memory there should not be any difference at runtime.

                                        No not only, but the difference should be negligible to non-existent. Probably the "major" hit comes from generating cache misses (due to indirect references) when the CPU is executing the code. I'm going to say it again, though, this should be so insignificant in this kind of code that I wouldn't even venture into considering it.

                                        PS.
                                        Some related resources if you're feeling curious.

                                        S Offline
                                        S Offline
                                        sierdzio
                                        Moderators
                                        wrote on 2 Nov 2018, 05:48 last edited by sierdzio 11 Feb 2018, 05:49
                                        #19

                                        @kshegunov said in Licensing for Qt Embedded - Static build:

                                        @JonB said in Licensing for Qt Embedded - Static build:
                                        PS.
                                        Some related resources if you're feeling curious.

                                        Quoting from there:

                                        Instructions that refer directly to specific memory addresses sometimes
                                        execute faster, and replacing them with equivalent relative-addressing
                                        instructions may result in slightly slower execution, although modern
                                        processors make the difference practically negligible.

                                        Here we are talking about a very weak CPU with very slow memory (104 MHz RAM according to the specification). It may well prefer static builds.

                                        I'd still throw in LTO is the compiler for that CPU supports it (see link).

                                        You are, of course, absolutely right that a statistical analysis of the results is necessary for proper judgement, though.

                                        (Z(:^

                                        1 Reply Last reply
                                        0

                                        1/19

                                        30 Oct 2018, 14:19

                                        • Login

                                        • Login or register to search.
                                        1 out of 19
                                        • First post
                                          1/19
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • Users
                                        • Groups
                                        • Search
                                        • Get Qt Extensions
                                        • Unsolved