[CMake] Fwd: Re: cmake needs 2 runs to find boost

Boudewijn Rempt boud at valdyas.org
Mon Nov 9 05:36:32 EST 2015


I'm actually hitting a similar problem -- I know I've got boost_system installed in

c:\dev2\i\lib\boost_system-vc-mt-1_55.dll
c:\dev2\i\lib\boost_system-vc-mt-1_55.lib

I run cmake like this:

cmake ..\krita -G"Visual Studio 14 Win64" -DBoost_DEBUG=ON -DBoost_FIND_QUIETLY=FALSE -DBOOST_INCLUDEDIR=c:\dev2\i\include -DBOOST_ROOT=c:\dev2\i -DBOOST_LIBRARYDIR=c:\dev2\i\lib -DCMAKE_INSTALL_PREFIX=c:\dev2\i -DCMAKE_PREFIX_PATH=c:\dev2\i -DCMAKE_BUILD_TYPE=Release

And the output is that boost_system isn't found, because it's looking for vc140, instead of vc, it seems:


-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:515 ] _boost_TEST_VERSIONS = 1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;
1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;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
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:517 ] Boost_USE_MULTITHREADED = TRUE
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:519 ] Boost_USE_STATIC_LIBS =
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:521 ] Boost_USE_STATIC_RUNTIME =
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:523 ] Boost_ADDITIONAL_VERSIONS =
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:525 ] Boost_NO_SYSTEM_PATHS =
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:577 ] Declared as CMake or Environmental Variables:
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:579 ]   BOOST_ROOT = c:\dev2\i
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:581 ]   BOOST_INCLUDEDIR = c:\dev2\i\include
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:583 ]   BOOST_LIBRARYDIR = c:\dev2\i\lib
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:585 ] _boost_TEST_VERSIONS = 1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;
1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;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
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:654 ] Include debugging info:
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:656 ]   _boost_INCLUDE_SEARCH_DIRS = c:\dev2\i\include;c:\dev2\i/include;c:\dev2\i;PATHS;C:/boos
t/include;C:/boost;/sw/local/include
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:658 ]   _boost_PATH_SUFFIXES = boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;b
oost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_
1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;
boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boo
st-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0
;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;
boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost
-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boos
t_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;bo
ost/boost_1_47;boost-1_46_1;boost_1_46_1;boost/boost-1_46_1;boost/boost_1_46_1;boost-1_46_0;boost_1_46_0;boost/boost-1_46_0;boost/boost_1_46_0;boost-1_46;boost_1_46;boost
/boost-1_46;boost/boost_1_46;boost-1_45_0;boost_1_45_0;boost/boost-1_45_0;boost/boost_1_45_0;boost-1_45;boost_1_45;boost/boost-1_45;boost/boost_1_45;boost-1_44_0;boost_1_
44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_43_0;boost_1_43_0;boost/boost-1_43_0;boost/boost_1_43_0;boost-1
_43;boost_1_43;boost/boost-1_43;boost/boost_1_43;boost-1_42_0;boost_1_42_0;boost/boost-1_42_0;boost/boost_1_42_0;boost-1_42;boost_1_42;boost/boost-1_42;boost/boost_1_42;b
oost-1_41_0;boost_1_41_0;boost/boost-1_41_0;boost/boost_1_41_0;boost-1_41;boost_1_41;boost/boost-1_41;boost/boost_1_41;boost-1_40_0;boost_1_40_0;boost/boost-1_40_0;boost/
boost_1_40_0;boost-1_40;boost_1_40;boost/boost-1_40;boost/boost_1_40;boost-1_39_0;boost_1_39_0;boost/boost-1_39_0;boost/boost_1_39_0;boost-1_39;boost_1_39;boost/boost-1_3
9;boost/boost_1_39;boost-1_38_0;boost_1_38_0;boost/boost-1_38_0;boost/boost_1_38_0;boost-1_38;boost_1_38;boost/boost-1_38;boost/boost_1_38;boost-1_37_0;boost_1_37_0;boost
/boost-1_37_0;boost/boost_1_37_0;boost-1_37;boost_1_37;boost/boost-1_37;boost/boost_1_37;boost-1_36_1;boost_1_36_1;boost/boost-1_36_1;boost/boost_1_36_1;boost-1_36_0;boos
t_1_36_0;boost/boost-1_36_0;boost/boost_1_36_0;boost-1_36;boost_1_36;boost/boost-1_36;boost/boost_1_36;boost-1_35_1;boost_1_35_1;boost/boost-1_35_1;boost/boost_1_35_1;boo
st-1_35_0;boost_1_35_0;boost/boost-1_35_0;boost/boost_1_35_0;boost-1_35;boost_1_35;boost/boost-1_35;boost/boost_1_35;boost-1_34_1;boost_1_34_1;boost/boost-1_34_1;boost/bo
ost_1_34_1;boost-1_34_0;boost_1_34_0;boost/boost-1_34_0;boost/boost_1_34_0;boost-1_34;boost_1_34;boost/boost-1_34;boost/boost_1_34;boost-1_33_1;boost_1_33_1;boost/boost-1
_33_1;boost/boost_1_33_1;boost-1_33_0;boost_1_33_0;boost/boost-1_33_0;boost/boost_1_33_0;boost-1_33;boost_1_33;boost/boost-1_33;boost/boost_1_33
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:678 ] location of version.hpp: c:/dev2/i/include/boost-1_55/boost/version.hpp
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:702 ] version.hpp reveals boost 1.55.0
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:787 ] guessed _boost_COMPILER = -vc140
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:797 ] _boost_MULTITHREADED = -mt
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:840 ] _boost_RELEASE_ABI_TAG = -
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:842 ] _boost_DEBUG_ABI_TAG = -gd
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:890 ] _boost_LIBRARY_SEARCH_DIRS = c:\dev2\i\lib;c:\dev2\i/lib;c:\dev2\i/stage/lib;c:/dev2/i/inc
lude/boost-1_55/lib;c:/dev2/i/include/boost-1_55/../lib;c:/dev2/i/include/boost-1_55/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:1001 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-vc140-mt-1_55;boost_system-vc140-mt;bo
ost_system-mt-1_55;boost_system-mt;boost_system
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:1037 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-vc140-mt-gd-1_55;boost_system-vc140-mt-g
d;boost_system-mt-gd-1_55;boost_system-mt-gd;boost_system-mt;boost_system
-- [ C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:1088 ] Boost_FOUND = 1
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindBoost.cmake:1182 (message):
   Unable to find the requested Boost libraries.

   Boost version: 1.55.0

   Boost include path: c:/dev2/i/include/boost-1_55

   Could not find the following Boost libraries:

           boost_system

   No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
   directory containing Boost libraries or BOOST_ROOT to the location of
   Boost.
