'C,C++/Other Library'에 해당되는 글 3건

  1. 2016.09.21 [boost] boost build하기
  2. 2016.09.20 [boost] CMake is not able to find BOOST libraries
  3. 2016.09.20 [boost]CMake not finding Boost

ms-dos 창에서 boost가 있는 폴더로 간다. 그런 후 아래와 같은 명령어를 차례로 입력한다.

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

bootstrap
.\b2
-------------------

(http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html#zip)를 참조.

 

 

 

어떤사람은 아래와 같이 명령어를 입력했다고 한다

"I built it from the MS visual studio command prompt by first executing the bootstrap command from inside the directory where boost is located and then using the bjam command. –"

(http://stackoverflow.com/questions/19303430/cmake-cannot-find-boost-libraries)

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

[boost] CMake is not able to find BOOST libraries  (0) 2016.09.20
[boost]CMake not finding Boost  (0) 2016.09.20
Posted by uniqueone
,
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
,
http://stackoverflow.com/questions/13280823/cmake-not-finding-boost

 

 

 

 

I saw at least 3 questions with the same title as this question. Each of them had a different answer that worked for the OP but not for me, so I am sorry to repeat the question...

I am trying to install CGAL. They describe their installation process as ever-so-simple here, section 6.1. When I run cmake-gui and then click configure, I get the following output

CMake Error at D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:1192 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.51.0

  Boost include path: D:/program files/boost_1_51

  The following Boost libraries could not be found:

          boost_thread
          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):
  cmake/modules/CGAL_SetupBoost.cmake:6 (find_package)
  cmake/modules/CGAL_SetupDependencies.cmake:85 (include)
  CMakeLists.txt:590 (include)

But I DID set up BOOST_ROOT, in cmake's gui, to D:/program files/boost_1_51, which exists. And the two libraries it mentions are definitely installed. What is happening here? What do I need to do?

EDIT: Attached is the output when running cmake -DBoost_DEBUG=ON

D:\program files\CGAL-4.1>cmake -DBoost_DEBUG=ON
== Setting paths ==
-- Build CGAL from release in directory CGAL-4.1
-- Packagenames: CGAL-4.1
== Setting paths (DONE) ==

== Generate version files ==
-- CGAL_MAJOR_VERSION=4
-- CGAL_MINOR_VERSION=1
-- CGAL_BUGFIX_VERSION=0
-- CGAL_SONAME_VERSION=10
-- CGAL_SOVERSION     =10.0.0
-- CGAL_REFERENCE_CACHE_DIR=
-- Building shared libraries
-- Targetting Visual Studio 10 Win64
-- Target build enviroment supports auto-linking
-- Using VC10 compiler.
-- Generator uses intermediate configuration directory: $(Configuration)
-- USING CMake version: 2.8.10
-- System: Windows
== Generate version files (DONE) ==

== Set up flags ==
-- Build type: Release
-- USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /Zm1000 /GR /EHsc -D_CRT_SECURE_NO_
DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_
WARNINGS /fp:strict /fp:except- /MD /O2 /Ob2 /D NDEBUG'
-- USING LDFLAGS = ' /STACK:10000000 /machine:x64  /INCREMENTAL:NO'
== Set up flags (DONE) ==

== Detect external libraries ==
-- External libraries supported: GMP;MPFR;ZLIB;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;TA
UCS;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
-- Preconfiguring library: GMP ...
-- GMP has been preconfigured:
--   CGAL_UseGMP-file:
--   GMP include:      D:/program files/CGAL-4.1/auxiliary/gmp/include
--   GMP libraries:    D:/program files/CGAL-4.1/auxiliary/gmp/lib/libgmp-10.lib

--   GMP definitions:
-- USING GMP_VERSION = '5.0.1'
-- Preconfiguring library: MPFR ...
-- MPFR has been preconfigured:
--   CGAL_UseMPFR-file:

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

 

 

 

 

Your output shows that CMake is searching for the libraries in the following places:

D:/program files/boost_1_51/bin/lib
D:/program files/boost_1_51/bin/stage/lib
D:/program files/boost_1_51/lib
D:/program files/boost_1_51/../lib
D:/program files/boost_1_51/stage/lib
C:/boost/lib
C:/boost
C:\Program Files (x86)/boost/boost_1_51_0/lib
C:\Program Files (x86)/boost/boost_1_51/lib
C:\Program Files (x86)/boost/lib
C:\Program Files (x86)/boost
/sw/local/lib

It also shows that it's expecting the libraries to be named in a certain way. For example, the release version of Boost.Thread:

boost_thread-vc100-mt-1_51
boost_thread-vc100-mt
boost_thread-mt-1_51
boost_thread-mt
boost_thread

If your boost libraries do exist in one of the searched locations, then it's probably the name of the library that's the problem. You can adjust the expected name of the boost libs by setting the appropriate CMake variables relevant to the FindBoost module

For example, if you built boost using bjam with link=static threading=multi then in your CMakeLists.txt before find_package(Boost ...) you'll want to do

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)

