alicevision / AliceVision

Photogrammetric Computer Vision Framework
http://alicevision.org
Other
3k stars 827 forks source link

Windows compilation issues - Failed to find Boost #451

Closed joyzyj closed 4 years ago

joyzyj commented 6 years ago

Hi, I am installing AliceVision following the instructions, when I compiled it with CMake, I met some problems.

Here is the CMake error info:

CMake Error at src/CMakeLists.txt:243 (message):
  Failed to find Boost.

CMake Error at src/CMakeLists.txt:244 (message):
  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.

......

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
   used as include directory in directory C:/AliceVision/src
   ......
   used as include directory in directory C:/AliceVision/src/software/utils
C:/AliceVision/src/aliceVision/mvsData/Boost_INCLUDE_DIR
   used as include directory in directory C:/AliceVision/src/aliceVision/mvsData
C:/AliceVision/src/aliceVision/sensorDB/Boost_INCLUDE_DIR
   used as include directory in directory C:/AliceVision/src/aliceVision/sensorDB
C:/AliceVision/src/aliceVision/system/Boost_INCLUDE_DIR
   used as include directory in directory C:/AliceVision/src/aliceVision/system

Configuring incomplete, errors occurred!
See also "C:/AliceVision-build/CMakeFiles/CMakeOutput.log".
See also "C:/AliceVision-build/CMakeFiles/CMakeError.log".

Here is CMakeError.log:

Determining if the include file pthread.h exists failed with the following output:
Change Dir: C:/AliceVision-build/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe" "cmTC_83eea.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=14.0"
Microsoft (R) Build Engine version 14.0.25420.1

Copyright (C) Microsoft Corporation. All rights reserved.

Build started 7/23/2018 7:01:10 PM.

The target "CopyLocalFilesOutputGroup" listed in a BeforeTargets attribute at "c:\Vcpkg\scripts\buildsystems\msbuild\vcpkg.targets (80,82)" does not exist in the project, and will be ignored.

Project "C:\AliceVision-build\CMakeFiles\CMakeTmp\cmTC_83eea.vcxproj" on node 1 (default targets).

PrepareForBuild:

  Creating directory "cmTC_83eea.dir\Debug\".

  Creating directory "C:\AliceVision-build\CMakeFiles\CMakeTmp\Debug\".

  Creating directory "cmTC_83eea.dir\Debug\cmTC_83eea.tlog\".

InitializeBuildStatus:

  Creating "cmTC_83eea.dir\Debug\cmTC_83eea.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

VcpkgTripletSelection:

  Using triplet "x64-windows" from "c:\Vcpkg\installed\x64-windows\"

ClCompile:

  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"c:\Vcpkg\installed\x64-windows\include" /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /arch:AVX2 /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /openmp /Fo"cmTC_83eea.dir\Debug\\" /Fd"cmTC_83eea.dir\Debug\vc140.pdb" /Gd /TC /errorReport:queue "C:\AliceVision-build\CMakeFiles\CMakeTmp\CheckIncludeFile.c"

  Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64

  Copyright (C) Microsoft Corporation.  All rights reserved.

  cl /c /I"c:\Vcpkg\installed\x64-windows\include" /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /arch:AVX2 /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /openmp /Fo"cmTC_83eea.dir\Debug\\" /Fd"cmTC_83eea.dir\Debug\vc140.pdb" /Gd /TC /errorReport:queue "C:\AliceVision-build\CMakeFiles\CMakeTmp\CheckIncludeFile.c"

  CheckIncludeFile.c

C:\AliceVision-build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [C:\AliceVision-build\CMakeFiles\CMakeTmp\cmTC_83eea.vcxproj]

Done Building Project "C:\AliceVision-build\CMakeFiles\CMakeTmp\cmTC_83eea.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\AliceVision-build\CMakeFiles\CMakeTmp\cmTC_83eea.vcxproj" (default target) (1) ->

(ClCompile target) -> 

  C:\AliceVision-build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [C:\AliceVision-build\CMakeFiles\CMakeTmp\cmTC_83eea.vcxproj]

    0 Warning(s)

    1 Error(s)

Time Elapsed 00:00:00.49

I install Boost using Vcpkg, and in C:\Vcpkg\packages\boost_x64-windows\ there are only two files: BUILD_INFO and CONTROL.

I don't know whether it's useful, the contents of the two files are as follow: BUILD_INFO

CRTLinkage: dynamic
LibraryLinkage: dynamic
PolicyEmptyPackage: enabled

CONTROL

Package: boost
Version: 1.67.0
Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context, boost-contract, boost-conversion, boost-convert, boost-core, boost-coroutine, boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-disjoint-sets, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber, boost-filesystem, boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams, boost-iterator, boost-lambda, boost-lexical-cast, boost-locale, boost-local-function, boost-lockfree, boost-log, boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-optional, boost-parameter, boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python, boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-scope-exit, boost-serialization, boost-signals, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace, boost-statechart, boost-static-assert, boost-system, boost-test, boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure, boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-vmd, boost-wave, boost-winapi, boost-xpressive
Architecture: x64-windows
Multi-Arch: same
Description: Peer-reviewed portable C++ source libraries

How can I find Boost_INCLUDE_DIR?

Thanks!

fabiencastan commented 6 years ago

Are you sure that you give the right path to vcpkg on the cmake command line? cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\Vcpkg\scripts\buildsystems\vcpkg.cmake

dir C:\Vcpkg\scripts\buildsystems\vcpkg.cmake

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.