Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved Simd features on specific files - cannot enable exceptions

    General and Desktop
    2
    10
    1720
    Loading More Posts
    • 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.
    • manoh
      manoh last edited by

      Hi,

      i want to enable sse and avx just for specific source files. This works, but i'm using on some other files exceptions and i cannot prevent qmake to not generate CXXFlags with -fno_exceptions. If i delete -fno_expcetions at the generated makefile the static lib does compile at all.

      My pro-file looks like this:

      # target should be a non-qt static lib
      CONFIG -= qt
      CONFIG += staticlib
      CONFIG += warn_on c++11 debug_and_release exceptions simd
      
      TEMPLATE = lib
      TAREGET = mylibrary
      
      INCLUDEPATH += include 
      
      SSE2_SOURCES += fooSse2.cpp
      
      AVX2_SOURCES +=fooAvx2.cpp
      
      SOURCES += bar.cpp
      

      Does somebody know why i cannot enable exceptions???

      kshegunov 1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @manoh last edited by kshegunov

        @manoh
        I don't think this flag is at all relevant for static libraries. What happens when you actually link the static lib with CONFIG += exceptions ion your project?

        Read and abide by the Qt Code of Conduct

        manoh 1 Reply Last reply Reply Quote 0
        • manoh
          manoh @kshegunov last edited by

          @kshegunov

          The static lib does not compile: -fno_exceptions

          Compiler output:

          /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -fPIC -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wall -W -fno-exceptions -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../lib/libimagedecoder -I. -I../../../lib/include -I../../../lib/src -I../../../lib/other_headers -I/usr/local/opt/openssl/include -I/Users/asdf/Qt/5.6/clang_64/mkspecs/macx-clang -o .obj/IImageDecoder.o ../../../lib/foo.cpp
          ../../../lib/foo.cpp:123:6: error: cannot use 'throw' with
                exceptions disabled
                                                  throw std::invalid_argument("The given arguments to ..."
                                                  ^
          ../../../lib/foo.cpp:203:6: error: cannot use 'throw' with
                exceptions disabled
                                                  throw std::invalid_argument("The given arguments to ..."
                                                  ^
          2 errors generated.
          
          kshegunov 1 Reply Last reply Reply Quote 0
          • kshegunov
            kshegunov Moderators @manoh last edited by

            @manoh said:

            The static lib does not compile: -fno_exceptions

            I see. Perhaps I'm in error, it's been known to happen. They should be enabled by default (as per the qmake docs`), but try something like this:

            CONFIG -= qt exceptions_off
            CONFIG += staticlib
            CONFIG += warn_on c++11 debug_and_release exceptions simd
            

            As a side question, what version of Qt (hence qmake) are you using?

            Kind regards.

            Read and abide by the Qt Code of Conduct

            manoh 1 Reply Last reply Reply Quote 1
            • manoh
              manoh @kshegunov last edited by manoh

              @kshegunov

              Thanks for answers!

              I tried this before i wrote my first post and this does not work :-( I think i have to write a custom compiler (after the weekend).

              $ qmake -v
              QMake version 3.0
              Using Qt version 5.6.0 in /Users/asdf/Qt/5.6/clang_64/lib
              
              kshegunov 1 Reply Last reply Reply Quote 0
              • kshegunov
                kshegunov Moderators @manoh last edited by

                @manoh
                I can reproduce this on Linux, so it's probably a bug in qmake. Do you mind reporting it on the bugtracker?

                Read and abide by the Qt Code of Conduct

                manoh 1 Reply Last reply Reply Quote 0
                • manoh
                  manoh @kshegunov last edited by

                  @kshegunov

                  I'm not sure if this is bug or if i cannot use simd config-option this way.

                  kshegunov 1 Reply Last reply Reply Quote 0
                  • kshegunov
                    kshegunov Moderators @manoh last edited by kshegunov

                    @manoh
                    I didn't use simd for my tests, only the excetpions/exceptions_off options.

                    I'm just getting forgetful in my old age. I did use simd, removing it fixes the issue. Where did that configuration option came from anyway?

                    Read and abide by the Qt Code of Conduct

                    manoh 1 Reply Last reply Reply Quote 0
                    • manoh
                      manoh @kshegunov last edited by

                      @kshegunov
                      I searched on the internet and read some threads, documentation and source code...
                      At least i was grepping at Qt/5.6/Src/qtbase/src/gui for simd
                      There is QMAKESPEC file at mkspecs/features/simd.prf

                      kshegunov 1 Reply Last reply Reply Quote 0
                      • kshegunov
                        kshegunov Moderators @manoh last edited by kshegunov

                        @manoh
                        To be honest I don't know if this is a bug, or expected behaviour. I advise asking on the interest mailing list how/if you can use that config option. Sorry, I couldn't be of more help.

                        Kind regards.

                        Read and abide by the Qt Code of Conduct

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post