The problem is that cmake don't find boost-graph library during building of the project. However, this library is installed on the system.
Hello everyone!I've faced with such problem.I've tried to build some project that depends on Boost and CLapack packages. (I've installed these packages earlier)I've used this command:
$ cmake ../project_name/ -DCLAPACK_BASE_DIRECTORY=/home/vitalii/clapack-3.2.1-CMAKE -DCLAPACK_BUILD_DIRECTORY=/home/vitalii/clapack-3.2.1-CMAKE/BUILDThe output in terminal was:
— The C compiler identification is GNU 11.4.0— The CXX compiler identification is GNU 11.4.0— Detecting C compiler ABI info— Detecting C compiler ABI info - done— Check for working C compiler: /usr/bin/cc - skipped— Detecting C compile features— Detecting C compile features - done— Detecting CXX compiler ABI info— Detecting CXX compiler ABI info - done— Check for working CXX compiler: /usr/bin/c++ - skipped— Detecting CXX compile features— Detecting CXX compile features - doneCMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package): Found package configuration file: /usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0/boost_graph-config.cmake but it set boost_graph_FOUND to FALSE so package "boost_graph" is considered to be NOT FOUND. Reason given by package: No suitable build variant has been found. The following variants have been tried and rejected: * libboost_graph.so.1.74.0 (shared, Boost_USE_STATIC_LIBS=ON) * libboost_graph.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)Call Stack (most recent call first): /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component) /usr/share/cmake-3.22/Modules/FindBoost.cmake:594 (find_package) CMakeLists.txt:45 (find_package)— Configuring incomplete, errors occurred!See also "/home/vitalii/Vitalii/lab/phd/cpf/cpf_build/CMakeFiles/CMakeOutput.log".42-45 lines of CMakeLists.txt are:
set(Boost_USE_STATIC_LIBS ON)set(Boost_USE_MULTITHREADED ON)set(Boost_USE_STATIC_RUNTIME ON)find_package(Boost COMPONENTS graph program_options REQUIRED)587-594 lines of /usr/share/cmake-3.22/Modules/FindBoost.cmake are:
if(BOOST_ROOT AND NOT Boost_ROOT) # Honor BOOST_ROOT by setting Boost_ROOT with CMP0074 NEW behavior. cmake_policy(PUSH) cmake_policy(SET CMP0074 NEW) set(Boost_ROOT "${BOOST_ROOT}") set(_Boost_ROOT_FOR_CONFIG 1) endif() find_package(Boost QUIET NO_MODULE ${_boost_FIND_PACKAGE_ARGS})238-262 lines of /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake are:
# Find componentsif("ALL" IN_LIST Boost_FIND_COMPONENTS) # Make sure "ALL" is the only requested component. list(LENGTH Boost_FIND_COMPONENTS __boost_find_components_count) if(NOT ${__boost_find_components_count} EQUAL 1) message(AUTHOR_WARNING "ALL cannot be combined with named components; the named components will be ignored.") endif() unset(__boost_find_components_count) set(Boost_ALL_TARGETS Boost::headers) boost_find_all_components()else() foreach(__boost_comp IN LISTS Boost_FIND_COMPONENTS)** boost_find_component(${__boost_comp} ${Boost_FIND_REQUIRED_${__boost_comp}} 0)** endforeach()endif()This command has proved that boost_graph library exists in my system:
$ find / -name *libboost_graph* 2> /dev/null/home/vitalii/anaconda3/envs/my-rdkit-env/lib/libboost_graph.so.1.84.0/home/vitalii/anaconda3/envs/my-rdkit-env/lib/libboost_graph.so/home/vitalii/anaconda3/envs/AmberTools23/lib/libboost_graph.so.1.82.0/home/vitalii/anaconda3/envs/AmberTools23/lib/libboost_graph.so/home/vitalii/anaconda3/envs/AmberTools23/lib/cmake/boost_graph-1.82.0/libboost_graph-variant-shared.cmake/home/vitalii/anaconda3/pkgs/libboost-devel-1.82.0-h00ab1b0_6/lib/cmake/boost_graph-1.82.0/libboost_graph-variant-shared.cmake/home/vitalii/anaconda3/pkgs/boost-cpp-1.78.0-h2c5509c_4/lib/libboost_graph.so/home/vitalii/anaconda3/pkgs/boost-cpp-1.78.0-h2c5509c_4/lib/libboost_graph.so.1.78.0/home/vitalii/anaconda3/pkgs/boost-cpp-1.78.0-h2c5509c_4/lib/cmake/boost_graph-1.78.0/libboost_graph-variant-shared.cmake/home/vitalii/anaconda3/pkgs/libboost-1.84.0-hba137d9_3/lib/libboost_graph.so.1.84.0/home/vitalii/anaconda3/pkgs/libboost-1.84.0-hba137d9_3/lib/libboost_graph.so/home/vitalii/anaconda3/pkgs/libboost-1.82.0-h6fcfa73_6/lib/libboost_graph.so.1.82.0/home/vitalii/anaconda3/pkgs/libboost-1.82.0-h6fcfa73_6/lib/libboost_graph.so/home/vitalii/anaconda3/pkgs/boost-cpp-1.78.0-h6582d0a_3/lib/libboost_graph.so/home/vitalii/anaconda3/pkgs/boost-cpp-1.78.0-h6582d0a_3/lib/libboost_graph.so.1.78.0/home/vitalii/anaconda3/pkgs/boost-cpp-1.78.0-h6582d0a_3/lib/cmake/boost_graph-1.78.0/libboost_graph-variant-shared.cmake/usr/lib/x86_64-linux-gnu/libboost_graph.so.1.74.0/usr/lib/x86_64-linux-gnu/libboost_graph_parallel.so.1.74.0/usr/lib/x86_64-linux-gnu/libboost_graph.so/usr/lib/x86_64-linux-gnu/libboost_graph_parallel.so/usr/lib/x86_64-linux-gnu/libboost_graph_parallel.a/usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0/libboost_graph-variant-static.cmake/usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0/libboost_graph-variant-shared.cmake/usr/lib/x86_64-linux-gnu/cmake/boost_graph_parallel-1.74.0/libboost_graph_parallel-variant-static.cmake/usr/lib/x86_64-linux-gnu/cmake/boost_graph_parallel-1.74.0/libboost_graph_parallel-variant-shared.cmake/usr/lib/x86_64-linux-gnu/libboost_graph.aAlso I've read some answers on the related questions.I've tried run cmake with option -DBoost_DEBUG=TRUE to get more information as some users in these answers had recommended it:
$ cmake ../project_name/ -DCLAPACK_BASE_DIRECTORY=/home/vitalii/clapack-3.2.1-CMAKE -DCLAPACK_BUILD_DIRECTORY=/home/vitalii/clapack-3.2.1-CMAKE/BUILD -DBoost_DEBUG=TRUE— Found Boost 1.74.0 at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0— Requested configuration: QUIET REQUIRED COMPONENTS graph;program_options— BoostConfig: find_package(boost_headers 1.74.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/x86_64-linux-gnu/cmake)— Found boost_headers 1.74.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_headers-1.74.0— BoostConfig: find_package(boost_graph 1.74.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/x86_64-linux-gnu/cmake)— Found boost_graph 1.74.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0— Boost toolset is gcc11 (GNU 11.4.0)— Scanning /usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0/libboost_graph-variant*.cmake— Including /usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0/libboost_graph-variant-shared.cmake— [ ] libboost_graph.so.1.74.0— Including /usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0/libboost_graph-variant-static.cmake— [ ] libboost_graph.aCMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package):Found package configuration file:/usr/lib/x86_64-linux-gnu/cmake/boost_graph-1.74.0/boost_graph-config.cmakebut it set boost_graph_FOUND to FALSE so package "boost_graph" isconsidered to be NOT FOUND. Reason given by package:No suitable build variant has been found.The following variants have been tried and rejected:* libboost_graph.so.1.74.0 (shared, Boost_USE_STATIC_LIBS=ON)* libboost_graph.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)Call Stack (most recent call first):/usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component)/usr/share/cmake-3.22/Modules/FindBoost.cmake:59422:55(find_package)CMakeLists.txt:45 (find_package)— Configuring incomplete, errors occurred!See also "/home/vitalii/Vitalii/lab/phd/cpf/cpf_build/CMakeFiles/CMakeOutput.log".Unfortunately, I haven't yet understood how to fix this problem. Do you have any suggestions for it?
My OS is 22.04.1-Ubuntu.