web-dev-qa-db-fra.com

Je ne trouve pas Boost

J'ai vu au moins 3 questions portant le même titre que cette question. Chacun d'entre eux avait une réponse différente qui fonctionnait pour le PO mais pas pour moi, alors je suis désolé de répéter la question ...

J'essaye d'installer CGAL. Ils décrivent leur processus d’installation comme si simple ici , section 6.1. Quand je lance cmake-gui et que je clique sur configure, je reçois le résultat suivant 

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)

Mais j’ai DID mis en place BOOST_ROOT, dans l’interface graphique de cmake, avec D:/program files/boost_1_51, qui existe déjà. Et les deux bibliothèques mentionnées sont définitivement installées. Que se passe-t-il ici? Qu'est-ce que je dois faire? 

EDIT: Attaché est la sortie lors de l'exécution de 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:
--   MPFR include:      D:/program files/CGAL-4.1/auxiliary/gmp/include
--   MPFR libraries:    D:/program files/CGAL-4.1/auxiliary/gmp/lib/libmpfr-4.li
b
--   MPFR definitions:
-- USING MPFR_VERSION = '3.0.0'
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:566 ] _b
oost_TEST_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1.54;1.
53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;1.49.1
;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.1;1.4
5.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1.41.0;
1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.0;1.37
;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;1.45.0;1.45;1.44.0;1
.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37
.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:568 ] Bo
ost_USE_MULTITHREADED = TRUE
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:570 ] Bo
ost_USE_STATIC_LIBS = OFF
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:572 ] Bo
ost_USE_STATIC_RUNTIME =
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:574 ] Bo
ost_ADDITIONAL_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1.
54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;1
.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.
1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1.
41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.0
;1.37
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:576 ] Bo
ost_NO_SYSTEM_PATHS =
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:644 ] De
clared as CMake or Environmental Variables:
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:646 ]
BOOST_ROOT = D:/program files/boost_1_51/bin
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:648 ]
BOOST_INCLUDEDIR =
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:650 ]
BOOST_LIBRARYDIR =
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:652 ] _b
oost_TEST_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1.54;1.
53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;1.49.1
;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.1;1.4
5.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1.41.0;
1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.0;1.37
;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;1.45.0;1.45;1.44.0;1
.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37
.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:734 ] lo
cation of version.hpp: D:/program files/boost_1_51/boost/version.hpp
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:754 ] ve
rsion.hpp reveals boost 1.51.0
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:786 ] gu
essed _boost_COMPILER = -vc100
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:796 ] _b
oost_MULTITHREADED = -mt
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:839 ] _b
oost_RELEASE_ABI_TAG = -
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:841 ] _b
oost_DEBUG_ABI_TAG = -Gd
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:884 ] _b
oost_LIBRARY_SEARCH_DIRS = 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:\Progr
am Files (x86)/boost/boost_1_51_0/lib;C:\Program Files (x86)/boost/boost_1_51/li
b;C:\Program Files (x86)/boost/lib;C:\Program Files (x86)/boost;/sw/local/lib
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:962 ] Se
arching for THREAD_LIBRARY_RELEASE: boost_thread-vc100-mt-1_51;boost_thread-vc10
0-mt;boost_thread-mt-1_51;boost_thread-mt;boost_thread
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:994 ] Se
arching for THREAD_LIBRARY_DEBUG: boost_thread-vc100-mt-Gd-1_51;boost_thread-vc1
00-mt-Gd;boost_thread-mt-Gd-1_51;boost_thread-mt-Gd;boost_thread-mt;boost_thread

-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:962 ] Se
arching for SYSTEM_LIBRARY_RELEASE: boost_system-vc100-mt-1_51;boost_system-vc10
0-mt;boost_system-mt-1_51;boost_system-mt;boost_system
-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:994 ] Se
arching for SYSTEM_LIBRARY_DEBUG: boost_system-vc100-mt-Gd-1_51;boost_system-vc1
00-mt-Gd;boost_system-mt-Gd-1_51;boost_system-mt-Gd;boost_system-mt;boost_system

-- [ D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:1108 ] B
oost_FOUND = FALSE
CMake Error at D:/program files/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmak
e: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)


-- Boost include:     D:/program files/boost_1_51
-- Boost libraries:
-- Boost definitions:
-- USING BOOST_VERSION = '1.51.0'
== Detect external libraries (DONE) ==

== Write compiler_config.h ==
== Write compiler_config.h (DONE) ==

