Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Where is compiler optimization turned off/on?
QtWS25 Last Chance

Where is compiler optimization turned off/on?

Scheduled Pinned Locked Moved Qt Creator and other tools
12 Posts 5 Posters 14.3k Views
  • 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    I might want to play with this; can someone tell me where in the preferences I can find it?

    Thanks.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Play with them for Qt libraries or for your libraries?

      For Qt build, they are set in $(QTDIR)\mkspecs<your compiler>\qmake.conf

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Check the qmake Variable Reference documentation, and look for the entry on QMAKE_CXXFLAGS.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          [quote author="Andre" date="1300439484"]Check the qmake Variable Reference documentation, and look for the entry on QMAKE_CXXFLAGS.[/quote]

          This is only valid, if you want to play with optimization in your executable. And then you have to take care, that they fit to Qt binaries.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by
            #5

            [quote author="Gerolf" date="1300438870"]Play with them for Qt libraries or for your libraries?

            For Qt build, they are set in $(QTDIR)\mkspecs<your compiler>\qmake.conf[/quote]

            Thanks, Gerolf. This would be for my own programs; I'm not trying to change any Qt code.

            Since you pointed me to a file, do I gather correctly that changing these values is done directly with file manipulation, and not via a Qt interface?

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              yes, but manipulating these files is for tunig Qt itself, not your binaries.
              To tune yout binaries, look at Andre's post.
              You ahve to deal with qmake project files.

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply
              0
              • mzimmersM Offline
                mzimmersM Offline
                mzimmers
                wrote on last edited by
                #7

                OK, I'll dig up the documentation and take a look. Thanks, Gerolf.

                EDIT:

                You know, it just occurred to me that I probably should have asked this question differently -- are the optimization options something that typically cause issues for "ordinary" developers?

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  The default optimization settings for the release target are usually sufficient. I would not bother fiddling around with them unless you are doing some really heavy number crunching or multimedia decoding or the like.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • mzimmersM Offline
                    mzimmersM Offline
                    mzimmers
                    wrote on last edited by
                    #9

                    Oh, I'm sure they're fine for the release build. I was more thinking about whether optimization is fully disabled for debug builds. I was having some weird stuff happen, and thought it was worth a look to make sure that optimization was off for debug.

                    Thanks...

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      "-O2" only appears in the the QMAKE_CFLAGS_RELEASE and QMAKE_CXXFLAGS_RELEASE config variables.

                      So, from a short look, optimization should be off in all debug settings.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • mzimmersM Offline
                        mzimmersM Offline
                        mzimmers
                        wrote on last edited by
                        #11

                        Thanks, Volker. I'm sure the weirdness I was seeing was cockpit error, then.

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          ZapB
                          wrote on last edited by
                          #12

                          The default debug flags are simply "-g" which is set for QMAKE_CFLAGS_DEBUG and QMAKE_CXXFLAGS_DEBUG.

                          Nokia Certified Qt Specialist
                          Interested in hearing about Qt related work

                          1 Reply Last reply
                          0

                          • Login

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