I am following this post and fdb’s readme to setup foundationdb on Visual Studio 2019 and I am getting an error while building. This is probably some error in my build setup, but googling is not helping me right now, hence posting the error here.
Steps taken:
- Downloaded and unzipped boost to C:\Program Files\boost_1_67_0
- Installed mono
- I don’t need bindings or MSI of fdb, so didn’t follow anything related to them
- Using visual sutio, cloned (github) and setup a new project for fdb
- Added CMakeSettings.json in project directory with below contents
When I build the project, I get below output:
1> CMake generation started for configuration: ‘x64-Debug’.
1> Command line: “cmd.exe” /c ““C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe” -G “Visual Studio 16 2019” -A x64 -DCMAKE_INSTALL_PREFIX:PATH=“C:\Users\Rishabh\Source\Repos\foundationdb\out\install\x64-Debug” -DBOOST_ROOT:STRING=“C:/Program Files/boost_1_67_0” -DCMAKE_CONFIGURATION_TYPES=“Debug” “C:\Users\Rishabh\Source\Repos\foundationdb” 2>&1”
1> Working directory: C:\Users\Rishabh\Source\Repos\foundationdb\out\build\x64-Debug
1> [CMake] – Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17134.
1> [CMake] – The C compiler identification is MSVC 19.23.28106.4
1> [CMake] – The CXX compiler identification is MSVC 19.23.28106.4
1> [CMake] – The ASM compiler identification is MSVC
1> [CMake] – Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
1> [CMake] – Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
1> [CMake] – Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe – works
1> [CMake] – Detecting C compiler ABI info
1> [CMake] – Detecting C compiler ABI info - done
1> [CMake] – Detecting C compile features
1> [CMake] – Detecting C compile features - done
1> [CMake] – Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
1> [CMake] – Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe – works
1> [CMake] – Detecting CXX compiler ABI info
1> [CMake] – Detecting CXX compiler ABI info - done
1> [CMake] – Detecting CXX compile features
1> [CMake] – Detecting CXX compile features - done
1> [CMake] – C:/Users/Rishabh/source/repos/foundationdb C:/Users/Rishabh/source/repos/foundationdb/out/build/x64-Debug
1> [CMake] – Looking for pthread.h
1> [CMake] – Looking for pthread.h - not found
1> [CMake] – Found Threads: TRUE
1> [CMake] – Could NOT find LibreSSL, try to set the path to LibreSSL root folder in the system variable LibreSSL_ROOT (missing: LIBRESSL_CRYPTO_LIBRARY LIBRESSL_SSL_LIBRARY LIBRESSL_TLS_LIBRARY LIBRESSL_INCLUDE_DIR)
1> [CMake] – LibreSSL NOT Found - Will compile without TLS Support
1> [CMake] – You can set LibreSSL_ROOT to the LibreSSL install directory to help cmake find it
1> [CMake] – Found JNI: C:/Program Files/Java/jdk1.8.0_25/lib/jawt.lib (Required is at least version “1.8”)
1> [CMake] – Found Java: C:/Program Files/Java/jdk1.8.0_25/bin/java.exe (found suitable version “1.8.0.25”, minimum required is “1.8”) found components: Development
1> [CMake] – Found Python: C:/Python27/python.exe (found version “2.7.6”) found components: Interpreter
1> [CMake] – Could NOT find Virtualenv (missing: VIRTUALENV_EXE)
1> [CMake] – Current git version 3bb0c12ce9c18ce7b334d6fed349d5e39f2c7d60
1> [CMake] – FDB version is 7.0.0
1> [CMake] – FDB package name is 7.0
1> [CMake] – The CSharp compiler identification is Microsoft unknown 9999
1> [CMake] – The CSharp compiler version is 3.3.1
1> [CMake] – Check for working C# compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/Roslyn/csc.exe
1> [CMake] – Check for working C# compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/Roslyn/csc.exe – works
1> [CMake] – Found Boost: C:/Program Files/boost_1_67_0 (found suitable version “1.67.0”, minimum required is “1.67”)
1> [CMake] – Check versions.h on flow_actors
1> [CMake] – Check versions.h on fdbrpc_actors
1> [CMake] – Check versions.h on fdbclient_actors
1> [CMake] – Check versions.h on fdbserver_actors
1> [CMake] – Check versions.h on fdbcli_actors
1> [CMake] – The ASM_MASM compiler identification is MSVC
1> [CMake] – Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/ml64.exe
1> [CMake] – Check versions.h on fdb_flow_actors
1> [CMake] – Check versions.h on fdb_flow_tester_actors
1> [CMake] – Building fat jar to C:/Users/Rishabh/source/repos/foundationdb/out/build/x64-Debug/packages
1> [CMake] – Check versions.h on fdbbackup_actors
1> [CMake] – Use old fdb at C:/Program Files/foundationdb/bin/fdbserver.exe
1> [CMake] – ADDING SIMULATOR TEST 0 SimpleExternalTest
…Skipped lines…
1> [CMake] – ADDING SIMULATOR TEST 109 status/single_process_too_many_config_params
1> [CMake] – Could not find WIX installation - try setting WIX_ROOT or the WIX environment variable (missing: WIX_CANDLE WIX_LIGHT)
1> [CMake] CMake Warning at packaging/msi/CMakeLists.txt:43 (message):
1> [CMake] Could NOT find WIX - will not build installer
1> [CMake]
1> [CMake]
1> [CMake] – =========================================
1> [CMake] – Components Build Overview
1> [CMake] – =========================================
1> [CMake] – Build Java Bindings: ON
1> [CMake] – Build with TLS support: OFF
1> [CMake] – Build Go bindings: OFF
1> [CMake] – Build Ruby bindings: OFF
1> [CMake] – Build Python sdist (make package): ON
1> [CMake] – Build Documentation (make html): OFF
1> [CMake] – =========================================
1> [CMake] – CPACK_COMPONENTS_ALL
1> [CMake] – Configuring done
1> [CMake] – Generating done
1> [CMake] – Build files have been written to: C:/Users/Rishabh/source/repos/foundationdb/out/build/x64-Debug
1> [CMake]
1> Extracted includes paths.
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Error: Object reference not set to an instance of an object.
Contents of CMakeError.log are:
…Skipped lines…
Copyright © Microsoft Corporation. All rights reserved.
Microsoft ® C/C++ Optimizing Compiler Version 19.23.28106.4 for x64
CheckIncludeFile.c
Copyright © Microsoft Corporation. All rights reserved.
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /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_d2c10.dir\Debug\" /Fd"cmTC_d2c10.dir\Debug\vc142.pdb" /Gd /TC /errorReport:queue “C:\Users\Rishabh\source\repos\foundationdb\out\build\x64-Debug\CMakeFiles\CMakeTmp\CheckIncludeFile.c”
C:\Users\Rishabh\source\repos\foundationdb\out\build\x64-Debug\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1,10): fatal error C1083: Cannot open include file: ‘pthread.h’: No such file or directory [C:\Users\Rishabh\source\repos\foundationdb\out\build\x64-Debug\CMakeFiles\CMakeTmp\cmTC_d2c10.vcxproj]
The CSharp compiler identification could not be found in “C:/Users/Rishabh/source/repos/foundationdb/out/build/x64-Debug/CMakeFiles/3.15.19080502-MSVC_2/CompilerIdCSharp/CompilerIdCSharp.csproj”
Checking whether the ASM_MASM compiler is GNU using “–version” did not match “(GNU assembler)|(GCC)|(Free Software Foundation)”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : --version
MASM : fatal error A1017:missing source filename
Checking whether the ASM_MASM compiler is Clang using “–version” did not match “(clang version)”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : --version
MASM : fatal error A1017:missing source filename
Checking whether the ASM_MASM compiler is AppleClang using “–version” did not match “(Apple LLVM version)”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : --version
MASM : fatal error A1017:missing source filename
Checking whether the ASM_MASM compiler is ARMClang using “–version” did not match “armclang”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : --version
MASM : fatal error A1017:missing source filename
Checking whether the ASM_MASM compiler is HP using “-V” did not match “HP C”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : -V
MASM : fatal error A1017:missing source filename
Checking whether the ASM_MASM compiler is Intel using “–version” did not match “(ICC)”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : --version
MASM : fatal error A1017:missing source filename
Checking whether the ASM_MASM compiler is SunPro using “-V” did not match “Sun C”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : -V
MASM : fatal error A1017:missing source filename
Checking whether the ASM_MASM compiler is XL using “-qversion” did not match “XL C”:
Microsoft ® Macro Assembler (x64) Version 14.23.28106.4
Copyright © Microsoft Corporation. All rights reserved.
MASM : warning A4018:invalid command-line option : -qversion
MASM : fatal error A1017:missing source filename
Am I doing something wrong in my boost setup because of which pthread.h is not recognized? Or is this error because of some different reason and boost setup is actually fine?