PDA

View Full Version : QThread and OpenMP on Mac problem



Debilski
7th April 2009, 18:41
Hi,
I was about to implement a threaded Qt-based Gui for another library, which uses OpenMP.
However, I found that on Mac OS X 10.5.6 [gcc: i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5566)] it crashes on entering the OpenMP parts.
Coincidentally, I found an example on the internet, which has the same problem:
http://sire.googlecode.com/svn-history/r639/corelib/branches/users/chryswoods/techdocs/test_openmp_and_qthread.cpp (http://sire.googlecode.com/svn-history/r639/corelib/branches/users/chryswoods/techdocs/test_openmp_and_qthread.cpp)
Standard qmake with additional


QMAKE_CXXFLAGS += -fopenmp
LIBS += -lgomp
should do.
On Linux (gcc 4.3.1), there is no such problem whatsoever.
Could this be a bug in either Qt or OpenMP or gcc, or is it a known problem that QThread and OpenMP are mutually exclusive?

/rike