== Generating build files ==
Configuring libCGAL
-- Requested component: MPFR
-- Requested component: GMP
libCGAL is configured
-- Sources for CGAL component library 'Core' detected
Configuring libCGAL_Core
-- Requested component: MPFR
-- Requested component: GMP
libCGAL_Core is configured
-- Sources for CGAL component library 'ImageIO' detected
Configuring libCGAL_ImageIO
-- Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- OpenGL include:
-- OpenGL libraries:   glu32;opengl32
-- Requested component: MPFR
-- Requested component: GMP
libCGAL_ImageIO is configured
-- NOTICE: CGAL_ImageIO needs ZLib to read compressed files. That feature will n
ot be activated.
-- Sources for CGAL component library 'Qt3' detected
Configuring libCGAL_Qt3
-- CGAL_Qt3 needs Qt3, cannot be configured.
-- Sources for CGAL component library 'Qt4' detected
Configuring libCGAL_Qt4
-- USING OPENGL_VERSION = '1.1'
-- USING QT4_VERSION = '4.8.3'
-- OpenGL include:
-- OpenGL libraries:   glu32;opengl32
-- OpenGL definitions:
-- Qt4 include:        D:/QT/include
-- Qt4 libraries:      optimized;D:/QT/lib/qtmain.lib;debug;D:/QT/lib/qtmaind.li
b;optimized;D:/QT/lib/QtOpenGL4.lib;debug;D:/QT/lib/QtOpenGLd4.lib;optimized;D:/
QT/lib/QtGui4.lib;debug;D:/QT/lib/QtGuid4.lib;optimized;D:/QT/lib/QtCore4.lib;de
bug;D:/QT/lib/QtCored4.lib
-- Qt4 definitions:    -DQT_DLL
-- moc executable:     D:/QT/bin/moc.exe
-- uic executable:     D:/QT/bin/uic.exe
-- Requested component: MPFR
-- Requested component: GMP
libCGAL_Qt4 is configured
-- Sources for CGAL component libraries 'CGAL;Core;ImageIO;Qt3;Qt4' detected
== Generating build files (DONE) ==

-- Configuring incomplete, errors occurred!
32
olamundo

Votre sortie montre que CMake recherche les bibliothèques aux endroits suivants:

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

Cela montre également qu'il est prévu que les bibliothèques soient nommées d'une certaine manière. Par exemple, la version finale de Boost.Thread:

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

Si vos bibliothèques boost existent dans l'un des emplacements recherchés, c'est probablement le nom de la bibliothèque qui pose problème. Vous pouvez ajuster le nom attendu des librairies boost en définissant les variables CMake appropriées au module FindBoost

Par exemple, si vous avez créé boost en utilisant bjam avec link=static threading=multi, dans votre CMakeLists.txt avant find_package(Boost ...), vous voudrez le faire.

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)

ou invoquer cmake avec -DBoost_USE_STATIC_LIBS=ON -DBoost_USE_MULTITHREADED=ON

Modifier

Comme @noam l’a souligné dans les commentaires ci-dessous, dans ce cas particulier, il apparaît que CGAL requiert les versions partagées (dll) des libs boost; passer -DBoost_USE_STATIC_LIBS=ON sur la ligne de commande n'a aucun effet.

24
Fraser

J'ai eu cette erreur mais j'ai progressé.

J'utilisais cmake-gui, Puis j'ai coché la case "Avancé" (entre la case "Groupé" et le bouton "Ajouter une entrée"), Puis j'ai coché la case "CGAL_Boost_USE_STATIC_LIBS".

Vous devrez peut-être appuyer sur "Configurer" une ou deux fois avant que les options supplémentaires ne soient révélées.

9
dentad

Aujourd'hui, j'ai essayé d'installer CGAL avec Boost 1.57 x64 sous Windows et j'ai rencontré le même problème. J'ai installé boost via des binaires pré-build et les fichiers .lib recherchés par CMake se trouvent dans le dossier lib64-msvc-12.0. Par conséquent, ajouter BOOST_LIBRARYDIR=.../boost_1_57_0/lib64-msvc-12.0 aux options de CMake était la solution pour moi.

2
tomi.lee.jones

Votre système (via CMAKE) n'est pas en mesure de trouver des bibliothèques statiques compatibles avec le boost (fichiers .a). Essayez donc d’inclure le chemin dans le fichier CMake où se trouvent les fichiers .a sur votre système. Par exemple.

set (BOOST_LIBRARYDIR {Path_here_to_boost_libraries}). 

Cela a fonctionné pour moi.

0
PURVESH PATEL