http://stackoverflow.com/questions/24173330/cmake-is-not-able-to-find-boost-libraries

 

 

I tried everything, Like:

  1. Configure Environment variable
  2. Make Fresh build
  3. Re-install BOOST from source
  4. sudo apt-get install libboost-all-dev

But still getting following Errors:

CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
 Unable to find the requested Boost libraries.

 Unable to find the Boost header files.  Please set BOOST_ROOT to the root
 directory containing Boost or BOOST_INCLUDEDIR to the directory containing
 Boost's headers.
Call Stack (most recent call first):
   CMakeLists.txt:147 (find_package)


CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
Unable to find the requested Boost libraries.

Unable to find the Boost header files.  Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.

Source code directory for boost: /usr/local/src/boost_1_45_0 Boost Library path: /usr/local/libBoost Header file: /usr/local/include/boost

Here is bashrc file:

BOOST_ROOT="/usr/local/src/boost_1_45_0"
Boost_LIBRARY_DIRS="/usr/local/lib"
BOOST_INCLUDEDIR="/usr/local/src/boost_1_45_0"

How to solve these Errors? Am i missing something?

Edit:

cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN -DBOOST_ROOT=/usr/local/src/boost_1_45_0 -DBOOST_INCLUDEDIR=/usr/local/include/boost -DBOOST_LIBRARYDIR=/usr/local/lib -DPYTHON_LIBRARIES=/usr/local/lib/python2.7 -DPYTHON_INCLUDE_DIRS=/usr/include/python2.7 -DCMA-DRDK_BUILD_PYTHON_WRAPPERS=

---------------------------------------------------------

Can you show the output of CMake if you do cmake . -DBoost_DEBUG=ON? – Fraser Jun 11 '14 at 22:03
2  
Looks like it's not picking up the environment variables. See lines 8-10 of your output. You can try passing these as CMake variables. Maybe even just BOOST_ROOT would be enough: cmake . -DBOOST_ROOT=/usr/local – Fraser Jun 11 '14 at 22:10
1  
Be good to know what the Boost problem was. As for Python while cross-compiling, I can't really help too much. It looks like you can disable CMake trying to find Python by editing the CMakeLIsts.txt file around line 114, but if they've made it required, probably it's being used unconditionally somewhere else, and you'll then just get a failure at that point. Like I said, probably time for a new question :-) – Fraser Jun 11 '14 at 23:18
4  
@AmitPal Please add an answer yourself instead of editing the answer into your question, that way people can see that the question is answered. – Andreas Haferburg Jun 12 '14 at 12:51
4  
@AmitPal - Did that last line under EDIT fix the problem? If, YES, then answer your own question so people will the the question is answered, as Andreas Haferburg said in his comment above. – Patricia Apr 9 '15 at 15:52

 

-----------------------------------------------

Try to complete cmake process with following libs:

sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev

-----------------------------------------------------

I'm using this to set up boost from cmake in my CMakeLists.txt. Try something similar (make sure to update paths to your installation of boost).

SET (BOOST_ROOT "/opt/boost/boost_1_57_0")
SET (BOOST_INCLUDEDIR "/opt/boost/boost-1.57.0/include")
SET (BOOST_LIBRARYDIR "/opt/boost/boost-1.57.0/lib")

SET (BOOST_MIN_VERSION "1.55.0")
set (Boost_NO_BOOST_CMAKE ON)
FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} REQUIRED)
if (NOT Boost_FOUND)
  message(FATAL_ERROR "Fatal error: Boost (version >= 1.55) required.")
else()
  message(STATUS "Setting up BOOST")
  message(STATUS " Includes - ${Boost_INCLUDE_DIRS}")
  message(STATUS " Library  - ${Boost_LIBRARY_DIRS}")
  include_directories(${Boost_INCLUDE_DIRS})
  link_directories(${Boost_LIBRARY_DIRS})
endif (NOT Boost_FOUND)

This will either search default paths (/usr, /usr/local) or the path provided through the cmake variables (BOOST_ROOT, BOOST_INCLUDEDIR, BOOST_LIBRARYDIR). It works for me on cmake > 2.6.

shareimprove this answer

seems the answer is in the comments and as an edit but to clarify this should work for you:

export BUILDDIR='your path to  build directory here'
export SRCDIR='your path to source dir here'
export BOOST_ROOT="/opt/boost/boost_1_57_0"
export BOOST_INCLUDE="/opt/boost/boost-1.57.0/include"
export BOOST_LIBDIR="/opt/boost/boost-1.57.0/lib"
export BOOST_OPTS="-DBOOST_ROOT=${BOOST_ROOT} -DBOOST_INCLUDEDIR=${BOOST_INCLUDE} -DBOOST_LIBRARYDIR=${BOOST_LIBDIR}"
(cd ${BUILDDIR} && cmake ${BOOST_OPTS} ${SRCDIR})

you need to specify the arguments as command line arguments or you can use a toolchain file for that, but cmake will not touch your environment variables.

shareimprove this answer

I just want to point out that the FindBoost macro might be looking for an earlier version, for instance, 1.58.0 when you might have 1.60.0 installed. I suggest popping open the FindBoost macro from whatever it is you are attempting to build, and checking if that's the case. You can simply edit it to include your particular version. (This was my problem.)

 

'C,C++ > Other Library' 카테고리의 다른 글

[boost] boost build하기  (0) 2016.09.21
[boost]CMake not finding Boost  (0) 2016.09.20
Posted by uniqueone
,