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. qTCreator + MSVC 2017 how to enable openMP?

qTCreator + MSVC 2017 how to enable openMP?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 3 Posters 3.4k 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.
  • S Offline
    S Offline
    SergeyK12
    wrote on last edited by
    #1

    Hi!
    I'm trying to compile my openMP console application with MSVC2017 in qtCreator and nothing happened. I mean my application working in a single thread regime. When my colleague compile it with MinGW everything was fine.
    I almost try to add to *.pro file

    LIBS += -openmp
    QMAKE_CXXFLAGS += -openmp

    and other variants which i found in the internet.
    Could it be a problem with MSVC or qtCreator? Is it possible to use openMP with MSVC in qtCreator?

    Thanks for your reply!

    jsulmJ 1 Reply Last reply
    0
    • S SergeyK12

      Hi!
      I'm trying to compile my openMP console application with MSVC2017 in qtCreator and nothing happened. I mean my application working in a single thread regime. When my colleague compile it with MinGW everything was fine.
      I almost try to add to *.pro file

      LIBS += -openmp
      QMAKE_CXXFLAGS += -openmp

      and other variants which i found in the internet.
      Could it be a problem with MSVC or qtCreator? Is it possible to use openMP with MSVC in qtCreator?

      Thanks for your reply!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @SergeyK12 said in qTCreator + MSVC 2017 how to enable openMP?:

      LIBS += -openmp

      What's that?
      It should be

      LIBS += -LPATH_TO_DIRECTORY_CONTAINING_LIB -lopenmp
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      2
      • jsulmJ jsulm

        @SergeyK12 said in qTCreator + MSVC 2017 how to enable openMP?:

        LIBS += -openmp

        What's that?
        It should be

        LIBS += -LPATH_TO_DIRECTORY_CONTAINING_LIB -lopenmp
        
        S Offline
        S Offline
        SergeyK12
        wrote on last edited by SergeyK12
        #3

        @jsulm
        Thanks for your reply,
        It should be like this?
        LIBS += -"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\lib\x64" -lopenmp
        QMAKE_CXXFLAGS += -lopenmp

        it is also not working

        aha_1980A 1 Reply Last reply
        0
        • S SergeyK12

          @jsulm
          Thanks for your reply,
          It should be like this?
          LIBS += -"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\lib\x64" -lopenmp
          QMAKE_CXXFLAGS += -lopenmp

          it is also not working

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @SergeyK12

          it is LIBS+=-L"...path..."

          not sure how the cxxflags has to be given.

          Qt has to stay free or it will die.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            SergeyK12
            wrote on last edited by
            #5

            Hi. Thanks for your advise.
            I'm trying the following in various variations:

            LIBS +=-L"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\lib\x64" -lopenmp
            or
            LIBS += -L"C:/Qt/5.9.2/msvc2017_64/lib" -lopenmp
            QMAKE_CXXFLAGS += -lopenmp

            but still no reaction from builded exe (its still single core)
            I almost try to build my project with MinGW and it is worked correctly, no problem (it is only 2 times slower in a sigle thread, and could reach MSVC speed with 3 threads on 4 cores CPU, it is only intention to use MSVC)

            aha_1980A 1 Reply Last reply
            0
            • S SergeyK12

              Hi. Thanks for your advise.
              I'm trying the following in various variations:

              LIBS +=-L"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\lib\x64" -lopenmp
              or
              LIBS += -L"C:/Qt/5.9.2/msvc2017_64/lib" -lopenmp
              QMAKE_CXXFLAGS += -lopenmp

              but still no reaction from builded exe (its still single core)
              I almost try to build my project with MinGW and it is worked correctly, no problem (it is only 2 times slower in a sigle thread, and could reach MSVC speed with 3 threads on 4 cores CPU, it is only intention to use MSVC)

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @SergeyK12 I'm pretty sure the cxxflags have no 'l' after '-': QMAKE_CXXFLAGS+=-openmp

              disclaimer: written from my phone without possibility to test it.

              Qt has to stay free or it will die.

              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