CMake config errors with locally compiled Boost

Issue #442 closed
Chris Beall created an issue

The CMake modernization changes (Boost import targets) seem to be causing a new problem in configuring gtsam with locally compiled Boost. To test different versions of Boost, I locally compile to a staging directory (without installing in a system path!), and then configure gtsam with ccmake .. -DBOOST_ROOT=/home/cbeall/local_prefix/boost_1_65_1/ @jlblancoc Have you tried this? Any ideas on the proper way to fix?

The method above used to work regardless of the Boost version, but now I get errors like this:

CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)



 CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)



 CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)



 CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)



 CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)



 CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)



 CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)



 CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
   Imported targets not available for Boost version 106501
 Call Stack (most recent call first):
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
   /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
   CMakeLists.txt:137 (find_package)

My staging directory looks like this:

cbeall@workstation-1091:~$ ls ~/local_prefix/
boost_1_65_1  boost_1_68_0
cbeall@workstation-1091:~$ ls ~/local_prefix/boost_1_65_1/
include  lib
cbeall@workstation-1091:~$ 

Comments (6)

  1. José Luis Blanco-Claraco

    Chris, can you check if your cmake FindBoost.cmake script knows about that version of boost?

    For example:

    grep _Boost_KNOWN_VERSIONS /usr/share/cmake*/Modules/FindBoost.cmake -A 5

    Shows on u18.04:

    "1.65.1" "1.65.0" "1.65"
        "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
        "1.59.0" "1.59" "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"
    

    It seems that it might be the problem...

    I just tested with Boost 1.69 and stumped against this... Will try with an older version to verify if the issue is the outdated cmake script and/or the local stage.

    Related: https://gitlab.kitware.com/cmake/cmake/issues/17575

  2. José Luis Blanco-Claraco

    Yes, I can confirm that the current develop works with a local build of Boost (installed to $HOME/...), but only if the version of CMake is new enough for that version of Boost... (sigh)

    One option would be for you to grab the latest FindBoost.cmake from CMake git?

    Cheers

  3. Chris Beall reporter

    Hmmm, that's an option, but a bit annoying, because newer versions of Boost (which FindBoost.cmake didn't know about) worked perfectly fine before the switch to imported boost targets.

    Reading the documentation in the script, I see there's also a way to pass additional versions to FindBoost.cmake. If that works, I'd prefer that as a workaround.

  4. Log in to comment