Call Stack (most recent call first):
   CMakeLists.txt:305 (find_package)


CMake Error at CMakeLists.txt:307 (message):
   Did not find Boost.  Boost is required for the core libraries, stage,
   sheets and krita.


-- Configuring incomplete, errors occurred!


-- 
Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org

On Fri, 6 Nov 2015, Peter Steinbach wrote:

> Hi to all, {sorry for the email mess, anyway here is my to answer to Andreas
> as it affects this mail thread)
>
> thanks for the Boost_DEBUG hint. The output is much more concise and
> digestible than "--trace".
>
> Good News: It works now. I discovered I had a cmake Windows build installed on
> the machine that the MSYS2 terminal picked up. Once that was removed and I
> used the msys internal cmake, it works out nicely. However, the MSVS
> build target is gone now.  So I have to find a way to use either version in
> parallel somehow.
>
> Bad News: I didn't follow through why the problem occurred in the first place.
> Once thing is for sure, the FindBoost module acutally triggered BOOST_FOUND=1!
> But finding the actual libraries of boost failed.
>
> Best,
> Peter
>
>
> On Thursday, November 05, 2015 05:29:16 PM Peter Steinbach wrote:
>> ----------  Forwarded Message  ----------
>>
>> Subject: Re: [CMake] cmake needs 2 runs to find boost
>> Date: Thursday, November 05, 2015, 04:41:51 PM
>> From: Andreas Naumann <Andreas-Naumann at gmx.net>
>> To: Peter Steinbach <steinbach at scionics.de>
>>
>> Hey Peter,
>>
>> It is not a solution, but I would set Boost_DEBUG to ON and compare the
>> output of the first and the second cmake run.
>>
>> Andreas
>>
>> Am 05.11.2015 um 14:26 schrieb Peter Steinbach:
>>> Hi to all,
>>>
>>> ok, I tried the attached minimal CMakeLists.txt again and found out that
>>> it
>>> fails in the way I described only with the "MSYS Makefiles" generator. If
>>> I
>>> use the same CMakeLists.txt without a custom generator (so MSVS is the
>>
>> default
>>
>>> IIRC), the libraries are found alright!
>>>
>>> Any ideas?
>>> Best,
>>> Peter
>>>
>>> On Thursday, November 05, 2015 01:41:33 PM Peter Steinbach wrote:
>>>> Hi Benedikt,
>>>>
>>>> interesting thought, however I wonder why cmake is then capable of
>>>> deducing
>>>> the right boost version and include path. Just inside the first error
>>>> message, I see:
>>>>
>>>> (x86)/CMake/share/cmake-3.2/Modules/FindBoost.cmake:1182 (message):
>>>>>>     Unable to find the requested Boost libraries.
>>>>>>
>>>>>>     Boost version: 1.57.0
>>>>>>
>>>>>>     Boost include path: C:/msys64/mingw64/include
>>>>>>
>>>>>>     Could not find the following static Boost libraries:
>>>>>>             boost_filesystem
>>>>>>             boost_system
>>>>
>>>> strange, isn't it?
>>>> Peter
>>>>
>>>> On Thursday, November 05, 2015 11:41:10 AM Benedikt Hegner wrote:
>>>>> Hi Peter,
>>>>>
>>>>> as I don't use windows at all, this is just a very wild guess...
>>>>>
>>>>> Could it be that in the second run you actually don't use
>>>>>
>>>>>     /CMake/share/cmake-3.2/Modules/FindBoost.cmake
>>>>>
>>>>> but boost-config.cmake, which it now finds in the cached environment of
>>>>> the first run?
>>>>>
>>>>> This assumes of course that you built boost w/ CMake and not bjam...
>>>>>
>>>>> Cheers,
>>>>>
>>>>>     Benedikt
>>>>>
>>>>> On 03.11.2015 14:10, Peter Steinbach wrote:
>>>>>> Hi to all,
>>>>>>
>>>>>> I tested this with cmake 3.2.2 and 3.3.2 and still get the same
>>>>>> problem.
>>>>>> I'd like to use boost with gcc on windows 7 64bit. I installed boost
>>>>>> and
>>>>>> gcc with msys2 as I cannot use MSVC for the actual project I am looking
>>>>>> into for this.
>>>>>>
>>>>>> the funny thing, if I use the attached CMakeLists.txt on the machine
>>>>>> and
>>>>>> call: ```
>>>>>> $ cmake -G "MSYS Makefiles" -DBOOST_ROOT=C:/msys64/mingw64 -
>>>>>> DBOOST_LIBRARYDIR==C:/msys64/mingw64/lib ..
>>>>>> -- The CXX compiler identification is GNU 4.9.2
>>>>>> -- Check for working CXX compiler: C:/msys64/usr/bin/g++.exe
>>>>>> -- Check for working CXX compiler: C:/msys64/usr/bin/g++.exe -- works
>>>>>> -- Detecting CXX compiler ABI info
>>>>>> -- Detecting CXX compiler ABI info - done
>>>>>> -- Detecting CXX compile features
>>>>>> -- Detecting CXX compile features - done
>>>>>> setting win specific stuff
>>>>>> CMake Error at C:/Program Files
>>>>>>
>>>>>> (x86)/CMake/share/cmake-3.2/Modules/FindBoost.cmake:1182 (message):
>>>>>>     Unable to find the requested Boost libraries.
>>>>>>
>>>>>>     Boost version: 1.57.0
>>>>>>
>>>>>>     Boost include path: C:/msys64/mingw64/include
>>>>>>
>>>>>>     Could not find the following static Boost libraries:
>>>>>>             boost_filesystem
>>>>>>             boost_system
>>>>>>
>>>>>>     No Boost libraries were found.  You may need to set
>>>>>>     BOOST_LIBRARYDIR
>>>>>>     to
>>>>>>     the
>>>>>>     directory containing Boost libraries or BOOST_ROOT to the location
>>>>>>     of
>>>>>>     Boost.
>>>>>>
>>>>>> Call Stack (most recent call first):
>>>>>>     CMakeLists.txt:17 (FIND_PACKAGE)
>>>>>>
>>>>>> CMake Error at CMakeLists.txt:24 (MESSAGE):
>>>>>>     Boost not found (C:/msys64/mingw64)
>>>>>>
>>>>>> -- Configuring incomplete, errors occurred!
>>>>>> See also
>>>>>> "C:/msys64/home/steinbac/development/cmake_sandbox/find_boost/build/CMa
>>>>>> k
>>>>>> eF
>>>>>> iles/CMakeOutput.log". $ cmake -G "MSYS Makefiles"
>>>>>> -DBOOST_ROOT=C:/msys64/mingw64 -
>>>>>> DBOOST_LIBRARYDIR==C:/msys64/mingw64/lib ..
>>>>>> setting win specific stuff
>>>>>> Boost 1.57 found __
>>>>>> -- Configuring done
>>>>>> -- Generating done
>>>>>> -- Build files have been written to:
>>>>>> C:/msys64/home/steinbac/development/cmake_sandbox/find_boost/build
>>>>>> ```
>>>>>>
>>>>>> I'd like to link statically to multithreaded libboost_*-mt.a from my
>>>>>> app.
>>>>>> But it proofes really hard to find Boost in the first place.
>>>>>> Any ideas?
>>>>>>
>>>>>> Peter
>>
>> -----------------------------------------
>
> -- 
> Peter Steinbach, Dr. rer. nat.
> HPC Developer
>
> Scionics Computer Innovation GmbH
> Löscherstr. 16
> 01309 Dresden
> fon: +49 351 210 2882
> fax: +49 351 210 1689
> http://www.scionics.de
>
> Sitz der Gesellschaft:  Dresden (Main office)
> Amtsgericht - Registergericht:  Dresden HRB 20337 (Commercial Registry)
> Ust-IdNr.:  DE813263791 (VAT ID Number)
> Geschäftsführer:  John Duperon, Jeff Oegema (Managing Directors)
> -- 
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>


More information about the CMake mailing list