hyperledger-archives / iroha

Iroha - A simple, decentralized ledger
http://iroha.tech
Apache License 2.0
988 stars 297 forks source link

MSVC shared model build error #1319

Closed walkero closed 6 years ago

walkero commented 6 years ago

hi, @lebdron I followed instructions step by step:

Experimental MSVC shared model build
https://github.com/hyperledger/iroha/pull/1297

when I run cmake -H.\shared_model -B.\build -DCMAKE_TOOLCHAIN_FILE=D:/irohaMS/vcpkg/scripts/buildsystems/vcpkg.cmake received an error: -- Configuring incomplete, errors occurred! CMakeError.log: “pthread.h”: No such file or directory

How to solve this problem?

Thank you

lebdron commented 6 years ago

Hi @walkero . Could you put the whole log when you run cmake -H. ... please? Also could you specify the branch you are using? It might be the case that you did not switch to feature/msvc-shared-model-build branch.

walkero commented 6 years ago

@lebdron thank you I cloned develop branch, now I retry to clone feature/msvc-shared-model-build branch, and new error occurred.

d:\irohaMS>git clone -b feature/msvc-shared-model-build --depth=1 https://github.com/hyperledger/iroha
d:\irohaMS>cd iroha

d:\irohaMS\iroha>cmake -H.\shared_model -B.\build -DCMAKE_TOOLCHAIN_FILE=D:/irohaMS/vcpkg/scripts/buildsystems/vcpkg.cmake
-- Building for: Visual Studio 15 2017
CMake Warning at D:/irohaMS/vcpkg/scripts/buildsystems/vcpkg.cmake:89 (message):
  There are no libraries installed for the Vcpkg triplet x86-windows.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.11/Modules/CMakeDetermineSystem.cmake:94 (include)
  CMakeLists.txt:17 (project)

-- The C compiler identification is MSVC 19.12.25831.0
-- The CXX compiler identification is MSVC 19.12.25831.0
-- Check for working C compiler: d:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: d:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: d:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: d:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found Protobuf: C:/ProgramData/Anaconda3/Library/lib/libprotobuf.lib (found version "3.5.0")
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindBoost.cmake:2044 (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):
  D:/irohaMS/vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package)
  cmake/dependencies.cmake:35 (find_package)
  CMakeLists.txt:49 (include)

-- Could NOT find ed25519 (missing: ed25519_INCLUDE_DIR ed25519_LIBRARY)
CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR
  GTEST_MAIN_LIBRARY)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.11/Modules/FindGTest.cmake:196 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  D:/irohaMS/vcpkg/scripts/buildsystems/vcpkg.cmake:247 (_find_package)
  cmake/dependencies.cmake:53 (find_package)
  CMakeLists.txt:49 (include)

-- Configuring incomplete, errors occurred!
See also "D:/irohaMS/iroha/build/CMakeFiles/CMakeOutput.log".
See also "D:/irohaMS/iroha/build/CMakeFiles/CMakeError.log".

thanks

walkero commented 6 years ago

iroha\build\CMakeFiles\CMakeError.log :

Determining if the include file pthread.h exists failed with the following output:
Change Dir: D:/irohaMS/iroha/build/CMakeFiles/CMakeTmp

Run Build Command:"d:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe" "cmTC_d8712.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=15.0"
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2018/5/9 14:47:37.

Project "D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\cmTC_d8712.vcxproj" on node 1 (default targets).

PrepareForBuild:

  Creating directory "cmTC_d8712.dir\Debug\".

  Creating directory "D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\Debug\".

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

InitializeBuildStatus:

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

VcpkgTripletSelection:

  Not using Vcpkg because VcpkgEnabled is "false"

ClCompile:

  d:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\CL.exe /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_d8712.dir\Debug\\" /Fd"cmTC_d8712.dir\Debug\vc141.pdb" /Gd /TC /analyze- /errorReport:queue D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c

  ?? x86 ? Microsoft (R) C/C++ ????? 19.12.25831 ?

  ????(C) Microsoft Corporation????????

  cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_d8712.dir\Debug\\" /Fd"cmTC_d8712.dir\Debug\vc141.pdb" /Gd /TC /analyze- /errorReport:queue D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c

  CheckIncludeFile.c

D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: ????????: "pthread.h": No such file or directory [D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\cmTC_d8712.vcxproj]

Done Building Project "D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\cmTC_d8712.vcxproj" (default targets) -- FAILED.

Build FAILED.

"D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\cmTC_d8712.vcxproj" (default target) (1) ->

(ClCompile target) -> 

  D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: ????????: "pthread.h": No such file or directory [D:\irohaMS\iroha\build\CMakeFiles\CMakeTmp\cmTC_d8712.vcxproj]

    0 Warning(s)

    1 Error(s)

Time Elapsed 00:00:00.56
lebdron commented 6 years ago

@walkero From the errors in config, such as

Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR
  GTEST_MAIN_LIBRARY)

it seems that either packages are not installed in vcpkg, or CMake fails to detect them. Also this message tells us that packages are not installed: There are no libraries installed for the Vcpkg triplet x86-windows.

Please do the following:

walkero commented 6 years ago

@lebdron

I solved the build problem, thank you. I haven't installed visualstudio2017 with the English language pack, vcpkg need the English language pack to be installed, I reinstll visualstudio2017 with the English language pack.

thanks