Ticket #296 (defect)
Opened 2 months ago
TPB scheduling on MinGW requires -mthreads
Status: new
| Reported by: | dward | Assigned to: | jcorgan |
|---|---|---|---|
| Priority: | normal | Milestone: | to-be-decided |
| Component: | build | Version: | 3.1svn |
| Keywords: | mingw | Cc: | don2387ward@sprynet.com |
Not really a bug, but definitely a portability issue:
Exception handling in multi-threaded code (e.g., thread-per-block scheduling) on MinGW requires that the -mthreads option to g++ be specified when compiling and linking C++ code. This sets internal defines during compilation and selects needed libraries when linking. When libtool is used, -mthreads must be specified as part of CXX during libtool configuration in order to generate the required library dependencies.
At present, we must set CXX="g++ -mthreads" before running ./configure on MinGW. It would be nice if this could be done automatically as a part of the configuration process, but if there is no neat way to do this we can still users to set it manually. Note that the -mthreads option is (by definition) specific to MinGW and has no effect on any other platform.
Feel free to change this to an enhancement request if appropriate.
