Boost-Lib: how can I build stp with boost on debian

505 views Asked by At

i want to build stp on Debian Jessy with CMake which use the boost library, I got the errror: Could not find the following Boost libraries: boost_program_options boost_system

I have tried to set the include path direct but no succes. For me it seems that there are only headers and no lib. What can I do?

Here the complete output with Boost_DEBUG=ON and Boost_DETAILED_FAILURE=ON:

-- Doing a RelWithDebInfo build
-- Building shared library currently broken due to mix of C++/C code
-- Checking for C++ hash_set implementation...
-- C++ hash_set found as std::unordered_set in <unordered_set>
-- Checking for C++ hash_multiset implementation...
-- C++ hash_multiset found as std::unordered_multiset in <unordered_set>
-- Checking for C++ hash_map implementation...
-- C++ hash_map found as std::unordered_map in <unordered_map>
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:492 ] _boost_TEST_VERSIONS = 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
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:494 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:496 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:498 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:500 ] Boost_ADDITIONAL_VERSIONS = 
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:502 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:554 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:556 ]   BOOST_ROOT = /usr/include/boost
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:558 ]   BOOST_INCLUDEDIR = 
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:560 ]   BOOST_LIBRARYDIR = 
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:562 ] _boost_TEST_VERSIONS = 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
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:655 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:679 ] version.hpp reveals boost 1.54.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:755 ] guessed _boost_COMPILER = -gcc48
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:765 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:808 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:810 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:858 ] _boost_LIBRARY_SEARCH_DIRS = /usr/include/boost/lib;/usr/include/boost/stage/lib;/usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:946 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: boost_program_options-gcc48-mt-1_54;boost_program_options-gcc48-mt;boost_program_options-mt-1_54;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:982 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: boost_program_options-gcc48-mt-d-1_54;boost_program_options-gcc48-mt-d;boost_program_options-mt-d-1_54;boost_program_options-mt-d;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:946 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-gcc48-mt-1_54;boost_system-gcc48-mt;boost_system-mt-1_54;boost_system-mt;boost_system
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:982 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-gcc48-mt-d-1_54;boost_system-gcc48-mt-d;boost_system-mt-d-1_54;boost_system-mt-d;boost_system-mt;boost_system
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1033 ] Boost_FOUND = 1
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1130 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.54.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_program_options
          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:190 (find_package)


Adding public header(s) /home/michael/Downloads/stp/src/interface/C/c_interface.h to target libstp
Adding public header(s) /home/michael/Downloads/stp/src/interface/CPP/cpp_interface.h to target libstp
CMake Warning at CMakeLists.txt:269 (message):
  Testing is disabled


-- Configuring incomplete, errors occurred!
1

There are 1 answers

0
hailinzeng On

I have seen the same problem on CentOS.

$ cat /etc/redhat-release 
CentOS Linux release 7.0.1406 (Core)

First, i ensured libboost-system.so is exist in /usr/lib64.

$ find /usr -name "*boost*"

Then, in findBoost.cmake, i found it only looks boost in somedir/lib. So i installed x86 version

$ yum install boost-devel.x86_64

Not working.

Finally, it occurred to me, there is only .so files. So i tried to edit stp/CMakeLists.txt, and set

set(Boost_USE_STATIC_LIBS OFF)

if(NOT BUILD_SHARED_LIBS)
    # If we are building libstp as static we will want to 
    # make sure there are no unresolved symbols to Boost
    # library functions. Later we'll merge them into the
    # archive so we'll need static boost libraries.
    message("Trying to use static Boost libraries")
    # set(Boost_USE_STATIC_LIBS ON)
endif()

It works!