qTCreator + MSVC 2017 how to enable openMP?
-
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 fileLIBS += -openmp
QMAKE_CXXFLAGS += -openmpand 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!
-
@SergeyK12 said in qTCreator + MSVC 2017 how to enable openMP?:
LIBS += -openmp
What's that?
It should beLIBS += -LPATH_TO_DIRECTORY_CONTAINING_LIB -lopenmp
-
-
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 += -lopenmpbut 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) -
@SergeyK12 I'm pretty sure the cxxflags have no 'l' after '-':
QMAKE_CXXFLAGS+=-openmp
disclaimer: written from my phone without possibility to test it.