Error: Could not find git for clone of EP_mnmlstc_core

I would like to use MongoDB in a C++ program so am attempting to download the mongocxx driver.

I installed Boost 1_73_0
I then followed the instructions to install the mongoc library in Installing the MongoDB C Driver (libmongoc) and BSON library (libbson) — libmongoc 1.17.6 I installed version 1.17.6 it seemed to work ok.
I can see the following folders in my usr/local/include directory: libbson-1.0 libmongoc-1.0
I can see the several libbson and lobmongoc .so and .a files in my usr/local/lib directory

I then tried to follow the instructions in Linux
to install the mongocxx driver . I downloaded version 3.6.5 and when i try to run the following line

> cmake ..                                \
>     -DCMAKE_BUILD_TYPE=Release          \
>     -DCMAKE_INSTALL_PREFIX=/usr/local

I get the following error:

– Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
bsoncxx version: 3.6.5
found libbson version 1.17.6
CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2421 (message):
error: could not find git for clone of EP_mnmlstc_core
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/ExternalProject.cmake:3236 (_ep_add_download_command)
src/bsoncxx/third_party/CMakeLists.txt:19 (ExternalProject_Add)

– Configuring incomplete, errors occurred!

I am completely stuck as to what i am doing wrong or what EP_mnmlstc_core is and what i can do to fix this issue.

Any help would be greatly appreciated

It looks like git is not installed and your build wants git to clone something as part of its build.

1 Like

@arif_saeed As @Jack_Woehr pointed out, the error message you are seeing is a result of the git command not being available. It is needed in order to clone the MNMLSTC project. However, you mentioned that you installed Boost, so I assume that you want to use Boost rather than MNMLSTC. In order to use the Boost polyfill, add the option -DBSONCXX_POLY_USE_BOOST=1 to the cmake command.

2 Likes