Installation error of mongocxx driver (Ubuntu)

125 views
Skip to first unread message

Ped

unread,
Apr 3, 2019, 5:54:10 PM4/3/19
to mongodb-user
Hello all, 

I'm trying to build the cpp mongo db driver on Ubuntu 16.04 but running into some problems while following the installation procedure.

from Step 4: Configure the driver
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..

I received the following errors

-- Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
CMake Error at src/mongocxx/CMakeLists.txt:37 (find_package):
  By not providing "Findlibmongoc-1.0.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "libmongoc-1.0", but CMake did not find one.

  Could not find a package configuration file provided by "libmongoc-1.0"
  (requested version 1.13.0) with any of the following names:

    libmongoc-1.0Config.cmake
    libmongoc-1.0-config.cmake

I assumed that it is not finding libmongoc-1.0 correctly, so I checked my /usr/local/lib, where I couldn't find it.
usr-local-lib.png

I installed libmongoc from the package manager http://mongoc.org/libmongoc/current/installing.html
$ apt-get install libmongoc-1.0-0

libmongoc.png


so I also tried to build with different location of library, but it still fails to find the library correctly.

"cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/lib/x86-64-linux-gnu .."


I tried to follow the instructions again from the beginning, but I still encountered the same issues for a long time.

Could anyone provide any comments how to address this issue?


Thank you for consideration




Ped

unread,
Apr 4, 2019, 10:39:27 AM4/4/19
to mongodb-user
Hello all,

I also tried to build the libmongoc from the source

$ wget https://github.com/mongodb/mongo-c-driver/releases/download/x.y.z/mongo-c-driver-x.y.z.tar.gz
$ tar xzf mongo-c-driver-x.y.z.tar.gz
$ cd mongo-c-driver-x.y.z
$ mkdir cmake-build
$ cd cmake-build
$ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..

, but somehow the build logs look like it only generate libbson library without libmongoc.

build-log.png


Any suggestions how to build libmongoc? Thank you.

kevin.a...@10gen.com

unread,
Apr 4, 2019, 11:51:56 AM4/4/19
to mongodb-user
Building from source should build both libmongoc and libbson unless you're configuring with ENABLE_MONGOC=OFF. Can you include the cmake + make command you're using to configure and build?

Ped

unread,
Apr 4, 2019, 11:59:32 AM4/4/19
to mongodb-user
Thanks for checking my inquiry.

I'm using the commands from the tutorial
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
Reply all
Reply to author
Forward
0 new messages