[CXX-2738] libmongoc and libbson don't get installed (in program Files/mongo-c-driver) Created: 27/Aug/23 Updated: 27/Oct/23 Resolved: 05/Sep/23 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Daniel Korkotyan | Assignee: | Kevin Albertson |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Build fails in windows 10 (19045.3324). Running 'cmake --build . --config RelWithDebInfo --target install' results in:
|
| Comments |
| Comment by Kevin Albertson [ 05/Sep/23 ] | ||||||
|
Glad to hear that worked.
That may be resolved with CDRIVER-4520. | ||||||
| Comment by Daniel Korkotyan [ 04/Sep/23 ] | ||||||
|
Hi Kevin, Sorry for the late response mate. Running the commands from PS worked, the mongo-c-driver was created in program files, thank you. Can't say I understand why running the commands from mingw makes this kind of trouble. I'll try to read more about it. I followed the guide from here [Build environment on Windows with MinGW-W64 and MSYS2|Installing the MongoDB C Driver (libmongoc) and BSON library (libbson) — libmongoc 1.24.3] Now, I clearly see on the most recently published guide ([Getting Started with MongoDB and C++|[Getting Started with MongoDB and C++ | MongoDB|https://www.mongodb.com/developer/products/mongodb/getting-started-mongodb-cpp/]]) that it says to run these commands from PS or command line. I attached the output of the build target command as PS_cmake_build_and_install_output.txt. It says at the end of the output:
Recursion Count=289, Stack Usage=90 percent
I think the execution worked, but I'll test and make sure of it further first thing tomorrow. Kevin, thank you very much for your time and patience. | ||||||
| Comment by Kevin Albertson [ 30/Aug/23 ] | ||||||
cmake_generate_build_files_output.txt
I expect this is caused by using the mingw shell with the "Visual Studio 17 2022" generator. The C driver uses pkg-config to locate a system install of zstd.
I expect that is the cause of the "Cannot open include file" error. Forcing include of the mingw headers with the MSVC compiler results in errors. I expect mingw headers are not intended to be built with MSVC. I suggest use Powershell or command prompt to build with the "Visual Studio 17 2022" generator. The following succeeded for me: Installed CMake using the "Windows x64 Installer" from https://cmake.org/download/ to the path "C:\cmake".
| ||||||
| Comment by Kevin Albertson [ 29/Aug/23 ] | ||||||
|
Thank you for the additional information. That may help to diagnose the issue.
The cmake_build_and_install_after_DENABLE_ZSTD=OFF_output.txt output suggests this may be due to needed privileges:
Setting -DCMAKE_INSTALL_PREFIX to a different install path may help to work around. | ||||||
| Comment by Daniel Korkotyan [ 28/Aug/23 ] | ||||||
|
Hi Kevin, Sure, I've included the outputs (as attached files) of the following commands, thank you for the response. cmake_generate_build_files_output.txt - cmake -G "Visual Studio 17 2022" -A x64 -S "C:\Repos\mongo-c-driver-1.24.3" -B "C:\Repos\mongo-c-driver-1.24.3\cmake-build" cmake_build_and_install_output.txt - cmake --build . --config RelWithDebInfo --target install
I tried also running the build generate with the DENABLE_ZSTD=OFF flag, but although the output seemed promising, it resulted in errors when running the build and install cmake command. The outputs are included as well. cmake_generate_build_files_with_DENABLE_ZSTD=OFF_output.txt cmake_build_and_install_after_DENABLE_ZSTD=OFF_output.txt | ||||||
| Comment by Kevin Albertson [ 28/Aug/23 ] | ||||||
|
Hi korkotyan@gmail.com , thank you for the report. Can you include the full output of the CMake configure step. There may be output related to zstd that can help to diagnose the issue. Running cmake results in output indicating where zstd is found:
As a workaround: if the zstd network compressor is not needed, consider passing -DENABLE_ZSTD=OFF to the cmake configure step to disable building with zstd. | ||||||
| Comment by PM Bot [ 27/Aug/23 ] | ||||||
|
Hi korkotyan@gmail.com, thank you for reporting this issue! The team will look into it and get back to you soon. |