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?
QtWS25 Last Chance

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 6 Apr 2018, 11:46 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!

    J 1 Reply Last reply 6 Apr 2018, 12:36
    0
    • S SergeyK12
      6 Apr 2018, 11:46

      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!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 6 Apr 2018, 12:36 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 8 Apr 2018, 08:45
      2
      • J jsulm
        6 Apr 2018, 12:36

        @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 8 Apr 2018, 08:45 last edited by SergeyK12 4 Aug 2018, 08:46
        #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

        A 1 Reply Last reply 8 Apr 2018, 15:05
        0
        • S SergeyK12
          8 Apr 2018, 08:45

          @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

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 8 Apr 2018, 15:05 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 8 Apr 2018, 20:28 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)

            A 1 Reply Last reply 9 Apr 2018, 04:18
            0
            • S SergeyK12
              8 Apr 2018, 20:28

              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)

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 9 Apr 2018, 04:18 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

              3/6

              8 Apr 2018, 08:45

              • Login

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