View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011019CMakeModulespublic2010-07-21 08:462010-11-09 22:57
ReporterTom Vercauteren 
Assigned ToPhilip Lowman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.3Fixed in VersionCMake 2.8.3 
Summary0011019: FindBoost: Potential incoherent behavior when BOOST_ROOT is set and there is a boost installation in system directories
DescriptionThis is a duplicate of bug 9447 but since I am not the initial reporter, I cannot reopen it.

I have a system installation of boost 1.40 for my package manager on ubuntu but want my project to be compiled against a local boost package (version 1.42).

By default, If I only specify BOOST_ROOT, FindBoost will get the include dir correctly but will take the libraries from /usr/lib.

The reason is because my local boost copy does not have the "-mt" libraries, e.g.
- local has libboost_regex.a libboost_regex.so libboost_regex.so.1.42.0
- system has /usr/lib/libboost_regex.a /usr/lib/libboost_regex-mt.so /usr/lib/libboost_regex.so.1.40.0 /usr/lib/libboost_regex-mt.a /usr/lib/libboost_regex.so

Setting Boost_USE_MULTITHREADED to OFF solves the problem.

I do however still consider this to be a bug since no warning is issued and the advice in bug 9447 did not solve my problem.
Additional InformationI had the following output with Boost_DEBUG:

-- [ BLABLA/FindBoost.cmake:373 ] Boost not in cache
-- [ BLABLA/FindBoost.cmake:376 ] _boost_TEST_VERSIONS = 1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ BLABLA/FindBoost.cmake:378 ] Boost_USE_MULTITHREADED = TRUE
-- [ BLABLA/FindBoost.cmake:380 ] Boost_USE_STATIC_LIBS =
-- [ BLABLA/FindBoost.cmake:439 ] Declared as CMake or Environmental Variables:
-- [ BLABLA/FindBoost.cmake:441 ] BOOST_ROOT = /usr/local/mkt-dev/install/boost_1_42_0
-- [ BLABLA/FindBoost.cmake:443 ] BOOST_INCLUDEDIR =
-- [ BLABLA/FindBoost.cmake:445 ] BOOST_LIBRARYDIR =
-- [ BLABLA/FindBoost.cmake:447 ] _boost_TEST_VERSIONS = 1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ BLABLA/FindBoost.cmake:496 ] Include debugging info:
-- [ BLABLA/FindBoost.cmake:498 ] _boost_INCLUDE_SEARCH_DIRS = /usr/local/mkt-dev/install/boost_1_42_0/include;/usr/local/mkt-dev/install/boost_1_42_0;C:/boost/include;C:/boost;/boost/include;/boost;/sw/local/include
-- [ BLABLA/FindBoost.cmake:500 ] _boost_PATH_SUFFIXES = boost-1_41_0;boost-1_41;boost-1_40_0;boost-1_40;boost-1_39_0;boost-1_39;boost-1_38_0;boost-1_38;boost-1_37_0;boost-1_37;boost-1_36_1;boost-1_36_0;boost-1_36;boost-1_35_1;boost-1_35_0;boost-1_35;boost-1_34_1;boost-1_34_0;boost-1_34;boost-1_33_1;boost-1_33_0;boost-1_33
-- [ BLABLA/FindBoost.cmake:524 ] location of version.hpp: /usr/local/mkt-dev/install/boost_1_42_0/include/boost/version.hpp
-- [ BLABLA/FindBoost.cmake:543 ] version.hpp reveals boost 1.42.0
-- [ BLABLA/FindBoost.cmake:634 ] guessed _boost_COMPILER = -gcc44
-- [ BLABLA/FindBoost.cmake:644 ] _boost_MULTITHREADED = -mt
-- [ BLABLA/FindBoost.cmake:661 ] _boost_STATIC_TAG =
-- [ BLABLA/FindBoost.cmake:663 ] _boost_ABI_TAG = d
-- [ BLABLA/FindBoost.cmake:696 ] _boost_LIBRARIES_SEARCH_DIRS = /usr/local/mkt-dev/install/boost_1_42_0/lib;/usr/local/mkt-dev/install/boost_1_42_0/stage/lib;/usr/local/mkt-dev/install/boost_1_42_0/include/lib;/usr/local/mkt-dev/install/boost_1_42_0/include/../lib;C:/boost/lib;C:/boost;/boost/boost_1_42_0/lib;/boost/boost_1_42/lib;/boost/lib;/boost;/sw/local/lib
-- [ BLABLA/FindBoost.cmake:830 ] Boost_FOUND = TRUE
-- Boost version: 1.42.0
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- iostreams
-- program_options
-- regex
-- serialization
-- signals
-- system
-- thread
-- unit_test_framework
-- python
Tagsboost
Attached Files

 Relationships
