web-dev-qa-db-ja.com

CMakeがBoostを見つけられない

この質問と同じタイトルの質問が少なくとも3つありました。それらのそれぞれは、OPでは機能しましたが私では機能しませんでしたので、質問を繰り返して申し訳ありません...

CGALをインストールしようとしています。彼らは、インストールプロセスを非常に単純なものとして説明しています here 、セクション6.1。 cmake-guiを実行してconfigureをクリックすると、次の出力が得られます

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)

しかし、私はDID cmakeのguiでBOOST_ROOTD:/program files/boost_1_51にセットアップします。これが言及している2つのライブラリは間違いなくインストールされています。ここで何が起きていますか?する必要がありますか?

[〜#〜] edit [〜#〜]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!
33
olamundo

出力は、CMakeが次の場所でライブラリを検索していることを示しています。

_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
_

また、ライブラリが特定の方法で命名されることを期待していることも示しています。たとえば、Boost.Threadのリリースバージョン:

_boost_thread-vc100-mt-1_51
boost_thread-vc100-mt
boost_thread-mt-1_51
boost_thread-mt
boost_thread
_

検索した場所のいずれかにブーストライブラリが存在する場合、問題の原因はおそらくライブラリの名前です。 FindBoostモジュール に関連する適切なCMake変数を設定することにより、ブーストライブラリの予想される名前を調整できます。

たとえば、bjamで_link=static threading=multi_を使用してブーストを構築した場合、CMakeLists.txtでfind_package(Boost ...)の前に実行します

_set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
_

または_-DBoost_USE_STATIC_LIBS=ON -DBoost_USE_MULTITHREADED=ON_でcmakeを呼び出します

編集

@noamが以下のコメントで指摘しているように、この特定のケースでは、CGALはブーストライブラリの共有(dll)バージョンを必要とするようです。コマンドラインで_-DBoost_USE_STATIC_LIBS=ON_を渡しても効果はありません。

25
Fraser

このエラーが発生しましたが、進行しました。

私はcmake-guiを使用していたので、「Advanced」チェックボックス(「Grouped」チェックボックスと「Add Entry」ボタンの間)にチェックマークを付け、新しく表示されたチェックボックス「CGAL_Boost_USE_STATIC_LIBS」にチェックマークを付けました。

追加のオプションが表示されるまでに、「構成」を1〜2回押す必要がある場合があります。

9
dentad

今日、私はWindowsにBoost 1.57 x64でCGALをインストールしようとしましたが、同じ問題に遭遇しました。ビルド前のバイナリ経由でブーストをインストールしました。CMakeが検索する.libファイルはlib64-msvc-12.0フォルダー。したがって、BOOST_LIBRARYDIR=.../boost_1_57_0/lib64-msvc-12.0 CMakeオプションを使用することが私にとっての解決策でした。

2
tomi.lee.jones

システムは(CMAKEを介して)ブースト対応の静的ライブラリ(.aファイル)を見つけることができません。したがって、システム内の.aファイルが存在するCMakeファイルにパスを含めるようにしてください。たとえば.

set(BOOST_LIBRARYDIR {Path_here_to_boost_Static_libraries})。

これは私のために働いた。

0
PURVESH PATEL