View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011121CMakeModulespublic2010-08-12 07:282010-11-09 22:57
ReporterSam Morris 
Assigned ToPhilip Lowman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.3Fixed in VersionCMake 2.8.3 
Summary0011121: FindBoost does not find boost_thread libraries containing explicit THREADAPI
DescriptionWhen building boost it generated the following library files:

libboost_thread_win32-mgw45-mt-1_43.a
libboost_thread_win32-mgw45-mt-1_43.dll
libboost_thread_win32-mgw45-mt-1_43.dll.a
libboost_thread_win32-mgw45-mt.a
libboost_thread_win32-mgw45-mt.dll.a

FindBoost.cmake does not work when called with the thread component, however, because it does not expect to see _win32 inserted into the filename.

I had to make symlinks such as 'libboost_thread-mgw45-mt.dll.a' to get it to work.
Additional InformationI'm cross-compiling boost with the following command:

bjam --with-thread --layout=versioned toolset=gcc target-os=windows threadapi=win32

Without setting threadapi Boost tries to use pthreads by default. I guess this is because it tries to guess the default threadapi value based on the build system and not the host system. Setting threadapi manually causes Boost to think it's not being set to the default value and hence it changes the name of the library file.

This exact detail may be a Boost issue, however CMake should be able to configure projects to link against boost_thread with a non-default threadapi.
TagsNo tags attached.
Attached Files? file icon FindBoost.cmake.6 [^] (54,303 bytes) 2010-09-08 23:33

 Relationships

  Notes
(0022128)
Philip Lowman (developer)
2010-09-08 02:03

I'm having problems finding any documentation for Boost on this threadapi parameter and what generated filenames are.

Is it true to say that "libboost_thread-<compiler>-<mt>..." is always pthreads and "libboost_thread_win32-<compiler>-<mt>..." is always win32 threads?
(0022130)
Sam Morris (reporter)
2010-09-08 04:58

Yes I don't think there is any documentation.

IME, it's more like:

  libboost_thread-<compiler>-<mt>(-<threadapi>)

where the portion in the parentheses only appears if the chosen threadapi is not the default for the platform. The oddity is that I'm cross compiling on a POSIX system, so the build system seems to think I should be using pthreads by default.
(0022131)
Philip Lowman (developer)
2010-09-08 09:00

I assume you can compile boost-thread against pthreads-win32 or Windows Threads with MinGW (or will one day if this isn't possible)?

I can add a variable called Boost_THREADAPI that if set causes FindBoost to search for the following if it encounters the thread component.
libboost_thread-<compiler>-<mt>(-<threadapi>)

The only question would be should we fall back on the version of the non <threadapi> if the variable is set.
(0022151)
Philip Lowman (developer)
2010-09-08 23:35

Could you please try the version of FindBoost I just uploaded (and set Boost_THREADAPI) to see if it fixes your problems?

I did check and Boost.Thread seems to support pthreads-win32 from the look of it's Bjam config files. Since there is no way for us to know which thread api the user actually wants to link against, the variable seems the best solution for now.
(0022197)
Philip Lowman (developer)
2010-09-12 22:28

Fix will be in CMake 2.8.3 RC1

 Issue History
Date Modified Username Field Change
2010-08-12 07:28 Sam Morris New Issue
2010-08-19 08:22 Philip Lowman Status new => assigned
2010-08-19 08:22 Philip Lowman Assigned To => Philip Lowman
2010-09-08 02:03 Philip Lowman Note Added: 0022128
2010-09-08 04:58 Sam Morris Note Added: 0022130
2010-09-08 09:00 Philip Lowman Note Added: 0022131
2010-09-08 23:33 Philip Lowman File Added: FindBoost.cmake.6
2010-09-08 23:35 Philip Lowman Note Added: 0022151
2010-09-10 08:41 Philip Lowman ETA none => < 1 day
2010-09-10 08:41 Philip Lowman Target Version => CMake 2.8.3
2010-09-10 08:41 Philip Lowman Summary FindBoost does not work with DLLs with 'lib' filename prefix => FindBoost does not find boost_thread libraries containing explicit THREADAPI
2010-09-12 22:28 Philip Lowman Note Added: 0022197
2010-09-12 22:28 Philip Lowman Status assigned => resolved
2010-09-12 22:28 Philip Lowman Fixed in Version => CMake 2.8.3
2010-09-12 22:28 Philip Lowman Resolution open => fixed
2010-11-09 22:57 Philip Lowman Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team