I have a qmake project developed on windows that uses openmp and I want to build it on macOS. I followed this instruction How to compile with OpenMP in Qt on macOS?
adding the following to my .pro file:
win32: {
QMAKE_CXXFLAGS+= -fopenmp
QMAKE_LFLAGS += -fopenmp
}
unix:!macx {
QMAKE_CXXFLAGS+= -fopenmp
QMAKE_LFLAGS += -fopenmp
}
macx: {
QMAKE_CXXFLAGS += -Xpreprocessor -fopenmp -lomp -I/usr/local/include
QMAKE_LFLAGS += -lomp
LIBS += -L /usr/local/lib /usr/local/lib/libomp.dylib
}
But I'm getting this error.
Compiler feature detection failure!
The command "/usr/bin/clang++ -stdlib=libc++ -fopenmp -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -fPIC -x c++ -E -v - -target x86_64-apple-darwin19.4.0" terminated with exit code 1.
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: error: unsupported option '-fopenmp'
As far as I understand this message I have something missing on my system but I can't figure out what