or invoke cmake with -DBoost_USE_STATIC_LIBS=ON -DBoost_USE_MULTITHREADED=ON

Edit

As @noam has pointed out in the comments below, in this particular case, it appears that CGAL requires the shared (dll) versions of the boost libs; passing -DBoost_USE_STATIC_LIBS=ON on the command line has no effect.

shareimprove this answer
    
I am using a university computer which already has boost on it. How can I know how did they compile boost (I really have no one to ask :) ) – olamundo Nov 8 '12 at 3:22
    
@noam It can usually be deduced from the libraries' names. What is the full name and path of say the debug and release versions of Boost.Thread there? – Fraser Nov 8 '12 at 3:36
    
I hope I understand you correctly: libboost_thread-vc100-mt-gd-1_51.lib and libboost_thread-vc100-mt-1_51.lib – olamundo Nov 8 '12 at 3:40
    
@noam OK - the libraries are static (you can tell because they begin with "lib" - see Boost's getting started guide) so you need Boost_USE_STATIC_LIBS set to ON. In your output above, you can see that you currently have this value set to OFF. Once you do that, assuming the libs are actually in one of the search paths listed in my answer, it should all work. – Fraser Nov 8 '12 at 3:52
    
Nope, it doesn't work. The libs are in D:\program files\boost_1_51\lib, but it still outputs the same error, when running cmake -DBoost_USE_STATIC_LIBS=ON. (Thank you for your patience, by the way) – olamundo Nov 8 '12 at 4:10

I had this error but have progressed.

I was using the cmake-gui, then I ticked the checkbox "Advanced" (between checkbox "Grouped" and button "Add Entry"), then I ticked the newly seen checkbox "CGAL_Boost_USE_STATIC_LIBS".

You may need to press "Configure" an extra time or two before the extra options are revealed.

shareimprove this answer

Today I tried installing CGAL with Boost 1.57 x64 on Windows and encountered the same problem. I installed boost via pre-build binaries and the .lib files that CMake searches for are in the lib64-msvc-12.0 folder. Therefore adding BOOST_LIBRARYDIR=.../boost_1_57_0/lib64-msvc-12.0 to CMake options was the solution for me.

shareimprove this answer
    
Thanks, same here with boost 1.60 x64 binary install on Windows 7 and CGAL 1.47. I addedBOOST_LIBRARYDIR=C:\boost\lib64-msvc-14.0 in my case. – Paul Jurczak Jan 3 at 7:06 
  1. CGAL use the shared boost libraries. So, the libraries like "libboost_thread-vc100-mt-p-1_49.lib" is a statically linked library.

  2. It's because cmake(I used v2.8.9) can not read the name of boost libraries correctly. When I changed the library names boost_thread-vc100-mt-p-1_49.dll and boost_thread-vc100-mt-p-1_49.lib to boost_thread-vc100-mt-1_49.dll and boost_thread-vc100-mt-1_49, respectively, it fixed the problem.

shareimprove this answer
1  
For reference: Do NOT do this. The naming reflects how boost was compiled. So you need to set the correct options for the Find module or you will end up with problems of any kind (using debug versions for release, multi-threaded for single-threaded etc) – Flamefire Jan 11 at 9:54

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

[boost] boost build하기  (0) 2016.09.21
[boost] CMake is not able to find BOOST libraries  (0) 2016.09.20
Posted by uniqueone
,