MantisBT - CMake
View Issue Details
0015270CMakeCMakepublic2014-11-30 16:182015-05-04 09:05
pavel.odintsov 
 
highmajoralways
closedno change required 
LinuxCentOS 6up to date
 
 
0015270: cmake can't find Boost libs at CentOS 6 correctly
Hello!

I tried to use find_package capability for my project: https://github.com/FastVPSEestiOu/fastnetmon/blob/master/CMakeLists.txt [^]

It work perfectly at Debian 7 Wheezy with 2.8.9-1.

But I got this critical errors on CentOS 6 with modern cmake-2.8.12.2-4.el6.x86_64:

cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist. Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib64/boost/BoostConfig.cmake:28 (include)
  /usr/share/cmake/Modules/FindBoost.cmake:177 (find_package)
  CMakeLists.txt:30 (find_package)


-- Configuring incomplete, errors occurred!
See also "/usr/src/fastnetmon/build/CMakeFiles/CMakeOutput.log".

Please help me...
No tags attached.
Issue History
2014-11-30 16:18pavel.odintsovNew Issue
2014-11-30 16:34Roger LeighNote Added: 0037314
2014-11-30 16:50pavel.odintsovNote Added: 0037315
2014-12-01 02:28Nils GladitzNote Added: 0037316
2014-12-01 03:18pavel.odintsovNote Added: 0037317
2014-12-01 11:12Brad KingStatusnew => resolved
2014-12-01 11:12Brad KingResolutionopen => no change required
2014-12-27 02:38mircleNote Added: 0037529
2014-12-27 06:45pavel.odintsovNote Added: 0037530
2014-12-27 18:35Roger LeighNote Added: 0037532
2015-05-04 09:05Robert MaynardNote Added: 0038712
2015-05-04 09:05Robert MaynardStatusresolved => closed

Notes
(0037314)
Roger Leigh   
2014-11-30 16:34   
The version of Boost provided by CentOS6 is too old to work with the cmake FindBoost macros. On my CentOS6 systems, I had to install a more recent version of Boost, after which it worked fine.


Regards,
Roger
(0037315)
pavel.odintsov   
2014-11-30 16:50   
Hello!

Maybe you right, but my project compiled by users and rebuilding Boost from sources is not an trivial part of standard install process =(
(0037316)
Nils Gladitz   
2014-12-01 02:28   
Try setting Boost_NO_BOOST_CMAKE [1] from the command line or if need be in the project with set(Boost_NO_BOOST_CMAKE ON) before your call to find_package(Boost).

That should prevent FindBoost.cmake from picking up boost's BoostConfig.cmake which looks like it may be defective.

[1] http://www.cmake.org/cmake/help/v3.0/module/FindBoost.html#boost-cmake [^]
(0037317)
pavel.odintsov   
2014-12-01 03:18   
Thank you so much! I appreciate your help! My problem solved!
(0037529)
mircle   
2014-12-27 02:38   
Hello, I also encountered the same problem with you, but I don't know in which file I can change the setting specifically, could you please tell me in details?
it's really an annoying problem
(0037530)
pavel.odintsov   
2014-12-27 06:45   
You could look at my CmakeList: https://github.com/FastVPSEestiOu/fastnetmon/blob/master/CMakeLists.txt [^]
(0037532)
Roger Leigh   
2014-12-27 18:35   
Or just set -DBoost_NO_BOOST_CMAKE=BOOL:ON on the command-line. Preferable if you need to support multiple platforms/versions and avoiding hardcoding this stuff in the scripts.
(0038712)
Robert Maynard   
2015-05-04 09:05   
Closing resolved issues that have not been updated in more than 4 months.