duplicate of 0008412closedPhilip Lowman Setting BOOST_ROOT does not guarantee boost libraries detected outside BOOST_ROOT are the correct ones 

  Notes
(0021724)
Philip Lowman (developer)
2010-08-11 23:48

If you want FindBoost to discover boost libraries without -mt, the proper thing to do is to set Boost_USE_MULTITHREADED to OFF (it defaults to ON if it's not set).

The issue of FindBoost searching outside of BOOST_ROOT if it can't find stuff there first is how it was written. I'm pretty sure this was intentional but I'm not positive since I wasn't the author. I don't think it can be safely changed now. Would it help if I added an option that excludes searching outside of the BOOST_ROOT directory completely? This way people could enable it if they are 100% sure they don't want their builds using a system boost library?
(0021725)
Tom Vercauteren (reporter)
2010-08-12 01:32

Being able to constrain the search in BOOST_ROOT would definitely be a good thing.

Also, it would be nice if a warning was issued when the include and libraries are found in different directories. This may help avoid weird situations when the boost versions are different in these directories.

What I forgot to mention is that even when Boost_USE_MULTITHREADED is not set (i.e. it is ON), FindBoost was able to find my local boost libraries (without the -mt suffix) as long as no system installation of Boost was available.
(0021818)
Philip Lowman (developer)
2010-08-18 23:26

Ok. To resolve this then (don't have time this moment so I'm logging this here for later).

1. I will add constrain support to FindBoost (optionally enabled via a variable)

2. I will try to come up with a way to determine if the detected libraries are totally outside the boost install path. Issuing a warning seems reasonable in this case. This code would need to be well tested and probably would be best if the warning only occurred once.

3. I will try to reproduce your case where single-threaded boost libraries are present only and FindBoost locates them.
(0022154)
Philip Lowman (developer)
2010-09-08 23:43

Will be fixed with Boost_NO_SYSTEM_PATHS
(0022202)
Philip Lowman (developer)
2010-09-12 22:31

Fix will be in CMake 2.8.3 RC1

 Issue History
Date Modified Username Field Change
2010-07-21 08:46 Tom Vercauteren New Issue
2010-07-21 08:47 Tom Vercauteren Tag Attached: boost
2010-08-11 23:42 Philip Lowman Status new => assigned
2010-08-11 23:42 Philip Lowman Assigned To => Philip Lowman
2010-08-11 23:48 Philip Lowman Note Added: 0021724
2010-08-12 01:32 Tom Vercauteren Note Added: 0021725
2010-08-18 23:26 Philip Lowman Note Added: 0021818
2010-09-08 23:43 Philip Lowman Note Added: 0022154
2010-09-10 08:40 Philip Lowman ETA none => < 1 day
2010-09-10 08:40 Philip Lowman Target Version => CMake 2.8.3
2010-09-12 22:31 Philip Lowman Note Added: 0022202
2010-09-12 22:31 Philip Lowman Relationship added duplicate of 0008412
2010-09-12 22:31 Philip Lowman Duplicate ID 0 => 8412
2010-09-12 22:31 Philip Lowman Status assigned => resolved
2010-09-12 22:31 Philip Lowman Fixed in Version => CMake 2.8.3
2010-09-12 22:31 Philip Lowman Resolution open => fixed
2010-11-09 22:57 Philip Lowman Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team