MantisBT - CMake
View Issue Details
0006399CMakeModulespublic2008-02-21 00:382016-06-10 14:30
Philip Lowman 
Kitware Robot 
normalfeaturealways
closedmoved 
 
 
0006399: FindPthreads.cmake module
Attached is a FindPthreads.cmake module. Please see background at now closed Bug 0006339. Use of this module would be encouraged by developers who:

1.) Only care about pthreads
2.) Are using Pthreads-Win32 with either MSVC or MinGW (and thus only care about pthreads)

Module uses FIND_PACKAGE_HANDLE_STANDARD_ARGS() and as far as I now compiles with CMake module submission criteria (if not please let me know what's wrong).
No tags attached.
? FindPthreads.cmake (3,174) 2008-02-21 00:38
https://public.kitware.com/Bug/file/1319/FindPthreads.cmake
? FindThreads.cmake (8,524) 2009-09-20 10:48
https://public.kitware.com/Bug/file/2468/FindThreads.cmake
Issue History
2008-02-21 00:38Philip LowmanNew Issue
2008-02-21 00:38Philip LowmanFile Added: FindPthreads.cmake
2008-02-21 12:11Alex NeundorfStatusnew => assigned
2008-02-21 12:11Alex NeundorfAssigned To => Alex Neundorf
2008-05-09 14:10Philip LowmanNote Added: 0011778
2008-08-29 20:13Philip LowmanNote Added: 0013244
2009-09-12 03:24Alex NeundorfNote Added: 0017407
2009-09-12 03:24Alex NeundorfAssigned ToAlex Neundorf => Philip Lowman
2009-09-20 10:48Philip LowmanFile Added: FindThreads.cmake
2009-09-20 10:50Philip LowmanNote Added: 0017660
2011-05-26 00:40Philip LowmanAssigned ToPhilip Lowman =>
2011-07-06 11:53David ColeAssigned To => David Cole
2011-07-06 11:53David ColeStatusassigned => backlog
2011-07-06 11:53David ColeAssigned ToDavid Cole =>
2013-08-10 06:03danielkaneiderNote Added: 0033693
2013-08-10 06:09Andreas Schneider.Note Added: 0033694
2016-06-10 14:27Kitware RobotNote Added: 0041411
2016-06-10 14:27Kitware RobotStatusbacklog => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:27Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0011778)
Philip Lowman   
2008-05-09 14:10   
The functionality of this module could be checked into FindThreads.cmake and invoked via an optional variable or turned into FindPthreadsWin32 to prevent Unix users who should be using FindThreads from trying to use it (clearly FindThreads is much better on Unix platforms).
(0013244)
Philip Lowman   
2008-08-29 20:13   
Just pinging this bug, wondering if a decision has been made regarding what to do about the Windows use case (or in the case of a non-Linux UNIX system wanting to use pthreads but that currently defaults to another threading library)?
(0017407)
Alex Neundorf   
2009-09-12 03:24   
Since you submitted the file, I guess it makes sense if I assign this one to you.

In general I think it would be good to improve the current situation we have in cmake.

FindTreads.cmake does a lot, but is not very good documented.
I guess a first step would be to clearly document FindThreads.cmake, which variables it sets, what thread library may have been found etc.

Then it should be clearer whether an additional FindPThreads.cmake makes sense or whether the existing FindThreads.cmake should be extended.

In general I think having a way to say "I want pthreads and not any other threading API" would be a good thing, and I think this is currently with FindThreads.cmake not possible.

Alex
(0017660)
Philip Lowman   
2009-09-20 10:50   
I'm attaching a modified FindThreads with Pthreads-win32 support rolled in. I also updated the documentation with an example I think describes how it is intended to be used.

I tested MinGW, MSVC9, and Linux-gcc. I also tested Cygwin and the module works properly although I can't say the same thing about Cygwin's pthreads implementation. The test code I was using wouldn't survive spawning more than a few threads.

I think your suggestion of forcing pthreads-only might be a useful feature especially on older Unix machines where I get the idea that more than one threading library is often available. At the moment I'm not really in a position to test this, however, so I think I'll leave this to someone else to implement.
(0033693)
danielkaneider   
2013-08-10 06:03   
any update on this bug? pthread support would be interesting with VC compilers
(0033694)
Andreas Schneider.   
2013-08-10 06:09   
I think the Modules are outdated. If someone will try to add updated versions we should try to add a better version.
(0041411)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.